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?