I can control the light with custom topics in the developer part of Home Assistant, like so:
But if i plug this (picture below) in the configuration.yaml, it does not work in the interface. it is not even recognized⌠Note that the Sonoff switch does work. What could be the problem?
edit: When I turn the light off with the custom control, I can turn them on through the front interface, but can not turn them off. What could be the reason?
This does give me the option to turn the light on, which it does. But then the interface does not recognize it. Also, it does not give an option to set the brightness or the color_temp.
When Iâm watching the state_topic on an external mqtt watcher I do see it does post the differences, so I think it is the correct topic.
Hi, I can not see anything wrong. You have told HA to use json (schema: json). Are you running Hassbian or Hass.io? I am using Hassbian and that makes it fairly easy to debug to check if the light is properly connected in zigbee2mqtt. A easy way is to subscribe to all mqtt messages and see if zigbee2mqtt have sent a proper config message to HA. Here is an example:
homeassistant/light/0x000b57fffe8cc3f5/light/config {âbrightnessâ:true,âschemaâ:âjsonâ,âcommand_topicâ:âzigbee2mqtt/0x000b57fffe8cc3f5/setâ,âstate_topicâ:âzigbee2mqtt/0x000b57fffe8cc3f5â,âavailability_topicâ:âzigbee2mqtt/bridge/stateâ,ânameâ:â0x000b57fffe8cc3f5_lightâ,âunique_idâ:â0x000b57fffe8cc3f5_light_zigbee2mqttâ,âdeviceâ:{âidentifiersâ:âzigbee2mqtt_0x000b57fffe8cc3f5â,ânameâ:â0x000b57fffe8cc3f5â,âsw_versionâ:âZigbee2mqtt 1.0.1â,âmodelâ:âTRADFRI LED bulb E12/E14/E17 400 lumen, dimmable warm white, chandelier opal (LED1649C5)â,âmanufacturerâ:âIKEAâ}}
Iâve had the exact same problem but luckily after some research managed to find a solution.
Try adding âoptimistic: trueâ to your configuration.yaml (also schema and platform donât require " " but not sure if this is a semantics thing or would actually break functionality)
Thanks for your solution Sloth! When looking at some help they say:
When a state topic is not available, the light will work in optimistic mode. In this mode, the light will immediately change state after every command. Otherwise, the light will wait for state confirmation from the device (message from state_topic ).
By using this optimistic mode, donât you just basically remove feedback? So when Zigbee2MQTT screws up you donât know it?
Does it also keep all options: does your homeassistant instance let you change brightness as well?
I must say I can not test it right now, will do so when I get home.
Iâm new with Zigbee2MQTT and still troubleshooting with the coverage etc, but your remark/concern seems valid.
I created a group of 4 Tradfri lights. When I turn the entire group on or off, some lights will not turn on or off.
When this happens, obviously the lamp state of the HA user interface does not match the real-life state. This of course is something that Iâd wish to avoid.
Also I canât change brightness or color temperature of my lights when I click on the bulb icon, this is also something Iâd have to look into.
It works as in I can turn them on or off, but it loses a lot of functionality in my opinion in this way. There must be a better solutionâŚ
In the picture below, all lights are turned on. The first light is configured with optimistic: true and the 2nd and 3rd light by the autodiscovery of MQTT in HASSio. They also can not read the state of the lights, so they wonât acknowledge it is on. Currently none of these lights has the function to change brightness or warmthâŚ