Anyway to make tasmota imitate a push button click?

2k Views Asked by At

I was wondering if there is a way to use tasmota to imitate a push button click. I'am using an esp32 with tasmota and wired it to a remote with 2 buttons. There a 2 transistors for each button. It works how it is right now but the logic of the buttons on the Tasmota website toggles the output. So that I have to click and click to send a pulse. Is there a way to make the digital button click like a push button?.

Also is there a way to remember a variable for example from 1 to 6 and display it next to the button?

Thank you!

1

There are 1 best solutions below

0
On

For short impulse can use : PulseTime

1..111 = set PulseTime for Relay in 0.1 second increments

112..64900 = set PulseTime for Relay, offset by 100, in 1 second increments. Add 100 to desired interval in seconds, e.g., PulseTime 113 = 13 seconds and PulseTime 460 = 6 minutes (i.e., 360 seconds)

For save to variables can use like it:

rule1
 on button1#state DO var1=%value% ENDDO
 on button2#state DO var2=%value% ENDDO

For use differ method of action better to use event: When state of buttons changed then sent event:

 on button1#state DO event#b1 %value% ENDDO
 on button2#state DO event#b2 %value% ENDDO

Then Event that was send expanded on your commands like power1 on/off :

 on event#b1 DO power1 %value% ENDDO
 on event#b2 DO power2 %value% ENDDO

And remote by MQTT can sent event for button1, and should be run same commands like and for your buttons :

mosquitto_pub  -h HOST -t cmnd/tasmota_NNNN/event#b1 -m 1