get switch/selector status (not level) Topic is solved

Moderator: leecollings

Post Reply
bigatis
Posts: 5
Joined: Sunday 15 December 2019 23:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

get switch/selector status (not level)

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: get switch/selector status (not level)

Post 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 
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
bigatis
Posts: 5
Joined: Sunday 15 December 2019 23:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: get switch/selector status (not level)

Post by bigatis »

I feel stupid ... :?
Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest