Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
Moderators: grovkillen, Stuntteam, TD-er
Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
I flashed both Sonoff RF and Sonoff S22(same Sonoff basic but with a thermo/humidity detector jack), flashed ESPeasy 2.0.0 dev10, dev 1024 version. Whenever power on the unit, if I press the button, the relay click on and off endlessly. If I press the button for long time, the on/off stops and everything return to normal, further button press or RF remote press all functions well. Below is my unit setup, can you help identify the problem?
Thanks!
Thanks!
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
You need to change a few things. In button device (switch1), change to normal switch, enable pull-up.tony_wk wrote: ↑18 Jul 2017, 07:58 I flashed both Sonoff RF and Sonoff S22(same Sonoff basic but with a thermo/humidity detector jack), flashed ESPeasy 2.0.0 dev10, dev 1024 version. Whenever power on the unit, if I press the button, the relay click on and off endlessly. If I press the button for long time, the on/off stops and everything return to normal, further button press or RF remote press all functions well. Below is my unit setup, can you help identify the problem?
Thanks!
无标题.jpg
新建位图图像.jpg
无标题2.jpg
in rules change
Code: Select all
on switch1#Switch do
if [relay#switch]=1...
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
For me it worked by turning off the send to controller option on both devices and use rules instead.
The rules I've used:
Change the ip address, port and IDX.
Regards,
Bryan
The rules I've used:
Code: Select all
On System#Boot do
timerSet,1,5
endon
On Rules#Timer=1 do
SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=0
endon
on switch1#Switch do
if [relay#switch]=0
GPIO,12,1
SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=1
else
GPIO,12,0
SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=0
endif
endon
Regards,
Bryan
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
The second part can be written as:bryan wrote: ↑18 Jul 2017, 10:55 For me it worked by turning off the send to controller option on both devices and use rules instead.
The rules I've used:
Change the ip address, port and IDX.Code: Select all
On System#Boot do timerSet,1,5 endon On Rules#Timer=1 do SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=0 endon on switch1#Switch do if [relay#switch]=0 GPIO,12,1 SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=1 else GPIO,12,0 SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=0 endif endon
Regards,
Bryan
Code: Select all
on switch1#Switch do
GPIO,12,[relay#switch]
SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=[relay#switch]
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: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
This is a feedback loop caused by a time delay in the feedback... Set a response delay time in your switch so it won't react to the controller for a fixed amount of time...bryan wrote: ↑18 Jul 2017, 10:55 For me it worked by turning off the send to controller option on both devices and use rules instead.
The rules I've used:
Change the ip address, port and IDX.Code: Select all
On System#Boot do timerSet,1,5 endon On Rules#Timer=1 do SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=0 endon on switch1#Switch do if [relay#switch]=0 GPIO,12,1 SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=1 else GPIO,12,0 SendToHTTP 192.168.0.xx,8080,/json.htm?type=command&parm=udevice&idx=xxx&nvalue=0 endif endon
Regards,
Bryan
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
In order to prevend a feedback loop, it would be better to send the update to domoticz using rules.
You never know what value to use to set the delay.
But if you still want to use the send to controller option with a delay, you might want to turn off the send to controller for the button. You only need to send the state of the relay once.
You never know what value to use to set the delay.
But if you still want to use the send to controller option with a delay, you might want to turn off the send to controller for the button. You only need to send the state of the relay once.
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
I can't change the switch1 type from push button active low to normal switch, as it represents the physical push button. once I change to normal switch, every time I push it, the relay on off on off 4 times.toffel969 wrote: ↑18 Jul 2017, 10:45You need to change a few things. In button device (switch1), change to normal switch, enable pull-up.tony_wk wrote: ↑18 Jul 2017, 07:58 I flashed both Sonoff RF and Sonoff S22(same Sonoff basic but with a thermo/humidity detector jack), flashed ESPeasy 2.0.0 dev10, dev 1024 version. Whenever power on the unit, if I press the button, the relay click on and off endlessly. If I press the button for long time, the on/off stops and everything return to normal, further button press or RF remote press all functions well. Below is my unit setup, can you help identify the problem?
Thanks!
无标题.jpg
新建位图图像.jpg
无标题2.jpg
in rules change
Then nCode: Select all
on switch1#Switch do if [relay#switch]=1...
For my final hybrid solution, I keep 2 switch' hardware setting unchanged,
this is my rule
On System#Boot do
timerSet,1,3
endon
On Rules#Timer=1 do
SendToHTTP 192.168.1.208,8080,/json.htm?type=param=switchlight&command&idx=93&switchcmd=On
On switch1#Switch do
if [relay#switch]=0
GPIO,12,1
else
GPIO,12,0
endif
endon
that finally works.
Bryan's solution doesn't work for me. the physical button is not functioning.
still don't know the root cause....
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
Well, glad to hear that you got it working!
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
Good to hear that it is working.
Maybe it will also be solved for you when you turn on send boot state for the relay?
The rules I've posted came from a sonoff touch, but I thought it should be the same, also (touch) button and relay.
Other thoughts: when you send to controller on both devices, you will switch the relay 2 times (See domoticz log). That should not be needed.
Also when using the rule: SendToHTTP 192.168.1.208,8080,/json.htm?type=param=switchlight&command&idx=93&switchcmd=On ,
it will trigger the relay switch and send the command back to the sonoff.
When using: SendToHTTP 192.168.1.208,8080,/json.htm?type=param=udevice&command&idx=93&nvlaue=1 ,
it will only update the switch state in domoticz and domoticz will not send anything back to the sonoff.
Maybe it will also be solved for you when you turn on send boot state for the relay?
The rules I've posted came from a sonoff touch, but I thought it should be the same, also (touch) button and relay.
Other thoughts: when you send to controller on both devices, you will switch the relay 2 times (See domoticz log). That should not be needed.
Also when using the rule: SendToHTTP 192.168.1.208,8080,/json.htm?type=param=switchlight&command&idx=93&switchcmd=On ,
it will trigger the relay switch and send the command back to the sonoff.
When using: SendToHTTP 192.168.1.208,8080,/json.htm?type=param=udevice&command&idx=93&nvlaue=1 ,
it will only update the switch state in domoticz and domoticz will not send anything back to the sonoff.
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
My further revision to the device setup is only setup GPIO0 switch send to controller and send boot state. For relay switch, none are selected. This solves some 1st press the button, relay turns on then off problem, but domoticz status is still not updated. To solve that, I need to use your boot timer.bryan wrote: ↑18 Jul 2017, 22:18 Good to hear that it is working.
Maybe it will also be solved for you when you turn on send boot state for the relay?
The rules I've posted came from a sonoff touch, but I thought it should be the same, also (touch) button and relay.
Other thoughts: when you send to controller on both devices, you will switch the relay 2 times (See domoticz log). That should not be needed.
Also when using the rule: SendToHTTP 192.168.1.208,8080,/json.htm?type=param=switchlight&command&idx=93&switchcmd=On ,
it will trigger the relay switch and send the command back to the sonoff.
When using: SendToHTTP 192.168.1.208,8080,/json.htm?type=param=udevice&command&idx=93&nvlaue=1 ,
it will only update the switch state in domoticz and domoticz will not send anything back to the sonoff.
For me, the 2 types of SendToHTTP rule you mentioned has no difference, they all physically turn on the relay. It may be related to the different device setup you have?
Re: Power on Sonoff ESPeasy and 1st button push, go into endless relay on/off cycle
You can see the difference in behaviour best when you send the commands directly from a webbrowser to domoticz:
http://192.168.1.208:8080/json.htm?type ... itchcmd=On
updates domoticz and turns on switch
http://192.168.1.208:8080/json.htm?type ... 3&nvalue=1
updates domoticz
Regards,
Bryan
http://192.168.1.208:8080/json.htm?type ... itchcmd=On
updates domoticz and turns on switch
http://192.168.1.208:8080/json.htm?type ... 3&nvalue=1
updates domoticz
Regards,
Bryan
Who is online
Users browsing this forum: No registered users and 91 guests