Skip to content

Light state changes pushed via Bifrost are overridden by previous state in Z2M #110

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

Open
alibleppo opened this issue Apr 2, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@alibleppo
Copy link

alibleppo commented Apr 2, 2025

Hi,

Thanks for producing this very neat tool. I seem to be having an issue with state synchronization between Bifrost and Z2M.

Here's a quick video showing the issue.

Oddly, the physical lights keep the state change, despite being changed back to its previous state in the Hue app via Bifrost a couple of seconds after making a change.

If I go to Z2M and click on any of the blue sync/refresh buttons, then the state change is accurately shown in Z2M (and immediately reflects in the Hue app via Bifrost):

Image

EDIT: another user on the project discord reported that they experience this issue as well with their Hue lights, but only with some of their lights. I tested my lights (also all Hue) and found:
9290024687 : affected
9290024717 : affected
8718699703424 : affected
046677577957 : affected
1741730V7 : not affected
1746730V7 : not affected
9290030520 : affected (these are the only ones I have that don't do color, but the brightness and on/off state is affected the same way)
1743830V7 : not affected
8719514419278 : affected

From what I can see at least, this behavior impacts all states, including on/off, brightness, color.

What might cause this? Grateful for any assistance.

@chrivers
Copy link
Owner

Hello @alibleppo

Sorry for the delayed response, I've been sick.

I think this could be related to the particular way Bifrost sends commands to Hue lights.

In recent versions of Bifrost, all light updates for Hue lights (on/off, brightness, etc) are encoded in a compact, Philips-specific format. This is what enables Bifrost to use Hue Effects (candle, fireplace, etc).

Unfortunately, z2m only supports this at a raw level so far. It's a work in progress, but it causes issues for us.

Namely, we never get any update responses from z2m, since it doesn't understand the update requests we are sending (it's merely passing them on to the lights).

This mechanism is auto-detected on a per-light basis, and it's possible that the lights you point to as being "not affected" don't support the fancy effects, which happen to be how we detect this.

I'm working on a branch with improvements in this area, since the lack of updates is also problematic in other ways.

Stay tuned, and thanks for the really detailed submission 😃

@chrivers chrivers added the bug Something isn't working label Apr 21, 2025
@chrivers
Copy link
Owner

@alibleppo The branch is ready for testing.

If you are on Home Assistant, please try the "dev" version of the Bifrost container. It contains the necessary patches.

If not on home assistant, run the dev branch through some other installation method.

Please let me know how it goes, and if it helps with your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants