Page 1 of 1

dimTo() fails to set level

Posted: Wednesday 04 May 2022 18:31
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

Re: dimTo() fails to set level

Posted: Wednesday 04 May 2022 19:51
by waltervl
What kind of device is it?
Do you get an error when the dzvents code is executed?

Re: dimTo() fails to set level

Posted: Thursday 05 May 2022 10:02
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

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

Posted: Thursday 05 May 2022 11:33
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.

Re: dimTo() fails to set level

Posted: Thursday 05 May 2022 17:22
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.