Sonoff Mqtt Double tap


(Patrick Heilmann) #1

Hi,

i try to configure openhab2 to recognize a Double tap from a sonoff Touch (tasmota) via mqtt.

Could somebody help to configure this thing in openhab2?

The sonoff is currently working as a mqtt device in openhab2. So the normal function On/Off is working.


(Udo Hartmann) #2

I’m not aware of an option to get a double touch signal from Sonoff Touch, but of course you can detect ON/OFF duration. If position lasts less than a Second, detect it as a double touch, if position lasts more than a Second, detect a single touch. Makes only sense if not using the relay


(Patrick Heilmann) #3

I got it working. I created a mqtt device with the double tap mqtt topic and a string value. So is not a Classic on/off switch. It just gets a string with the value TOGGLE from the sonoff.

Perfect. This was the last thing that i have to do for the change from fhem to openhab2.


(Udo Hartmann) #4

Could you please add the topic (just in case somebody else wants to do the same)?


(Gad Ofir) #5

with Tasmota you can have long Double and single press

all are sent to the same topic, with different payload


(Udo Hartmann) #6

Ah. I guess you’re up to this: https://github.com/arendst/Sonoff-Tasmota/wiki/Control-other-devices#double-press--hold
But as it is either “send MQTT when double press” OR “send MQTT when single press” I don’t see a real benefit. :slight_smile:


(Patrick Heilmann) #7

On the sonoff you have to configure the following in the console:
SaveData 1
SetOption1 1
SetOption11 1
ButtonTopic double
SaveData 0

The mqtt state in openhab2 must be cmnd/double/POWER1 and the string value TOGGLE or HOLD

With this function the sonoff has three functions On/Off, TOGGLE (double Tap) and HOLD.