Sonoff Toggle Switch

I have set up several Sonoffs using the Tasmota firmware and they are all working OK. They are the basic sonoff and I am using the GPIO14 input connection to control them locally using a single pole single throw switch (SPST) ie I can toggle the switch and that will turn the sonoff ON or OFF accordingly depending on it’s previous state. This is achieved using GPIO14 set to 09 Switch1. All good.

I now have another sonoff I want to install but the switch I need to use is a momentary switch only - when you press it closes the contacts when you release the contacts open. I had hoped this could be used on the GPIO14 connection and use one of the other available Switch settings but none work. The only one it works on is the same 09 Switch1. Of course what happens is that the sonoff operates when the button is pressed but then immediately reverts state when the button is released…more or less what I would expect however not what I want!

Does anyone know whether the Tasmota firmware supports a momentary action switch or am I doing something else wrong??

Espeasy firmware supports momentary push switches.

Thanks for that. I will check out the Espeasy firmware.

It looks like you could also just wire to the connections for the builtin button. This video shows how starting around 17:30.

Yes I have seen that video and understand I could just parallel up with the onboard button. As Jonathan says though you are theoretically running the risk of resetting the device if someone just presses in the button for more than a few seconds.
It seems strange that the Tasmota firmware covers so many permutations but not this basic one. I will post over there to see if Theo has a response.

With espeasy the config for push switch on the spare GPIO (gpio14) looks like this:

When you click the momentary button connected to gpio14 it toggles the state of the switch entity.

Did you ever find a solution?

Hi Steve

Hard to remember but I do know they are working exactly how I want and have been doing so for about a year with no problems.

I may have been having a brain fade that day. The default action is essentially what I wanted:

I’ve actually got SwitchMode = 4 as per the articles description about toggle buttons.

Also wish to know. Had the same needs and I solved with a simple automation (trigger switch to ON, action turn OFF after 500 milliseconds)