-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Home Assistant discovery: add color_mode for lights #7057
Conversation
@emontnemery implementing the |
@Koenkk the frontend issue should be fixed by home-assistant/core#49167 |
@emontnemery thanks, I will continue this implementation when the fix is in a HA release. |
Fixed in Home Assistant 2021.4.5 |
@emontnemery looks good now indeed. Will be available in next z2m release on 1 May |
@Koenkk this is not backward compatible for older versions of Home Assistant, is that intended? NVM, I see you mention it in the release notes 😄 |
Hi @Koenkk Sorry I don"tknow if I shoud write here or create an other issue after mine (#7125 (comment)) but it's still about color_mode: xy. My issue is not resolved. And seems to be the same issue than in my previous issue mentioned before. Here is the normal state for my bulbs
Here is when I have a specific animation (blink) (alarm in red with rgb [255,0,0]) and brightness with the value at 140. The value sent is 139 but it's not a big deal.
Here is when I asked to "restore" the snapshot
Why the color_mode is not restored ? why "xy" instead of "color_temp", I don't know if it's related to this issue or not but in my case, the snapshot is still not working :( Thank you Regards Version Zigbee2MQTT Home Assistant 2021.5.5 |
@kevincaradant please also provide the debug log of this. This will show the received MQTT messages. |
Is it what you asked ? Sorry, I'm not sure what you need in debug mode, I copy paste all the logs
Alarm State ( red blink)
When I desarm the alarm, it shoukd restore my snapshot ( like the 'normal state' logs mentioned before)
|
As can be seen in your last log you see that z2m receives the following: |
Can you explain what you're doing in Home Assistant, are you restoring a scene? |
@emontnemery It was explained a little bit on the old thread but you will find it more detailed just below. Sorry @Koenkk if I write a little bit of HA code here :) The idea is that someone opens the door, the alarm is triggered ( light go on red blinking ) and then when I disable the alarm, I want to have again the previous state of my bulbs. This is the state before to trigger the alarm (color_temp at 375)
And when I stop the alarm
Do you need others information ? |
@kevincaradant that should work, so either zigbee2mqtt is not setting the color mode correctly or there is a bug in Home Assistant. Can you collect+attach a log from Home Assistant with the following settings covering the following sequence of events:
logger:
default: info
logs:
homeassistant.components.automation: debug
homeassistant.core: debug
homeassistant.components.mqtt: debug |
@emontnemery , I tried as I could, because I have sooooooo much logs in debug mode in HA, that after 2 seconds, I was lost x) Finally I can't send all the logs, I added in attachment a file with all the logs. |
@kevincaradant don't worry about the size of the logs, you can simply zip the log file and attach it to a github comment by dragging+dropping it onto the comment, there's no need to rely on 3rd party services 👍 Edit: The file.io link doesn't work, please attach the log file directly in github instead |
The file.io link works now. You set the light to color_temp=380:
The state update from the light reports that it's in
However, Home Assistant sets it to
This will happen if the |
Please get the discovery message for the group, you can get it from command line: |
I didn't sucess to use this command. I'm using a docker container for mosquitto and also my lights group "livingroom_lights" is a group as Z2M entity. It's not a group under homeassistant. For HA, it's just a light from the "Light.yaml"
Here, you can see the color_temp at true From MQTT Explorer application, I can see the xy value is lost when I set the rgb to red color. Is it normal at this state to have "xy" ? And it should be only when I restore it that the "color_temp" should be back ? Or even in RGB I should ahve "color_temp" setted ? For me it's normal to have xy ( during alarm ) but I'm not fully sure ... THis is what I have at the end as latest MQTT message Is it what you want as answer @emontnemery ? |
OK, so you have manually configured the light group like this, it's not automatically exposed by zigbee2mqtt:
That configuration is in Home Assistant's configuration.yaml, correct? The configuration is wrong, and that's why it doesn't work. |
OK, I found in the documentation that it requires manual configuration: https://www.zigbee2mqtt.io/integration/home_assistant.html#groups The documentation needs to be updated to explain that |
@kevincaradant in your case, please try to update the group config like this: - platform: mqtt
schema: json
name: Livingroom Lights
unique_id: livingroom_lights
command_topic: zigbee2mqtt/Z2M_livingroom_lights/set
state_topic: zigbee2mqtt/Z2M_livingroom_lights
effect: true
brightness_scale: 254
color_mode: true
supported_color_modes: ["color_temp", "xy"] |
@emontnemery well done :) I didn't see this option in the documentation of HA but it's well explained indeed. Thank you a lot :D @Koenkk, not sure about it, I have a little remember about an issue on auto discovery with groups. Is it always on your roadmap ? I just find this #2410 but I was sure there is something else somewhere :) |
@emontnemery updates the docs! Thanks for helping out! @kevincaradant yes, still on my roadmap. |
Adds support for
color_mode
which has been added in 2021.4.0.