Blinds: dzvents level do not report level properly but lua does

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
benp
Posts: 52
Joined: Saturday 21 May 2016 20:12
Target OS: NAS (Synology & others)
Domoticz version: V4.10717
Location: France
Contact:

Blinds: dzvents level do not report level properly but lua does

Post by benp »

I try to migrate my script from Lua to dzvents
I use a blind percentage on a FGRM222 Fibaro zwave
Domoticz is 2023.2 with OZW

When I set the level to 43% with domoticz widget or physical switch

In My automation script/device current state/value:

Sate: Open Value 1/100
In Lua script:
otherdevices_svalues['Store'] return 43
otherdevices['Store'] return 43%
In API/JSON:
with /json.htm?type=command&param=getdevices&rid=IDX
it return 43 as result/0/level and result/0/intLevel
In dzscript:
domoticz.devices('Volet Salon').state return Open

In dzvents, I tried other devices attribute like rawData[1] or sValue or level with no success
Is there a way to get the blind percentage from dzvents (without Asynchronous HTTP Request and handling)
I can provide full lua+dzvents+json if usefull to understand
Domoticz V2024.7
User avatar
waltervl
Posts: 5724
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Blinds: dzvents level do not report level properly but lua does

Post by waltervl »

In dzvents it should be domoticz.devices('Volet Salon').level to get the level and domoticz.devices('Volet Salon').setLevel() to set a blind to a specific level.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
benp
Posts: 52
Joined: Saturday 21 May 2016 20:12
Target OS: NAS (Synology & others)
Domoticz version: V4.10717
Location: France
Contact:

Re: Blinds: dzvents level do not report level properly but lua does

Post by benp »

waltervl wrote: Saturday 09 September 2023 19:31 In dzvents it should be domoticz.devices('Volet Salon').level to get the level and domoticz.devices('Volet Salon').setLevel() to set a blind to a specific level.
I tried this
domoticz.devices('Volet Salon').level
return:
  • 100 for 100%
  • 100 for 95%
  • 100 for 65%
  • 0 for close
Domoticz V2024.7
User avatar
waltervl
Posts: 5724
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Blinds: dzvents level do not report level properly but lua does

Post by waltervl »

That seems strange. Dzvents .level should be the same as API level.
Check if you have unique names. Is there another device with the same name? Dzvents cannot handle this and can mix things up.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
benp
Posts: 52
Joined: Saturday 21 May 2016 20:12
Target OS: NAS (Synology & others)
Domoticz version: V4.10717
Location: France
Contact:

Re: Blinds: dzvents level do not report level properly but lua does

Post by benp »

waltervl wrote: Sunday 10 September 2023 19:42 That seems strange. Dzvents .level should be the same as API level.
Check if you have unique names. Is there another device with the same name? Dzvents cannot handle this and can mix things up.
I found my error: I must ask for
domoticz.devices('Store').level
and not:
domoticz.devices('Volet Salon').level
which is another device !!!

Thank you waltervl
I apologize for such a simple question!
Domoticz V2024.7
User avatar
waltervl
Posts: 5724
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Blinds: dzvents level do not report level properly but lua does

Post by waltervl »

No problem!
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests