moroen / IKEA-Tradfri-plugin

A Python plugin for Domoticz to controll IKEA Gateway
68 stars 23 forks source link

New update display dim level instead of on/off? #111

Closed JohnnyJohnnySE closed 3 years ago

JohnnyJohnnySE commented 3 years ago

I noticed after upgrading to the latest version my scripts would break, and it seems like it reports the dim level rather than status ON. Which breaks scripts that relies on if device == 'On' for example. Is this intended behavior? A workaround is to use if device ~= 'Off' , or is there a setting I have accidently clicked or changed?

moroen commented 3 years ago

This is intended behavior, in order to correctly display the dim level in the interface. If you're only interested in on/off in scripts (dzVents, python) you should take a look at the nValue, which is 0 when off, 1 or 2 when on (1 for on/off switches and 2 for dimmable switched).

JohnnyJohnnySE commented 3 years ago

Ok thanks for clarifying, i'll implement a workaround in my scripts.