Skip to content

Commit cd7be07

Browse files
Document overriding Home Assistant discovery properties (Koenkk#1642)
* Document overriding discovery properties * Update home_assistant.md * Update home_assistant.md * Mention move_hue / move_sat to clarify HS reporting * Update home_assistant.md Co-authored-by: Koen Kanters <[email protected]>
1 parent 506a180 commit cd7be07

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

docs/guide/usage/integrations/home_assistant.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,24 @@ automation:
8989
## Groups
9090
Groups discovery is supported for groups of lights, switches, locks and covers. For other types you have to manually create a config in the Home Assistant `configuration.yaml`.
9191

92-
## Exposing switch as a light
92+
## Overriding discovery properties
93+
Any Home Assistant MQTT discovery property can be overridden on a device. Two examples are shown below. For a full and current list of discovery properties, see [the Home Assistant MQTT Discovery integration](https://www.home-assistant.io/docs/mqtt/discovery/) and [the Home Assistant extension](https://github.com/Koenkk/zigbee2mqtt/blob/03ba647dc6b5f299f8f3ab441712999fcb3a253e/lib/extension/homeassistant.ts) in the Zigbee2MQTT source code.
94+
95+
### Changing `supported_color_modes`
96+
This is useful for switching light bulbs from reporting values from X/Y (which is the default) to reporting in hue / saturation (which is what bulbs report color in when changing via hue or saturation, such as with the `hue_move` and `saturation_move` commands).
97+
98+
This example changes a [light's `supported_color_modes` discovery property](https://www.home-assistant.io/integrations/light.mqtt/#supported_color_modes) to hue / saturation and color temperature:
99+
100+
```yaml
101+
devices:
102+
"0x12345678":
103+
friendly_name: my_light
104+
homeassistant:
105+
light:
106+
supported_color_modes: ['hs','color_temp']
107+
```
108+
109+
### Exposing switch as a light
93110
If your device is currently discovered as a switch and you want to discover it as a light, the following config in the Zigbee2MQTT `configuration.yaml` can be used:
94111

95112
```yaml
@@ -121,8 +138,6 @@ devices:
121138
state_value_template: '{{ value_json.state_right }}'
122139
```
123140

124-
If you are also using device specific overrides, make sure that they are configured under the new device type rather than the original device type.
125-
126141
## Using a custom name for the device and entities
127142
In order to get a more readable name for the device and entities in Home Assistant, a specific name for Home Assistant can be set in the device configuration. If set, this name will be used instead of `friendly_name`.
128143

0 commit comments

Comments
 (0)