...
Drawio | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
The payload returned on a discovery topic is a config message, describing the entity of the device. It ALL entities will give your system essential information on
unique ID’s
which device it is part of
which state_topic it will use to send its state updates. The client will need to listen to this topic to get updates for the entity
which command_topic it will use to send its state updates, if the entity can be controlled. The client will need to listen send command messages to this topic to get updates for the entityto be able to change values for the entity
Friendly name
In addition the entities have some fields that are specific for the entity
Light
The max value for brightness is given as brightness_scale. I.e. 100 means that the scale is 0-100
If the light has a color_mode this is given as ‘true’ as well as listing the level of control in supported_color_modes
brightness - only brightness control according to brightness_scale
color_temp - color_temp in mired and color_temp_kelvin as kelvin in addition to brightness
color - color control in addition to brightness and color_temp
If you can activate effects on the light, this is given as effect: ‘true’
The effect_list will (if effect) contain a list of effects the light can perform, i.e. ‘identify’ to blink the light
Light config payload:
Code Block | ||
---|---|---|
| ||
state_topic: connect/light/001fee00000053a6/17880107102b0c/state schema: json unique_id: 17880107102b0c_light object_id: 17880107102b0c_light device: identifiers: - 17880107102b0c name: 17880107102b0c manufacturer: Glamox Connect API model: Wireless Zigbee suggested_area: mysitename via_device: 001fee00000053a6 command_topic: connect/light/001fee00000053a6/17880107102b0c/set name: Light_17880107102b0c brightness_scale: 100 color_mode: 'true' brightness: 'true' supported_color_modes: - brightness effect: 'true' effect_list: - identify platform: mqtt |
Sensor and binary sensor
The device_class will tell you which kind of sensor the entity is
illuminance
temperature
For sensors, the unit_of_measurement is provided to indicate how to interpret the state.
This is NOT available for binary sensors as they are always ‘ON’/'OFF'
A value_template is also included for the integrating system to know what the value field of this sensor is given as. In the example below the state will be reported as
"lux": 480
in the json payload.
Sensor config payload:
Code Block |
---|
state_topic: connect/sensor/001fee00000053a6/17880107102b0c/state
schema: json
unique_id: 17880107102b0c_illuminance
object_id: 17880107102b0c_illuminance
device:
identifiers:
- 17880107102b0c
name: 17880107102b0c
manufacturer: Glamox Connect API
model: Wireless Zigbee
suggested_area: glamoxmoldetest
via_device: 001fee00000053a6
name: Sensor/Illuminance_17880107102b0c
device_class: illuminance
unit_of_measurement: lx
value_template: '{{ value_json.lux }}'
platform: mqtt |
Binary_sensor config payload:
Code Block |
---|
state_topic: connect/binary_sensor/001fee00000053a6/17880107102b0c/state schema: json unique_id: 17880107102b0c_occupancy object_id: 17880107102b0c_occupancy device: identifiers: - 17880107102b0c name: 17880107102b0c manufacturer: Glamox Connect API model: Wireless Zigbee suggested_area: glamoxmoldetest via_device: 001fee00000053a6 name: Sensor/Occupancy_17880107102b0c value_template: '{{ value_json.presence }}' device_class: occupancy platform: mqtt |
Listening for device updates
...