Hello I flashed ESPEasy v 148 onto Sonoff plugs and I am able to control them via OpenHab2/MQTT; however I would like to be able to manually switch on/off by pressing the little button on the plug; is it possible? If yes, how?
Hereafter my devices config:
These are my rules:
on lightSwitch#Switch do
if [lightState#Switch]=0
gpio,12,0
else
gpio,12,1
endif
endon
Sonoff Enable button after flashing v 148
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Sonoff Enable button after flashing v 148
This is my rule. As you see you only want to check the button state since it will control the relay state. Your rule will never change the relay since the "if" will always see that the relay state is 0. So change if [lightState#Switch]=0 to if [lightSwitch#Switch]=0
Code: Select all
on Button#State do
if [Button#State]=0
Publish %sysname%/status,Manual turn off relay
gpio,12,0
gpio,13,1
else
Publish %sysname%/status,Manual turn on relay
gpio,12,1
gpio,13,0
endif
endon
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Sonoff Enable button after flashing v 148
That made it, thanks!!!
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest