Page 1 of 1

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

Posted: Saturday 09 September 2023 19:17
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

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

Posted: Saturday 09 September 2023 19:31
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.

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

Posted: Sunday 10 September 2023 18:52
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

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

Posted: Sunday 10 September 2023 19:42
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.

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

Posted: Sunday 10 September 2023 20:26
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!

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

Posted: Sunday 10 September 2023 22:39
by waltervl
No problem!