I have a DALI light connected via the Mosquitto MQTT Broker.
I created a light entity in HA and would like to sync the state of the DALI Device (ON/OFF & Brightness) to this entity whenever it changes.
I configured a topic on the DALI Controller side that periodically publishes the status of the light and the brightness. The Payload is: {"state": <light status>, "brightness": <light brightness>}
The brighness is updated fine in the entity but the on/off is not because the DALI controller uses 4 for “ON” and 0 for “OFF”.
I need a way to replace 4 with “ON” and 0 with “OFF” and the DALI Controller (ADF HD67941) does not seem to have that ability.
How do you define the light in HA?
If you do it yourself, rather than through discovery, it’s pretty trivial to have it working in HA without “replacing data” in MQTT
This is how I defined the light: {"~": "homeassistant/light/smarli_dali_44", "name": "Light 1", "unique_id": "smarli_dali_44", "cmd_t": "~/set", "stat_t": "~/state", "schema": "json", "brightness": true}
but when I change the brightness in the HASS Front end I get the following error: Failed to call service light/turn_on. UndefinedError: 'value_json' is undefined