You must set correct switch mode in ESPeasy.
"Switch Button Type: Normal Switch or Push Button
It depends on your mechanical switch type.
If you have got push button, select Push Button and then each press of switch changes relay state.
If You have got ON/OFF switch, select normal switch and then each change of state this switch will change state of relay.
And on ESPeasy uncheck "send to controller" on relay device.
Do not write IDX there, its not needed, you send command via http request.
And on Domoticz side:
If you have god checked send to controller, there will be some message pingpong between Domoticz and ESPEasy.
With my setup, if you switch relay in Domoticz, ESPeasy will set GPIO and do nothing.
If you press switch on ESPeasy ( sonoff ), ESPeasy sets GPIO and sends relay state to Domoticz.
And Domoticz in this moment sends back relay state to ESPeasy, but it is previously set to the same value, so it is not too wrong.
Sonoff basic with wall switch
Moderators: grovkillen, Stuntteam, TD-er
Re: Sonoff basic with wall switch
I have finally been able to flash the latest build (v2.0-20180220) on my sonoff basic.
Now I can continue with the actual problem.
If I want to switch my sonoff the signal seems to be pingpong so the sonoff switches on and off several times.
What have I done now:
I have 1 virtual switch in domoticz with on-off action:
-http://10.0.1.39/control?cmd=event,lamp_on
-http://10.0.1.39/control?cmd=event,lamp_off
In the ESP software I added two devices for my sonoff. 1 for GPIO-12 (called 'rele') and 1 for GPIO-14 (called ' SW01).
On the GPIO12 I connected a light.
On the GPIO14 I connected a normal wall switch (to my light) to ground and GPIO12 of my sonoff.
As a rule I added:
What I'm trying to achieve is that I can operate my light with the wall switch, but also from domoticz.
My gueass is that the rule isn't right and that's wy the signal pingpong but I can not figure it out. Can please someone help me?
Now I can continue with the actual problem.
If I want to switch my sonoff the signal seems to be pingpong so the sonoff switches on and off several times.
What have I done now:
I have 1 virtual switch in domoticz with on-off action:
-http://10.0.1.39/control?cmd=event,lamp_on
-http://10.0.1.39/control?cmd=event,lamp_off
In the ESP software I added two devices for my sonoff. 1 for GPIO-12 (called 'rele') and 1 for GPIO-14 (called ' SW01).
On the GPIO12 I connected a light.
On the GPIO14 I connected a normal wall switch (to my light) to ground and GPIO12 of my sonoff.
As a rule I added:
Code: Select all
on lamp_on do
gpio,12,1
gpio,13,0
endon
on lamp_off do
gpio,12,0
gpio,13,1
endon
on lamp_change do
if [rele#Switch]=1
event,lamp_off
SendToHTTP 10.0.1.32,8080,/json.htm?type=command¶m=switchlight&idx=1266&switchcmd=Off
else
event,lamp_on
SendToHTTP 10.0.1.32,8080,/json.htm?type=command¶m=switchlight&idx=1266&switchcmd=On
endif
endon
on SW01#Switch do
event,lamp_change
endon
My gueass is that the rule isn't right and that's wy the signal pingpong but I can not figure it out. Can please someone help me?
Re: Sonoff basic with wall switch
After some googling, I found out that a 10K resistance between GPIO14 and 3.3V could help. I have tried this and indeed it works perfectly now. Code is also correct. I can switch my lamp both with my wall switch and via domiticz and the status is perefect kept in domoticz.
Re: Sonoff basic with wall switch
Or enable internal pullup on SW01 device tab.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 113 guests