Hello to all, i've tried to search on the forum but I have not found a clear solution.
I have this scenario:
Domoticz 3.8153 on a raspberry pi
1 esp8266 flashed with esp easy v2.0.0-dev12 and a 4 relay modules
for now i've configured only 1 relay, but the problem is simple, i can control the relay using the domoticz web page using:
http://esp_ip_addr/control?cmd=GPIO,0,0
http://esp_ip_addr/control?cmd=GPIO,0,0
and all works fine, but if i reboot the esp, the relay state it is not mantained.
I think that the best solution is to ask at the domoticz controller to give me the state of that relay but i'm not able to do that
Anyone can help me?
PS:Sorry for my bad english
EspEasy,relay recovery the last state after power failure
Moderators: grovkillen, Stuntteam, TD-er
Re: EspEasy,relay recovery the last state after power failure
I don't know exactly how it works, but I do now it is possible to implement the functionality using a MQTT broker. You essentially store the value and recall the value in a " On system#boot do" rule. It is somewhere on the forumonizuka89 wrote: ↑27 Nov 2017, 23:33 Hello to all, i've tried to search on the forum but I have not found a clear solution.
I have this scenario:
Domoticz 3.8153 on a raspberry pi
1 esp8266 flashed with esp easy v2.0.0-dev12 and a 4 relay modules
for now i've configured only 1 relay, but the problem is simple, i can control the relay using the domoticz web page using:
http://esp_ip_addr/control?cmd=GPIO,0,0
http://esp_ip_addr/control?cmd=GPIO,0,0
and all works fine, but if i reboot the esp, the relay state it is not mantained.
I think that the best solution is to ask at the domoticz controller to give me the state of that relay but i'm not able to do that
Anyone can help me?
PS:Sorry for my bad english
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: EspEasy,relay recovery the last state after power failure
Yep, with MQTT it works. Have it in use. The only trick you must know is, that the check mark 'send boot state' must be removed and 'MQTT retain message' be set. That works.
Re: EspEasy,relay recovery the last state after power failure
Yes, i know this option but i'm not able do this, because i set the mqtt gateway on domoticz, but which are the command that i have to use for power on and power off the esp pins?
These are my configurations:
In ESP And In Domoticz
These are my configurations:
In ESP And In Domoticz
Re: EspEasy,relay recovery the last state after power failure
You must use the _P029 (Domoticz MQTT helper) plug-in in ESPeasy to get this work. Check, that the IDX is the same like in Domoticz! Then your red marked fields stay empty in Domoticz (only for HTTP commands).
Re: EspEasy,relay recovery the last state after power failure
Or you can periodically send state of relays from Domoticz to ESPeasy with LUA scripts - for every minutes for example.
Then max. 1 minute after reboot relays will obtain its correct state.
Or when booting ESP, send through rules JSON command to Domoticz ( setting variable or dummy switch "ESP_is_booting")
End in Domoticz with LUA or Blockly send back Correct GPIO command when variable or switch is changed.
And at last, I think in ESP MEGA GPIO states and task values are not changed after boot ( of course not, if power is lost ).
I am not sure ( about GPIOs ), but I remember I read this somewhere - so try it.
Task values holds its data after rebooting.
I count number of actions of my relay in my ESP for example and after reboot it continued from last value before reboot.
Then max. 1 minute after reboot relays will obtain its correct state.
Or when booting ESP, send through rules JSON command to Domoticz ( setting variable or dummy switch "ESP_is_booting")
End in Domoticz with LUA or Blockly send back Correct GPIO command when variable or switch is changed.
And at last, I think in ESP MEGA GPIO states and task values are not changed after boot ( of course not, if power is lost ).
I am not sure ( about GPIOs ), but I remember I read this somewhere - so try it.
Task values holds its data after rebooting.
I count number of actions of my relay in my ESP for example and after reboot it continued from last value before reboot.
Who is online
Users browsing this forum: No registered users and 87 guests