For one of my scripts i need to know if the valve of the HR92 is (partly) opened.
By checking the state attribute (On/Off) or the active attribute (true/false) i should get this information.
I found that the state value is always Off and active is always false.
The reason for this is that in the file device-adapters/evohome_device.lua the _state attribute is checked for the relay subtype. Depending on the value of this attribute the state and active attributes are set.
I think the check is wrong , because _state is never On.
The actuals values are: settingLevel: 14% or Off
elseif device.deviceSubType == "Relay" then
if device._state == "On" then
device.state = "On"
device.active = true
else
device.state = "Off"
device.active = false
end
By changing the if statement in if device._state == "Off" it will work correct.
I hope somebody can change this for furture releases.
Gr. Bert
state and active attributes of EvoHome HR92 (relay part)
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: state and active attributes of EvoHome HR92 (relay part)
Thx for reporting
Do you mean this?
Code: Select all
elseif device.deviceSubType == "Relay" then
if device._state == "Off" then
device.state = "Off"
device.active = false
else
device.state = device._state or "On"
device.active = true
end
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 19
- Joined: Sunday 08 October 2017 23:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: state and active attributes of EvoHome HR92 (relay part)
Thx for reacting Waaren.
I'm not comletely sure how to interpreted device.state = device._state or "On".
But if, as result of this the state attribute is On whenever the value of _state != Off, then it is what i suggested
Gr. Bert
I'm not comletely sure how to interpreted device.state = device._state or "On".
But if, as result of this the state attribute is On whenever the value of _state != Off, then it is what i suggested
Gr. Bert
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: state and active attributes of EvoHome HR92 (relay part)
Not completely.
If _state == "Off" it will set state to "Off"
if _state != "Off" it first try to set state to the value of _state and if _state does not exists ( == nil) then it will set state to "On"
Would it be possible for you to test this? (I tested the logic but do not own an HR92)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 19
- Joined: Sunday 08 October 2017 23:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: state and active attributes of EvoHome HR92 (relay part)
Hi Waaren,
i did test your solution and it works like you discibe it.
For me it would be more usefull if the value is always "Off" if _state != "On" ( so just have 2 possible values On/Off to check in my script), the same as the dimmers example which is discribed in the manual:
state: String. For switches, holds the state like ‘On’ or ‘Off’. For dimmers that are on, it is also ‘On’ but there is a level attribute holding the dimming level. For selector switches (Dummy switch) the state holds the name of the currently selected level.
Because now the value of state is "Set level: 14%" when the valve is partly opened. In this case i would like to see:
state = "On" and level = 14
Gr. Bert
i did test your solution and it works like you discibe it.
For me it would be more usefull if the value is always "Off" if _state != "On" ( so just have 2 possible values On/Off to check in my script), the same as the dimmers example which is discribed in the manual:
state: String. For switches, holds the state like ‘On’ or ‘Off’. For dimmers that are on, it is also ‘On’ but there is a level attribute holding the dimming level. For selector switches (Dummy switch) the state holds the name of the currently selected level.
Because now the value of state is "Set level: 14%" when the valve is partly opened. In this case i would like to see:
state = "On" and level = 14
Gr. Bert
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: state and active attributes of EvoHome HR92 (relay part)
There is also the attribute "active" you can use for that check.
device.active is false when the device.state == 'Off' and true otherwise.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest