Page 1 of 1
true state of a switch or lamp
Posted: Sunday 29 November 2015 9:32
by Docc
Hi
Is it possible for Domoticz to know the true state of an attached IO device?
If you have wifi relay modules and wall switches to control lightning that allows for querying of it's state, it should be possible for Domoticz to show its true state.
The way I see it, Domoticz assumes that the device always get the command sent by Domoticz and changes the devices icon accordingly. This could and will, result in Domoticz being out of sync with the devices true state and that in turn will lead to faulty behaviors in conditional scripts in Domoticz since those queries the Domoticz object that represents the attached IO device instead of the actual devices state.
Is it possible to change the Domoticz IO device icon upon confirmation from the device and not when clicked, if so how?
/Stefan
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 9:47
by gizmocuz
i think you might need to take a look at zwave
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 9:53
by Egregius
Why should a wifi relay board receive commands other than from domoticz?
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 11:06
by Docc
Egregius wrote:Why should a wifi relay board receive commands other than from domoticz?
It could receive a command from the device itself, ie a wall wart with a on/off switch.
But I don't think that is an issue, the issue imo, is to be sure the command was received and executed so you can trust the IO devices states as shown in Domoticz.
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 11:07
by Docc
gizmocuz wrote:i think you might need to take a look at zwave
Are you saying that Domoticz will function in this way if I use z-wave devices?
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 11:11
by Egregius
Yes, zwave devices report their status back to Domoticz.
For the wifi board, you could create a script that gets the status of it and compare it to the status reported by domoticz. If different update domoticz.
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 11:50
by Docc
Egregius wrote:Yes, zwave devices report their status back to Domoticz.
Continuously or when changed or when queried?
Reporting back doesn't necessarily mean that Domoticz always shows the true state of the device.
The ESPeasy WiFi device I'm testing with does report back when changed, but it can still get out of sync with Domoticz if a command is lost.
To sort that out, I would have to do as you suggest; use a script that periodically ask for device state and updates Domoticz if accordingly.
That leads me to another question: How to ask a ESPeasy device of a GPIO state from Domoticz? Edit, I'll start a new thread for that

Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 12:09
by jannl
When the communicaion between a zwave device and the zwave controller gets lost, the devices will be marked 'dead'. This is reported back to Domoticz.
I use a greenwave switch. When I change the status of the switch either by updating the switch manually or by clicking in Domoticz, the state is updated in Domoticz.
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 12:18
by Docc
jannl wrote:I use a greenwave switch.
greenwave? What is this?
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 12:20
by jannl
Greenwave is a brand, at least sold in the Netherlands, look at robbshop.nl
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 14:48
by Docc
jannl wrote:When the communicaion between a zwave device and the zwave controller gets lost, the devices will be marked 'dead'. This is reported back to Domoticz.
How is that 'dead' state presented in the GUI? How can I set it to 'dead' from a script?
Re: true state of a switch or lamp
Posted: Sunday 29 November 2015 14:49
by Docc
jannl wrote:Greenwave is a brand, at least sold in the Netherlands, look at robbshop.nl
Thanks Jannl, very comprehensive line of products there

Re: true state of a switch or lamp
Posted: Tuesday 31 July 2018 9:02
by i3laze
Let’s continue..
I’m using MQTT-switches (Sonoff Tasmota) as Dummy devices + MQTT Gateway.
I have no troubles with their actual On/Off state.. although..
Some of them are in fact disconnected/unplugged and last seen by Domoticz more than a day ago.
How can I get them offline/red in Domoticz (and eventually in HomeBridge)?