Skip to content
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

take_over_control and groups #304

Closed
JonathanTroyer opened this issue Jul 13, 2022 · 6 comments · Fixed by #708
Closed

take_over_control and groups #304

JonathanTroyer opened this issue Jul 13, 2022 · 6 comments · Fixed by #708

Comments

@JonathanTroyer
Copy link

JonathanTroyer commented Jul 13, 2022

Version information:

1.0.15
Home assistant core 2022.7.2
HACS 1.26.0

Description:

take_over_control does not respect changes to lights in a group when adapting a group.
E.G. I have light a and b, with group g. If adaptive lighting is set to control g, then changes to a or b (as opposed to g) get overridden at the next interval. If you instead choose to adapt a and b instead of g, then changes to g get overridden. If I try to adapt a, b, and g then both cases of overriding happen.

This plays out most obviously when adapting the auto-generated group for an area. If I adapt light.bedroom, then changes to light.fan get overridden, etc. as described above. However, it is not limited to adapting an area group.

@nathang21
Copy link

I am struggling to figure out the best setup with a similar situation.

I have many rooms/fixtures with multiple lights, that may not always be turned on/off the same way. Sometimes via groups, other times individually.

Ideally all of these would be adopted by adaptive lighting (unless manual control detected) but currently i'm seeing inconsistent results. I may keep playing with different combinations, but some guidance on best practices for which lights to adopt" would be appreciated.

@th3w1zard1
Copy link
Collaborator

Please post your adaptive-lighting config and your ZHA config. Any config needed to reproduce your issue we need you to share.

@akmolina28
Copy link

@nathang21

I found a work-around for this problem that might help. In my case I was using Zigbee groups, which home assistant sees as a totally separate entity. HA has no idea that bulb A and bulb B are part of zigbee group G... it just sees G as a separate light.

There are actually two solutions that work and I'm currently testing to see which is more reliable.

Solution 1: Use the detect_non_ha_changes option:

  1. Add the individual light entities to a single Adaptive Lighting entry. Do NOT add the zigbee group.
  2. Check the box in the entry for detect_non_ha_changes

Now when you control the lights using the zigbee group, adaptive lighting should flag every light in the group as manually controlled. According to the documentation though this isn't full-proof and could cause undesired behavior.

Solution 2: Create a separate helper group

  1. As in solution 1, add the individual light entities to a single Adaptive Lighting entry. Do NOT add the zigbee group.
  2. Add the same lights to a helper group in home assistant.

When you control the lights using the helper group, adaptive lighting will flag all the lights in that group as manually controlled. This gives you a good way to adjust a group of lights as a single entity, but you have an extra dummy entity to deal with. If you have a lot of groups this could get tedious, because every time you change an adaptive lighting group you will also have to update your dummy group to match it.

Neither solution is perfect because adaptive lighting is not using zigbee groups to issue its commands. Issuing individual commands for each light is not optimal and could saturate your zigbee network depending on your setup. In my case both solutions seem to work and I'm currently testing to see which one, if either, is buggier.

@basnijholt
Copy link
Owner

basnijholt commented Aug 3, 2023

I would recommend using normal Home Assistant light groups. Zigbee groups, indeed, will not work well when changing single lights in the Zigbee group (all of them will be manually controlled then).

@nathang21
Copy link

+1 I use Home Assistant Groups and after the improvements from @th3w1zard1 a couple months ago, it's been working great. Thanks for following up @akmolina28!

@basnijholt
Copy link
Owner

I believe this is a documentation issue.

Unfortunately, there is really nothing one can do to get the lights in a Zigbee group. So use a Home Assistant Light Group instead if you need individual control too.

I have added a WARNING here: #708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants