Hi all,
I have finally managed to have some lights in my house message its states through a MQTT-topic to home assistant. The light supports dimming, so I have configured my configuration.yaml using the ‘brightness’ function.
I can turn the light on and off in HA from the dashboard. However the problem starts when I switch the physical on/off switch of the light.
I see, using MQTT explorer, that the light (when I manually turn the light on or off) correctly sends its state through the topic. However Home assistant does not update the state accordingly.
If I set ‘optimistic’ to false, HA does automatically turn the light on the dashboard back to off every time I try to turn it on in the dashboard.
Does anybody know what might be wrong in my config file?
Configuration.yaml:
- platform: mqtt
unique_id: Licht_eettafel__dgts
name: "Eettafel"
state_topic: "digitalstrom/devices/Licht_eettafel__dgts/brightness/state"
command_topic: "digitalstrom/devices/Licht_eettafel__dgts/brightness/command"
on_command_type: 'brightness'
brightness_scale: 100
brightness_state_topic: 'digitalstrom/devices/Licht_eettafel__dgts/brightness/state'
brightness_command_topic: 'digitalstrom/devices/Licht_eettafel__dgts/brightness/command'
payload_off: '0'
optimistic: true
I am running Home Assistant supervised on a raspberry-pi:
version: core-2022.2.6
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.7
os_name: Linux
os_version: 5.10.92-v8
arch: aarch64
Mosquito broker add-on v 6.0.1