MQTT message Sonoff touch T1 without double press or long-hold?

35 views
Skip to first unread message

realcuse

unread,
Apr 6, 2020, 6:19:21 AM4/6/20
to sonof...@googlegroups.com
Dear all, 

need urgent help with button#state. Is it possible to publish one MQTT message(s) if button is presses once and short on Sonoff touch T1? 
To be more precise: 

on first short press i need the following: power on + mqtt message 1
on second short press i need: power off + mqtt message 2

Thanks!

Philip Knowles

unread,
Apr 6, 2020, 7:03:45 AM4/6/20
to TasmotaUsers, realcuse
It should work the same but you may need to change the module to Generic to give access to all the GPIOs.

Sent from Outlook Mobile


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of realcuse <streit...@gmail.com>
Sent: Monday, April 6, 2020 11:19:21 AM
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: MQTT message Sonoff touch T1 without double press or long-hold?
 
Dear all, 

need urgent help with button#state. Is it possible to publish one MQTT message(s) if button is presses once and short on Sonoff touch T1? 

Thanks!

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/7514d783-13ec-4dbd-af95-a7bbb661805f%40googlegroups.com.

realcuse

unread,
Apr 6, 2020, 7:18:02 AM4/6/20
to TasmotaUsers

I have done this already, and setoption 51 on to see GPIO9 and 10 for touch 2CH. Its on generic. on sonoff mini with switch attached it works fine with the following rules:


backlog SwitchMode1 2; rule1 on switch1#state=1 do publish stat/bewegung_kueche/POWER OFF endon on switch1#state=0 do publish stat/bewegung_kueche/POWER ON endon;  rule2 on switch1#state=1 do power on endon on switch1#state=0 do power off endon; rule1 1; rule2 1


but this doesnt work on sonoff touch, even if gpio 0 is changed to switch. 


my problem is: light should turn (relais power on) on on first button press and motion sensor should switch off via mqtt command1, and on second button press light should turn off and motion sensor should switch on via mqtt command2 (all using the same button). 


Any suggestion how to solve this? Cant find documentation for use button1#state=0 oder button1#state=1, is it possible to use these? 

Reply all
Reply to author
Forward
0 new messages