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

Philips Hue integration not properly reporting light states (continuation of #61819) #61926

Closed
majkers opened this issue Dec 15, 2021 · 37 comments · Fixed by home-assistant-libs/aiohue#89
Assignees

Comments

@majkers
Copy link

majkers commented Dec 15, 2021

The problem

I still have my hue lights connected to bridge v2 wrongly reporting its state. It happens with Philips bulb with latest firmware and with 3rd party like IKEA ones. I did testing with quick toggling (ON and OFF) and with slow one. My zigbee sensors state is connected and light entities report state as ON but in fact they are OFF. Sometime after a long while they change by itself to proper one but it is rather random.

What version of Home Assistant Core has the issue?

2021.12.2

What was the last working version of Home Assistant Core?

2021.11

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Philips hue

Link to integration documentation on our website

https://www.home-assistant.io/integrations/hue/

Example YAML snippet

N/A

Anything in the logs that might be useful for us?

Nothing in logs

Additional information

N/A

@probot-home-assistant
Copy link

hue documentation
hue source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @balloob, @marcelveldt, mind taking a look at this issue as it has been labeled with an integration (hue) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@TimBE1989
Copy link

I'm facing the same issue. States are out of sync.

HA showing the light on while the light is actually off. I only get them in "sync" again if I change something from the colors.

@majkers
Copy link
Author

majkers commented Dec 15, 2021

Changing something in android hue app forces sync as well.

@marcelveldt
Copy link
Member

Some things to check:

  • Is there no firewall between HA and the Hue bridge ?
  • Do you see any errors/warnings in the logs ?
  • Are there any third party lights connected to your setup, such as Osram, Tuya etc ?

@majkers
Copy link
Author

majkers commented Dec 15, 2021

  • No there is no firewall
  • Nothing but I have no extra logging enabled
  • Yes. IKEA bulbs

@TimBE1989
Copy link

Hi Marcel,

  • No firewall
  • No errors / warnings in the logs
  • No third party lights connected

I can see two more people complaining in the main thread (https://community.home-assistant.io/t/2021-12-new-configuration-menu-the-button-entity-and-gorgeous-area-cards/365680/421)

@majkers
Copy link
Author

majkers commented Dec 15, 2021

Some more info here as well #61819 (comment)

@marcelveldt
Copy link
Member

I think I can reproduce the issue now. I will investigate.

@golles
Copy link
Contributor

golles commented Dec 15, 2021

To me, it looks like the state is updated quickly in the UI when I change the light on/off in the HUI app. But when I try to turn off a light from HA, the light turns off, but the state remains on.

  • No firewall
  • No errors / warnings in the logs
  • No third party lights connected

@marcelveldt
Copy link
Member

marcelveldt commented Dec 15, 2021

Are some people able to turn on debug logging ?
For both the hue component and aiohue library. That way we can see if indeed the bridge connection gets lost all the time.

In your configuration.yaml:

logger:
    default: info
    logs:
        homeassistant.components.hue: debug
        aiohue: debug

@smonesi
Copy link

smonesi commented Dec 15, 2021

(sorry for adding details to the closed issue!)

I did some experiment on my own, I changed the timeout (hardcoded in aiohue events.py to 10 seconds), I finally set it to 120 and...

Dec 15 20:53:25 fenix hass[1427315]: 2021-12-15 20:53:25 DEBUG (MainThread) [aiohue.v2[192.168.1.21].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
Dec 15 20:53:29 fenix hass[1427315]: 2021-12-15 20:53:29 DEBUG (MainThread) [aiohue.v2[192.168.1.21].events] Connected to EventStream
Dec 15 20:53:52 fenix hass[1427315]: 2021-12-15 20:53:52 DEBUG (MainThread) [homeassistant.components.hue.bridge.temperature] Received status update for sensor.sensore_giardino_temperature
Dec 15 20:55:30 fenix hass[1427315]: 2021-12-15 20:55:30 DEBUG (MainThread) [aiohue.v2[192.168.1.21].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
Dec 15 20:55:34 fenix hass[1427315]: 2021-12-15 20:55:34 DEBUG (MainThread) [aiohue.v2[192.168.1.21].events] Connected to EventStream

If I look at my previous logs, I see that the reconnections happened every 10 seconds, now every 120 seconds... I guess I'll fix my issue by setting the timeout to a very high number? 😄

@marcelveldt
Copy link
Member

Oh my.... My fix from early today broke this.
The 10 seconds is in fact applied to the entire connection and not only initial connect.
There was a deadlock in there with timeout set to zero.

You can set it back to zero for now to have a stable setup. Please check how that works out.
in the meanwhile I'm going to think about the chicken and the again situation.
Not timing out the actual reading of events but no deadlock when initially connecting.... sigh

@dshokouhi
Copy link
Member

i am also seeing this issue.

When i attempt to reload the integration the conneciton is kept for a few seconds then it quickly loses it again and i can no longer control the light.

2021-12-15 12:03:26 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:03:28 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:03:30 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:03:39 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:03:41 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:03:43 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:03:45 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:03:54 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:03:56 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:03:58 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].bridge] fetched 1 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].bridge_home] fetched 1 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].entertainment] fetched 2 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].entertainment_configuration] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].device] fetched 11 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].light] fetched 10 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].scene] fetched 6 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].button] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].device_power] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].geofence_client] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].light_level] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].motion] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].temperature] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].zigbee_connectivity] fetched 11 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].room] fetched 2 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].zone] fetched 0 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].grouped_light] fetched 3 items
2021-12-15 12:04:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:09 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:11 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 2 seconds
2021-12-15 12:04:11 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:13 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:13 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:15 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:24 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:24 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:26 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:28 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:28 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:30 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:31 DEBUG (MainThread) [homeassistant.components.hue.bridge.light] Received status update for light.front_door_lamp
2021-12-15 12:04:31 DEBUG (MainThread) [homeassistant.components.hue.bridge.grouped_light] Received status update for light.living_room
2021-12-15 12:04:32 DEBUG (MainThread) [homeassistant.components.hue.bridge.grouped_light] Received status update for light.living_room
2021-12-15 12:04:33 DEBUG (MainThread) [homeassistant.components.hue.bridge.light] Received status update for light.front_door_lamp
2021-12-15 12:04:33 DEBUG (MainThread) [homeassistant.components.hue.bridge.grouped_light] Received status update for light.living_room
2021-12-15 12:04:34 DEBUG (MainThread) [homeassistant.components.hue.bridge.grouped_light] Received status update for light.living_room
2021-12-15 12:04:39 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:39 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:41 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:43 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:43 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:45 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:54 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:54 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:56 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Disconnected from EventStream () - Reconnect will be attempted in 4 seconds
2021-12-15 12:04:58 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:04:58 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream
2021-12-15 12:05:00 DEBUG (MainThread) [aiohue.v2[192.168.1.53].events] Connected to EventStream

@LordAttilas
Copy link

Issue is also causing motion sensor to not detect movement or stay in motion "Detected" status.

Just rolled back to core 2021.12.1 and motion sensor and light status are back to normal.

Thanks :)

@marcelveldt
Copy link
Member

Please revert to 2021.12.1 if you experience this issue.
This will still have a small issue but not as bad as this.

We'll provide a fix soon, thanks!

@dshokouhi
Copy link
Member

@marcelveldt thank you for all your efforts in resolving everything, it is VERY much appreciated! Personally i can't rollback because then the app configuration menu will be hidden from non-admin users so i will hold off until the fix is ready :)

@Nutti85
Copy link

Nutti85 commented Dec 15, 2021

I'm not seeing this issue with my V2 hub.

Model number: BSB002
Software: 1.48.1948086000 <- the Hue app reports this as the last known version

@picotrain77
Copy link

I am experiencing the same issue with data in HA being out of sync.
I have motion sensor reporting constant movement - with none taking place.
If I toggle a motion sensor switch in HA the state of the switch jumps back a few seconds later as the switch is reporting off in HA but is actually on in Hue - therefore no push of state change from the bridge and no updating of the state in HA.

Restarting the addon and or HA appears to rectify the issue but only for a short time.
I can force the issue to occur by simply toggling a motion sensor switch a few times in quick succession.
Like others, all actions that take place via the hue app are instantly reported and shown in HA with lightning speed.

@marcelveldt
Copy link
Member

Please do not report the same issue again. It's confirmed.
You can temporary rollback to 2021.12.1
A fix will be on the way, thanks!!

@picotrain77
Copy link

Please do not report the same issue again. It's confirmed. You can temporary rollback to 2021.12.1 A fix will be on the way, thanks!!

Sorry I didn't see that - my apologies

@marcelveldt
Copy link
Member

Managed to fix it (this time for real haha).
The fix will be in next bugfix release of HA.

@picotrain77
Copy link

Thank you so much for your efforts on this @marcelveldt it is very much appreciated. Your a star ⭐️

@marcelveldt
Copy link
Member

Reopened as reference for others not reporting the same issue.

@srijken
Copy link

srijken commented Dec 17, 2021

Is this fixed in 2021.12.2, or will that be a later release? I'm still seeing this is 2021.12.2.

@N1c093
Copy link
Contributor

N1c093 commented Dec 17, 2021

@srijken I think it will be in 2021.12.3.

Version 2021.12.2 was released before this bug fix.

@TheFes
Copy link
Contributor

TheFes commented Dec 17, 2021

Is this fixed in 2021.12.2, or will that be a later release? I'm still seeing this is 2021.12.2.

@srijken
2021.12.2 was released Wednesday, Marcel commented that he fixed it yesterday and that it would be included in the next release.
Simple math answers your question to "No, not fixed in 2021.12.2, yes it will be in a later (2021.12.3) release"
BTW a few posts above yours it is mentioned that rolling back to 2021.12.1 solves the issue, so the issue is introduced in 2021.12.2

@trunks403
Copy link

I have the same issue only i am not using ikea blubs but the lidl bulbs that give this problem

They bulbs give the wrong color and i when i turn them on after sec they turning off again in ha but they are still on

I have this problem since the release of 2021.12 and core-2021.12.2 the problem i still there

@marcelveldt
Copy link
Member

@TheFes The issue already existed in 2021.12.0 and 2021.12.1 but got worse in 2021.12.2. So a rollback to .1 will make things a bit better but not 100%.

2021.12.3 will be released today in which it should be fully fixed.

@trunks403 Please open a new issue if you still experience issues AFTER the update to 2021.12.3 Thanks!

@Nenodema
Copy link

Thanks for your effort @marcelveldt really appreciate your work on this!

@jentstemmerman
Copy link

I also had troubles with this bug. Toggling a group of hue lights in HA would hang after 5-6 cycles.
With 2021.12.3 I don't see the problem anymore.

Thanks!

@Mithrox
Copy link

Mithrox commented Dec 17, 2021

Same here, everything seems good now after the update, thank you!

@marcelveldt
Copy link
Member

Great to hear that the issues are now resolved, thanks for your patience!

@tristanXme
Copy link

Just did the upgrade to 2021.12.3 but sadly the states are still not correct.

@marcelveldt
Copy link
Member

Just did the upgrade to 2021.12.3 but sadly the states are still not correct.

Can you open a new issue and exactly describe what is not correct ?
I doubt this is the same issue as referred to in the issue.

@tristanXme
Copy link

The description matches 100% for me. I also use ikea bulbs and Original hue bulbs. State in the hue app is correct but its wrong at home Assistant.

@marcelveldt
Copy link
Member

This is a closed issue. Please report a new one, exactly describing what issues you experience. With all lights or some etc ?
Are you 100% sure you've updated to 2021.12.3 ?

You may want to enable debug logging to see a lot more info.
See a bit above in this long issue report to see how to enable debug for the aiohue library.

Also, in general look in the logs if there are errors.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Dec 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.