Device button with 4 different actions

Well if it is a button and not a relay you are trying to activate I don’t believe power would be the command.

“Power” or “toggle”… it doesn´t matter. But my problem is that the switch does not recognize the difference between a single and a double click. Also, it does not decouple from the relais which it should as the single or double click should not control the relais of the same sonoff device but from different ones.

What I believe you are trying to do is use device A buttons to control a gate button for Device B.

This write up is for multi button press on a master device to control other devices topics.
I’m not sure how to do button presses on slave devices from another device.

Multiple press settings for device A
Has nothing to do with the number of press for device B.

Write up exacty what your trying to do.
With type of master device {Device A}and the topic name of that device
And the slave device {device B} type and topic or button and action you want.
Someone smarter than me should be able to help you out. In the discord channels or maybe @digiblur can help you

1 Like

Rod, thanks once again for your help. Just a quick update how I managed to get it all sorted out: The Sonoff Mini’s GPIO 4 needs to be configured as a Button. As the Mini already has one button configured internally, this one needs to be configured as Button 2.

Once this was sorted out, I managed to use your code. But it did need a smaller correction

This indeed needs to be #state=10

And then it all worked like a charme.

I did not notice we were on this old post

This one might help you with other tricks.
Most of our 1 to 3 button switches {15 of them}in our house is set up with most of the below link set-up.
Controling esp Wled lights, esphome based led lights and many other automation.