Page 1 of 1

Turning relay ON from Domoticz

Posted: 12 Feb 2017, 08:52
by nafremony2
Hello, I know that to be able to turn relay ON/OFF from Domoticz I need to set On/Off action. But I have two problems with that and maybe somebody already has a solution.

1. With the http://esp/control?cmd=GPIO,x,y I need to know what's the GPIO number. So if I would rewire it, I would need to change it in Domoticz. I'd like to have some abstraction. I was looking at Rules. And that might be the way to go. Any reason why it's not enabled by default? Is it stable?

2. If you turn it on and ESP would be off/disconnected/whatever the switch would still be on, because there's no confirmation. Only after the Sensor Timeout in Domoticz the sensor would be "red" (and you still don't know what's the current state). Kind of lame.

Re: Turning relay ON from Domoticz

Posted: 13 Feb 2017, 02:08
by paxi
1. Rules are working fine, go for it.
2. If you can propose a mechanism how an unpowered or disconnected device could communicate it's current state you're a freaking genius - otherwise I'd consider your criticism as "kind of lame". ;)

Re: Turning relay ON from Domoticz

Posted: 13 Feb 2017, 07:38
by nafremony2
Of course. From an ESP's side there's not much you can do. But I was hoping for some trick on Domoticz's side. I suppose I'm not the first one to think about this.

Re: Turning relay ON from Domoticz

Posted: 19 Apr 2017, 14:01
by foad62
I have a similar problem.
I use ESP Easy for a relay. For example when the ESP node is dead and I send an On command using Domoticz Android App. It seems the command is sent OK but of course it's not. And when I check the log messages I found the following message:
Error Opening url:http://192.168.1.101/control?cmd=GPIO,12,1
Is there a way the user be notified of this error immediately without referring to Logs?

Re: Turning relay ON from Domoticz

Posted: 25 Apr 2017, 13:43
by DeNB3rt
foad62 wrote: 19 Apr 2017, 14:01 I have a similar problem.
I use ESP Easy for a relay. For example when the ESP node is dead and I send an On command using Domoticz Android App. It seems the command is sent OK but of course it's not. And when I check the log messages I found the following message:
Error Opening url:http://192.168.1.101/control?cmd=GPIO,12,1
Is there a way the user be notified of this error immediately without referring to Logs?
hmm I was also thinking about that, my christmas tree is not there anymore :D But I can still enable/disable the lights.
It would be cool that the switch is staying 'off'. (How do you manage to get the switch in 'offline' modus? Did not find out yet)

//edit, Think I found it:
pinstate = substr(response, 64, 1)

ty!

Re: Turning relay ON from Domoticz

Posted: 29 Apr 2017, 00:17
by paxi
DeNB3rt wrote: 25 Apr 2017, 13:43 ...
//edit, Think I found it:
pinstate = substr(response, 64, 1)

ty!
Funny to see that here, I've posted that line of pseudocode in a completely different context - it won't do anything in domoticz or with a dead node. You may want to reread the topic where you found it. ;)