dimTo() fails to set level  [Solved]

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

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

dimTo() fails to set level

Post by Number8 »

Hello,
I've got a very strange problem. This code fails to set the dimmer level

Code: Select all

dz.devices(577).dimTo(50) 
whereas this code does what is expected:

Code: Select all

dz.openURL("http://192.168.21.240:8080/json.htm?type=command&param=switchlight&idx=577&switchcmd=Set%20Level&level=50")
Is anybody having a clue?
I'm running stable 2022.1

Thank you
Debian buster on NUC and three RPi with buster.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dimTo() fails to set level

Post by waltervl »

What kind of device is it?
Do you get an error when the dzvents code is executed?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: dimTo() fails to set level

Post by Number8 »

Thanks waltervl. This is a dummy device. The following error is sometimes reported (not all the time)

Code: Select all

Error: Setting a wrong level value 52 to Selector device 82289
It is definitely not a selector but a dimmer
Debian buster on NUC and three RPi with buster.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dimTo() fails to set level  [Solved]

Post by waltervl »

Then I would advise to delete it and try to recreate it again.
Something is wrong in your configuration.
Also check if there is not a device with exactly the same name (eg "lights living room") as DzVents sometimes gets confused on this.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: dimTo() fails to set level

Post by Number8 »

Good shot, thank you for kind advise. I was not aware that despite the fact I'm always using idx, we must not get two devices with same names.
Debian buster on NUC and three RPi with buster.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest