ESP Easy rule to enable button
Moderators: grovkillen, Stuntteam, TD-er
ESP Easy rule to enable button
In the past someone posted a rule to enable the switching ON/OFF by pressing the button on Sonoff 10A but for some reason the rule partially works meaning that it turns on the light but then it automatically turns it off after some seconds and I do not understand why....
in ESP EASY v 12 I have the following devices:
LightSwitch is configured as:
Rule is:
on lightSwitch#Switch do
if [lightState#Switch]=0
gpio,12,1
else
gpio,12,0
endif
endon
Why does it automatically turn off I really have no clue...
in ESP EASY v 12 I have the following devices:
LightSwitch is configured as:
Rule is:
on lightSwitch#Switch do
if [lightState#Switch]=0
gpio,12,1
else
gpio,12,0
endif
endon
Why does it automatically turn off I really have no clue...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESP Easy rule to enable button
You shouldn't use "normal switch" mode. Use one of the active high/low.
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: ESP Easy rule to enable button
I tried both and didn't make a difference
Re: ESP Easy rule to enable button
That can not work. Try this...
on lightSwitch#Switch do
if [lightSwitch#Switch]=0
gpio,12,0
else
gpio,12,1
endif
endon
on lightSwitch#Switch do
if [lightSwitch#Switch]=0
gpio,12,0
else
gpio,12,1
endif
endon
Re: ESP Easy rule to enable button
I see what you did there and I get it, but still it doesn't work..
Re: ESP Easy rule to enable button
Can you post all rules and some screenshots of your config?
Re: ESP Easy rule to enable button
There is only one rule and is the one posted above, config screenshots are the ones above
Re: ESP Easy rule to enable button
The button works, it stays on for approx 5 seconds and then it automatically turns off
Re: ESP Easy rule to enable button
Where do you see screenshots above? Have you checked the log, if there is something to see what the reason could be?
Re: ESP Easy rule to enable button
You want to use a momentary switch to toggle a gpio
Try this
Code: Select all
on lightSwitch#Switch do
if [lightSwitch#Switch]=0
event myevent
endif
endon
on myevent do
if [lightState#Switch]=0
gpio,12,1
else
gpio,12,0
endif
endon
Code: Select all
on lightSwitch#Switch do
if [lightSwitch#Switch]=0
event myevent
endif
endon
on myevent do
if [lightState#Switch]=0
TaskValueSet 2,1
else
TaskValueSet 2,0
endif
endon
Code: Select all
On lightSwitch#Switch do
if [lightSwitch#Switch]=0
event MyEvent
Endif
Endon
On MyEvent do
if [lightState#Switch]=0
InputSwitchState 1,1
else
InputSwitchState 1,0
endif
Endon
Re: ESP Easy rule to enable button
@danmero: Where is the point that helps him and that we not already posted/suggested above?
BTW: TaskValueSet needs 3 values, not 2!
BTW: TaskValueSet needs 3 values, not 2!
Re: ESP Easy rule to enable button
I tried using the event and it behaves the same, it turns on and stays on for some 5/6 seconds and then turns off
Re: ESP Easy rule to enable button
DEVICES
LIGHTSWITCH
RULE
Code: Select all
on lightSwitch#Switch do
if [lightSwitch#Switch]=0
gpio,12,1
else
gpio,12,0
endif
endon
Who is online
Users browsing this forum: Google [Bot] and 51 guests