Valid dimlevels in MQTT/JSON messages

Post Reply
emontnemery
Posts: 75
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Valid dimlevels in MQTT/JSON messages

Post by emontnemery » Sunday 08 October 2017 15:05

According to https://www.domoticz.com/wiki/Domoticz_ ... tain_level,
Set a dimmable light to a certain level
/json.htm?type=command&param=switchlight&idx=99&switchcmd=Set%20Level&level=6
* Some lights have 100 dim levels (like zwave and others), other hardware (kaku/lightwaverf) have other ranges like 16/32
* Level should be the dim level (not percentage), like 0-16 or 0-100 depending on the hardware used
* When the light is off, it will be turned on
However, based on the code:
- level can be passed also for switchcmd other than "Set Level", this is also documented on the WIKI on the MQTT page.
- If no level is passed, it defaults to 0 (instead of some "not set" value)
- level passed with "Set Level" switchcmd is decreased by 1
- level 0 passed with "Set Level" changes switchcmd to "Off"

What's the reason for decrementing level only for switchcmd "Set Level"?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests