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.

Moderators: leecollings, remb0

Post Reply
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

true state of a switch or lamp

Post 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
User avatar
gizmocuz
Posts: 2482
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: true state of a switch or lamp

Post by gizmocuz »

i think you might need to take a look at zwave
Quality outlives Quantity!
User avatar
Egregius
Posts: 2589
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: true state of a switch or lamp

Post by Egregius »

Why should a wifi relay board receive commands other than from domoticz?
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post 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.
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post 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?
User avatar
Egregius
Posts: 2589
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: true state of a switch or lamp

Post 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.
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post 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 :-)
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: true state of a switch or lamp

Post 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.
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post by Docc »

jannl wrote:I use a greenwave switch.
greenwave? What is this?
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: true state of a switch or lamp

Post by jannl »

Greenwave is a brand, at least sold in the Netherlands, look at robbshop.nl
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post 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?
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: true state of a switch or lamp

Post 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 :-)
User avatar
i3laze
Posts: 7
Joined: Thursday 26 July 2018 9:48
Target OS: Windows
Domoticz version:
Contact:

Re: true state of a switch or lamp

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

Who is online

Users browsing this forum: No registered users and 1 guest