Page 1 of 1

get switch/selector status (not level)

Posted: Monday 16 December 2019 0:16
by bigatis
Hello,

To control my AC I'm using a selector switch.
It is configured with following levels : Off/20 degrees/21 degrees/22 degrees/ etc ..
For each change I have a custom action on others devices such as Fan switch thru a DzVent script.

My problem is that when I clic on the icon of the switch it do not change it's level to "Off". It only turn off the icon and let the level of the selector to it's previus state.
In the script I'dont know how to get the status.

But the status is really Off.
I can see it using the json api : http://xxx.xxx.x.xx:8080/json.htm?type=devices&rid=108
"LevelInt" : 10,
and
"Status" : "Set Level: 10 %",
and
"Status" : "Off", <========

I can also see it in the "Devices current states" tab on the script part (event) in the colonn "value"
108 2019-12-15 23:37:10 Climatisation Salon 21° C 2/10 ==> icon ON and level 10
108 2019-12-15 23:37:10 Climatisation Salon 21° C 0/10 ==> icon OFF and still level 10

How can I get this Status or this nValue ?

Thank you for your help
Sylvain

Re: get switch/selector status (not level)

Posted: Monday 16 December 2019 10:06
by waaren
bigatis wrote: Monday 16 December 2019 0:16 It is configured with following levels : Off/20 degrees/21 degrees/22 degrees/ etc ..
In the script I'dont know how to get the status. How can I get this Status or this nValue ?
In dzVents nValue is one of the device attributes.
so something like

Code: Select all

if domoticz.devices(108).nValue == 0 then 

Re: get switch/selector status (not level)

Posted: Monday 16 December 2019 22:43
by bigatis
I feel stupid ... :?
Thanks