true state of a switch or lamp

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 10:32

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

User avatar
gizmocuz
Posts: 8721
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: true state of a switch or lamp

Post by gizmocuz » Sunday 29 November 2015 10:47

i think you might need to take a look at zwave
Quality outlives Quantity!

User avatar
Egregius
Posts: 2747
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: true state of a switch or lamp

Post by Egregius » Sunday 29 November 2015 10:53

Why should a wifi relay board receive commands other than from domoticz?

Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 12:06

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.

Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 12:07

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?

User avatar
Egregius
Posts: 2747
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: true state of a switch or lamp

Post by Egregius » Sunday 29 November 2015 12:11

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.

Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 12:50

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 :-)

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: true state of a switch or lamp

Post by jannl » Sunday 29 November 2015 13:09

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.

Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 13:18

jannl wrote:I use a greenwave switch.
greenwave? What is this?

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: true state of a switch or lamp

Post by jannl » Sunday 29 November 2015 13:20

Greenwave is a brand, at least sold in the Netherlands, look at robbshop.nl

Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 15:48

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?

Docc
Posts: 36
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc » Sunday 29 November 2015 15:49

jannl wrote:Greenwave is a brand, at least sold in the Netherlands, look at robbshop.nl
Thanks Jannl, very comprehensive line of products there :-)

User avatar
i3laze
Posts: 8
Joined: Thursday 26 July 2018 9:48
Target OS: Windows
Domoticz version:
Contact:

Re: true state of a switch or lamp

Post by i3laze » Tuesday 31 July 2018 9:02

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)?

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests