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

Homeassistant.components.light.hue Unable to reach bridge (flapping) #13949

Closed
sj3fk3 opened this issue Apr 17, 2018 · 24 comments
Closed

Homeassistant.components.light.hue Unable to reach bridge (flapping) #13949

sj3fk3 opened this issue Apr 17, 2018 · 24 comments

Comments

@sj3fk3
Copy link

sj3fk3 commented Apr 17, 2018

Home Assistant release with the issue:
0.67.0
but also reports from version 0.66

Last working Home Assistant release (if known):
0.65.6

Operating environment (Hass.io/Docker/Windows/etc.):
Linux virtualenv

Component/platform:
hue

Description of problem:

Flapping connection.. (disconnect and reconnect)

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

hue:
  bridges:
    - host: a.b.c.d
      filename: phue.conf
      allow_unreachable: true
      allow_hue_groups: true

Traceback (if applicable):

2018-04-09 19:31:15 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 10.0.1.17
2018-04-09 19:32:09 INFO (MainThread) [homeassistant.components.light.hue] Reconnected to bridge 10.0.1.17
2018-04-09 19:57:30 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 10.0.1.17
2018-04-09 19:58:15 INFO (MainThread) [homeassistant.components.light.hue] Reconnected to bridge 10.0.1.17
2018-04-09 20:06:12 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 10.0.1.17
2018-04-09 20:07:01 INFO (MainThread) [homeassistant.components.light.hue] Reconnected to bridge 10.0.1.17

Additional information:

@nelbs
Copy link

nelbs commented Apr 18, 2018

I think this is the same issue as #13685

@sj3fk3
Copy link
Author

sj3fk3 commented Apr 18, 2018

It's not the same issue, but it might be related to the same underlying problem.

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Apr 28, 2018

since i updated to 067.1
component light.hue never connects, and refuses to load Hassio consequently:

8-04-28 16:41:22 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 192.168.1.212
2018-04-28 16:41:23 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /supervisor/ping request
2018-04-28 16:41:23 ERROR (MainThread) [homeassistant.components.hassio] Not connected with Hass.io
2018-04-28 16:41:23 INFO (MainThread) [homeassistant.setup] Setup of domain hassio took 15.0 seconds.
2018-04-28 16:41:23 ERROR (MainThread) [homeassistant.setup] Setup failed for hassio: Component failed to initialize.

lights show fine though and are switchable. When they're not shown as unavailable while in fact they are (App, api, etc)

@balloob
Copy link
Member

balloob commented May 29, 2018

This happens if the Hue bridge is not able to respond to our query within the set time. Which is very rare. Is your Home Assistant instance with bad wifi connection and thus cannot always reach the hub ?

@Mariusthvdb
Copy link
Contributor

No, everything is wired. Even have the hue Hub and Pi on their own direct cable to the Asus router.

@sj3fk3
Copy link
Author

sj3fk3 commented May 29, 2018

I don't see the ERRORS anymore in 0.70 \o/

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented May 29, 2018

well, i only wish it were true.
below (and sorry for the rather large snippet) is a very small bit of the log after having updated to .70.
what ever the reason is, it isnt solved at all, on the contrary...please let me know what to do to be able to help debug/solve this:
Ive purposely copied the error on the 'listener', maybe anyone can confirm this is related, or what this is about in the first place. I can only see these errors appear together, as if they are related to the Hue hub being connected and disconnected repeatedly:

2018-05-29 21:48:03 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:48:20 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 192.168.1.212
2018-05-29 21:48:23 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:48:26 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:48:28 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:48:35 WARNING (MainThread) [homeassistant.core] Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6de3d390>
2018-05-29 21:48:35 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6de3d390>
Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 49, in uvloop.loop.Handle._run
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/event.py", line 211, in point_in_time_listener
    hass.async_run_job(action, now)
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 253, in async_run_job
    target(*args)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 95, in async_script_delay
    self._async_listener.remove(unsub)
ValueError: list.remove(x): x not in list
2018-05-29 21:48:35 WARNING (MainThread) [homeassistant.core] Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6e1356f0>
2018-05-29 21:48:35 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6e1356f0>
Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 49, in uvloop.loop.Handle._run
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/event.py", line 211, in point_in_time_listener
    hass.async_run_job(action, now)
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 253, in async_run_job
    target(*args)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 95, in async_script_delay
    self._async_listener.remove(unsub)
ValueError: list.remove(x): x not in list
2018-05-29 21:48:35 WARNING (MainThread) [homeassistant.core] Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6d7b7810>
2018-05-29 21:48:35 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6d7b7810>
Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 49, in uvloop.loop.Handle._run
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/event.py", line 211, in point_in_time_listener
    hass.async_run_job(action, now)
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 253, in async_run_job
    target(*args)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 95, in async_script_delay
    self._async_listener.remove(unsub)
ValueError: list.remove(x): x not in list
2018-05-29 21:48:37 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:48:40 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:48:48 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:49:15 INFO (MainThread) [homeassistant.components.light.hue] Reconnected to bridge 192.168.1.212
2018-05-29 21:49:20 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:49:23 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:49:30 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:49:47 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:49:51 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-05-29 21:49:54 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 192.168.1.212
2018-05-29 21:50:00 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting

@balloob
Copy link
Member

balloob commented May 30, 2018

Your stack trace is unrelated to Hue. It has to do with a delay in a script/automation.

@jawilson
Copy link
Contributor

Could this be related to #13389?

@Mariusthvdb
Copy link
Contributor

Your stack trace is unrelated to Hue. It has to do with a delay in a script/automation.

ok thanks, i will try to weed the scripts. Is it regular (yaml) or python scripts Im looking for, or cant you say based on this trace.

Still, please do follow up on the flapping of the OP here, it's really there

@ViperRNMC
Copy link

ViperRNMC commented Jun 11, 2018

Have the same error here, my hue system doesn't respons as fast as it did a few versions before (i think before the multiple bridges).

2018-06-11 22:47:19 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 10.0.0.212

@roflcoopter
Copy link

This started happening for me as well today. All wired connections. I have sub 20 devices so its not a whole lot.

@balloob
Copy link
Member

balloob commented Jun 14, 2018

We give the bridge 4 seconds to reply before marking it as unreachable. I wouldn't be surprised if there is another integration that is doing I/O inside the event loop which is slowing down the Hue.

People that are having this issue:

  • Please list the platforms that you use besides Hue
  • Try running your Home Assistant instance with just the Hue platform and nothing else configured. Does it still occur?

@ViperRNMC
Copy link

Try it coming week only with hue hub

list of platforms

  • tado
  • hue
  • zwave
  • mqtt
  • influxdb
  • buienradar
  • nmap
  • ring
  • dsmr
  • homekit
  • braviatv
  • samsungtv
  • appletv
  • pushover
  • powned
  • sabnzbd
  • speedtest
  • systemmonitor

@roflcoopter
Copy link

I reverted back to 0.70.0 and i still see this problem which is really strange since i did not get this error before. Whats interesting tho is that the error occurs EXACTLY 7 minutes apart for me.

If i post to /api//config and check the last_used timestamp its only Home Assistant who is calling the API so that rules out any other apps that might cause this

I can test disabling other components during the weekend hopefully, for now heres my platforms:

  • hue
  • zwave
  • ios
  • owntracks
  • nmap
  • mqtt
  • rfxtrx
  • systemmonitor
  • xiaomi_aqara
  • proximity
  • radarr
  • sonarr
  • harmony
  • broadlink
  • google_assistant
  • timer
  • generic thermostat
  • chromecast
  • braviatv
  • songpal
  • arlo
  • ffmpeg
  • twilio
  • facebox

I probably missed a few. Is there a good way to extract all of them?

@roflcoopter
Copy link

I turned off all other components and i still received the error. I have a few osram lights that are constantly marked as Unreachable in the Hue app, could it be this that is screwing with the integration?

@roflcoopter
Copy link

@sj3fk3 @hvbhome @balloob @ViperRNMC

Did you guys find a solution? This practically makes Home Assistant unusable for me.

@ViperRNMC
Copy link

No solution here, also try with only hue without succes. But i also have trouble again with history graphs.

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jun 18, 2018

No, unfortunately this keeps bugging the great support and integration for Hue we had before the change to Asyncio. As a matter of fact I've just had to change some automations to forgo on the state change of hue lights and reachability, since it keeps 'flapping', to stay on topic...

@balloob suggested before in this thread my issues had nothing to do with Hue. Unfortunately I have been able to establish it in fact has.
Restarting Hassio most of the time kills connection to Hassio itself, and takes it out of the side panel. If I continue to keep Hue alive during restart, through the Hue App, Hassio comes back in fine...

Im surprised no more action is taken to resolve the issue, many people are reporting on in a variety of details and issues, and asking for a solution. Would be glad to be of assistance in tracking this down , since, as you say, this is a major letdown for such an industry leading tool as Hue is.

Made a few rest sensor showing reachability, and this directly show the 'flapping' in the frontend...
Hopefully the restored support for scan_interval can solve the issue soon? Or isnt it restored for Hue after all? Not really sure.

@balloob
Copy link
Member

balloob commented Jun 19, 2018

Im surprised no more action is taken to resolve the issue, many people are reporting on in a variety of details and issues, and asking for a solution.

I ask for help in reporting the platforms people use so we can find a common platform. I don't see your platforms? Just a complaint.

I can't reproduce it. I also have limited time and can't just be chasing random reports. Feel free to spend your time on it instead of expecting other people to do so.

@sj3fk3
Copy link
Author

sj3fk3 commented Jun 19, 2018

The flapping as I reported (and I reported this bug) has been fixed a while ago. I think the problem with this bug report is, that it's fragmented. Maybe it's a good idea to report a new bug with specifics to reproduce. Because the bug I initially reported has been fixed for me.

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jun 19, 2018

Feel free to spend your time on it instead of expecting other people to do so.

this is a bit unfair, to be honest, as you can see in this thread alone, spending time trying to find the solution to the breaking change of Hue integration is exactly what we've been doing...

great to see some functionality get back on track, hue.hue_activate_scene. Which is much appreciated!

tried to compile several issues for my own and others reference https://community.home-assistant.io/t/any-hope-to-get-hue-hue-activate-scene-back/52741/9?u=mariusthvdb

nevertheless i forgot to mention the platforms you asked for, sorry for that. This should be getting close:
my (sensor)platforms, which are all working as they should, (or at least so it seems..) and show up in the frontend without issues, except when annotated, which is in fact only on Asuswrt

api_streams
asuswrt (could be a culprit, having previous issues of false reporting home/away)
cast
file
filesize
fitbit
google
group
hue
iCloud
influxdb
ios
microsoft (unused)
mpd
mqtt
nmap_tracker
notify
openweathermap
owntracks
ping
plex
proximity
pushbullet
rest
speedtest
spotify
systemmonitor
time_date
tradfri
trend
tts (unused)
uptime
version
workday
yweather

hope this helps, glad to assist in any other way i could
cheers!

@roflcoopter
Copy link

roflcoopter commented Jun 19, 2018

Actually (and i am a bit embarrassed about hits) a reboot somehow fixed this for me!(?)

I do not really understand how, I am running Home Assistant in Docker on an Intel NUC Ubuntu 18.04.
I guess an update to some package on the host OS or something messed this up. (I didn't reboot for 10 days)

Hope this helps someone

@balloob
Copy link
Member

balloob commented Jun 19, 2018

@hvbhome sorry if I came off a bit strong.

So the reason I want the platforms, is that it could be that one of them, although it seems like it works well, is stalling our event loop and then impacting Hue.

I am going to close this issue as the original poster had the issue resolved and also rebooting seems to help (which might hint at a misbehaving platform actually). 0.72 will fix the flapping sooner, as it was accidentally scanning every 30 seconds instead of the intended 5.

@balloob balloob closed this as completed Jun 19, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants