From 292ef8e8157004f4ba1dd9ee461c293502b2a8fe Mon Sep 17 00:00:00 2001
From: Otto Winter
- XY and RGB can not be used at the same time. If both are provided, XY overrides RGB. + RGB, XY and HSV can not be used at the same time in `state_topic` messages. Make sure that only one of the color models is in the "color" section of the state MQTT payload.
## {% linkable_title Comparison of light MQTT platforms %} @@ -161,6 +168,7 @@ payload_not_available: | RGB Color | ✔ | ✔ | ✔ | | Transitions | ✘ | ✔ | ✔ | | XY Color | ✔ | ✔ | ✘ | +| HS Color | ✘ | ✔ | ✘ | | White Value | ✔ | ✔ | ✔ | ## {% linkable_title Examples %} @@ -215,7 +223,32 @@ Home Assistant will then convert its 8bit value in the message to and from the d ```json { "brightness": 4095, + "state": "ON" +} +``` + +### {% linkable_title HS Color %} + +To use a light with hue+saturation as the color model, set `hs` to `true` in the platform configuration: + +```yaml +light: + - platform: mqtt_json + name: mqtt_json_hs_light + state_topic: "home/light" + command_topic: "home/light/set" + hs: True +``` + +Home Assistant expects the hue values to be in the range 0 to 360 and the saturation values to be scaled from 0 to 100. For example, the following is a blue color shade: + +```json +{ "state": "ON", + "color": { + "h": 24.0, + "s": 100.0 + } } ``` diff --git a/source/_components/light.mqtt_template.markdown b/source/_components/light.mqtt_template.markdown index d6239710999..11b43726724 100644 --- a/source/_components/light.mqtt_template.markdown +++ b/source/_components/light.mqtt_template.markdown @@ -132,6 +132,7 @@ payload_not_available: | RGB Color | ✔ | ✔ | ✔ | | Transitions | ✘ | ✔ | ✔ | | XY Color | ✔ | ✔ | ✘ | +| HS Color | ✘ | ✔ | ✘ | | White Value | ✔ | ✔ | ✔ | ## {% linkable_title Examples %}