Domoticz-espeasy-relay
Moderators: grovkillen, Stuntteam, TD-er
Domoticz-espeasy-relay
I have been playing with the relay example in the wiki and realised that there is no feedback to domoticz about the status of the relay.
For instance using the example it works fine, the relay switches on and off when pressing the switch in domoticz.
But if I the esp misses an instruction to turn on or off,domoticz no longer reflects the true state of the relay.
Is there a way to sync them through rules or something?
For instance using the example it works fine, the relay switches on and off when pressing the switch in domoticz.
But if I the esp misses an instruction to turn on or off,domoticz no longer reflects the true state of the relay.
Is there a way to sync them through rules or something?
Re: Domoticz-espeasy-relay
Having searched this forum and Googling i have still no idea how to get an ack back from the espeasy node.
I see that it can be done with mqtt but i really did not want to learn mqtt.
So basically if i send on/off from domoticz to my boiler relay,There is no ack to say it has received it or not.
I see that it can be done with mqtt but i really did not want to learn mqtt.
So basically if i send on/off from domoticz to my boiler relay,There is no ack to say it has received it or not.
Re: Domoticz-espeasy-relay
Hi,
if you still have a free contact on your relay, you can use it to pull a GPIO to ground, and create a switch input device.
Monitoring that switch on Domoticz will show you the *true* state of your relay.
If no free contact remains, it's possible to monitor the mains supply across the boiler heater element, but you need some electronics knowledge and few components.
In this case, I could help you with a (simple) schematic, so let me know.
Good luck
if you still have a free contact on your relay, you can use it to pull a GPIO to ground, and create a switch input device.
Monitoring that switch on Domoticz will show you the *true* state of your relay.
If no free contact remains, it's possible to monitor the mains supply across the boiler heater element, but you need some electronics knowledge and few components.
In this case, I could help you with a (simple) schematic, so let me know.
Good luck

ESPEasy running on ESP-12F self-made modules (with various sensors) and talking to Domoticz (hosted on RPi2)
Re: Domoticz-espeasy-relay
Hi
Thank you for your input on this.
My problem with that idea is that The esp could be unplugged or not working and domoticz will not throw any kind of error because it is a dumb connection.
Yes the feedback switch wouold show off but still no error.
Thank you for your input on this.
My problem with that idea is that The esp could be unplugged or not working and domoticz will not throw any kind of error because it is a dumb connection.
Yes the feedback switch wouold show off but still no error.
Re: Domoticz-espeasy-relay
OK, I see...
Maybe a watchdog-style script on the Domoticz side, which is triggered periodically by the ESP switch info. If your ESP is offline or so, the script will do something, e.g. warn you...
Maybe a watchdog-style script on the Domoticz side, which is triggered periodically by the ESP switch info. If your ESP is offline or so, the script will do something, e.g. warn you...
ESPEasy running on ESP-12F self-made modules (with various sensors) and talking to Domoticz (hosted on RPi2)
Re: Domoticz-espeasy-relay
Can Domoticz handle mqtt disconnect msg? I currently don't use Domocitz mecause it was not flexible enough for for my purposes. I am using Mqtt (Mosquitto - Node-Red - Sqlite), I receive a notice when the connection is lost and when reconnected. In theory, Domoticz could use this to let you know it is still connected, but I don't know if it can or ever will.
While using mqtt adds a bit of complexity, it also adds a lot of flexibility through Node-Red.
https://www.domoticz.com/wiki/MQTT
While using mqtt adds a bit of complexity, it also adds a lot of flexibility through Node-Red.
https://www.domoticz.com/wiki/MQTT
Re: Domoticz-espeasy-relay
Having spent days reading snippets of information on MQTT and domoticz/espeasy,I am no further forward.
It all seems so complicated and way beyond me without a hand holding tutorial on how to put it all together.
Domoticz seems to be the problem when using dummy switches because it does not need an ack.
It does not care if anything is actually connected and turns the little light bulb/relay on anyway and expects no answer/ack.
Does anybody know if this is the same when using Domoticz/MQTT opposed to Domoticz/HTTP?
Is there a better controller that needs or accepts ack?
I had a quick look at openhab but it seems very complicated and disjointed.
What is the tick box for in devices (send data)?
It all seems so complicated and way beyond me without a hand holding tutorial on how to put it all together.
Domoticz seems to be the problem when using dummy switches because it does not need an ack.
It does not care if anything is actually connected and turns the little light bulb/relay on anyway and expects no answer/ack.
Does anybody know if this is the same when using Domoticz/MQTT opposed to Domoticz/HTTP?
Is there a better controller that needs or accepts ack?
I had a quick look at openhab but it seems very complicated and disjointed.
What is the tick box for in devices (send data)?
Re: Domoticz-espeasy-relay
My solution to this is to have a 'time' event to send the relay state once per minute. The downside is that the 'Log' button no longer works, as it seems to overload the web browser when trying to display an event per minute.
Another thing is that on the relay side I should have some safeguards against connection loss, so that the ESP side could do something sensible with the rules if there's no incoming data. Yesterday I started to experiment with a custom event:
So this raises an event every time there's an incoming MQTT packet. On 'Rules' I can now do something like this (GPIO5 controls the Wemos Relay Shield, and I also have a DS18B20 temperature sensor):
Another thing is that on the relay side I should have some safeguards against connection loss, so that the ESP side could do something sensible with the rules if there's no incoming data. Yesterday I started to experiment with a custom event:
Code: Select all
diff --git a/ESPEasy/Controller.ino b/ESPEasy/Controller.ino
index c3eba47..4c872a0 100644
--- a/ESPEasy/Controller.ino
+++ b/ESPEasy/Controller.ino
@@ -56,6 +56,12 @@ void callback(char* c_topic, byte* b_payload, unsigned int length) {
sprintf_P(log, PSTR("%s%s"), "MQTT : Payload: ", c_payload);
addLog(LOG_LEVEL_DEBUG, log);
+ if (Settings.UseRules)
+ {
+ String event = F("System#MQTT");
+ rulesProcessing(event);
+ }
+
struct EventStruct TempEvent;
TempEvent.String1 = c_topic;
TempEvent.String2 = c_payload;
Code: Select all
On System#MQTT do
timerSet,1,120
endon
on Rules#Timer=1 do //When Timer1 expires, do
if [temperature#Temperature]>21
gpio,5,1
else
gpio,5,0
endif
if [temperature#Temperature]=nan
gpio,5,1
endif
timerSet,1,5
endon
Who is online
Users browsing this forum: No registered users and 9 guests