Core: Hue stopped working in 0.66.0.beta0

Created on 25 Mar 2018  路  37Comments  路  Source: home-assistant/core

Home Assistant release (hass --version):
0.66.0.beta0

Component/platform:
Hue

Description of problem:
After upgrading to 0.66.0.beta0, home assistant refuses to properly setup my hue lights.

Expected:
Hue lights work properly.

Problem-relevant configuration.yaml entries and steps to reproduce:

hue:
  bridges:
    - host: !secret hue_host
      allow_unreachable: true
      allow_hue_groups: true

Traceback (if applicable):

2018-03-25 13:33:34 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform hue
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/site-packages/homeassistant/components/light/hue.py", line 55, in async_setup_platform
    bridge = hass.data[hue.DOMAIN][discovery_info['host']]
KeyError: 'host'

Additional info:

Most helpful comment

Just picked up 0.66.0.beta2 and ran into the same issue I reported. However, I realized that I had installed the Hue Motion Sensor custom component, and removing that solved the issue for me.

Does anybody else run that custom component?

All 37 comments

I did notice a comment about breaking changes regarding phue -> aiohue, however it wasn't clear to me if anything needs to be done to the config.

Same here - appears to work fine on start, but as soon as I switch a light on (or anything) I get error after error similar to the above and then anything hue related stops working. Have had to roll back.

FWIW, no such errors on my setup. I have the following in my config:

hue:
  bridges:
    - host: 192.168.2.229
      allow_hue_groups: false

I don't have allow_hue_groups declared (IIRC it's true by default?), I do have allow_unreachable: true

Worth trying without allow_unreachable: true.

That's exactly what I was thinking but I'm afk now, will try later and report back. 馃憤

According to the docs allow_unreachable is still valid.

I just tried without allow_unreachable and same result. The error KeyError: 'host' seems to indicate more than just a sub-entry like unreachable.

@arsaboo

Re->FWIW, no such errors on my setup

Try to turn on one of your Hue lights from the web interface and then check your logs.

@mp01111 Yes, I did that and even changed the colors, effects, etc. No errors in the logs.

Another piece of information that may be relevant...I am on Gen 2.

I'm gen 2 too, so it's not that I don't think.

Got the same issues. I pared back my hue config to only have the host entry (ip address) and it still wouldn't setup the platform on startup. Rolled back to .65.6 and back to normal (with the full set of config options I used originally).

@arsaboo

It still fails for me- even if I remove from config.yaml and leave it on discovery only. Weird.

To see what other similarities or differences we all might have, how is everyone installed?
I am Ubuntu server 17.10 with a simple install, no virtual environment.

I am in hass.io

Debian, in a venv, no discovery.

I haven't done anything with this since my posts above as I haven't been at home for long enough in the meantime.

Interesting. I wasn't expecting this to be so varied.

@arsaboo since you are working, what is your setup?

Ubuntu in venv,

I updated to 0.66b1 and everything is still working well here. I am on Ubuntu in venv.

It seems to be a race condition. I've included a fix in #13475

0.66b1 still has the same errors for me. @arsaboo has obviously made his monthly payments to the devil. I should not have ignored the invoice. ;-)

@zarthan try the latest fix in #13475

Fix has been included in beta2

I tried beta2 and still have the same error

Log Details (ERROR)
Mon Mar 26 2018 19:32:45 GMT-0500 (Central Daylight Time)

Error while setting up platform hue
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/light/hue.py", line 56, in async_setup_platform
    bridge = hass.data[hue.DOMAIN][discovery_info['host']]
KeyError: 'host'

I'm also not getting the platform setup in b2.

Error

Invalid config for [hue]: required key not provided @ data['hue']['bridges'][1]['host']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 114). Please check the docs at https://home-assistant.io/components/hue/

My Config

hue:
  bridges:
    - host: 192.168.73.54
    # - allow_in_emulated_hue: false
    - allow_unreachable: true
    - allow_hue_groups: false

I commented out the allow_in_emulated_hue since that was what threw the error on my first try at b2

@GreenTentacle you have a misconfiguration problem so not the same as this issue. host is a required key in the list of bridges key-value pair maps. Two of the maps in the bridges list is missing host in your config.

@MartinHjelmare I pulled out the 3 options and it indeed looks like it's working now, however if the config was left as is, it worked without issue in .65.6, which is odd. I'm not sure if I mangled the tabs in copying it into the issue, or if .65.6 was just more forgiving of bad configs-- I'll check out my past config commits later on.

Anyway, it looks like I may be good for now, thanks !

I'm confused about what the config should look like now, as it still doesn't work for me on b2. How should my current config be changed?

hue:
  bridges:
    - host: !secret hue_ip
      filename: phue.conf
      allow_unreachable: true
      allow_hue_groups: true

Do you have the same error as in the first post of this thread?

Yes sorry should have mentioned that, exact same error, lights don't show up at all. Will try to reinstall a totally fresh docker container as maybe there's a glitch in mine

Confirmed working with a fresh install!
Cheers

Just picked up 0.66.0.beta2 and ran into the same issue I reported. However, I realized that I had installed the Hue Motion Sensor custom component, and removing that solved the issue for me.

Does anybody else run that custom component?

@docbobo - that custom_component isn't going to work anymore, but @balloob assures me that native support for other hue devices is coming soon now that the base of the platform has changed.

Hope this helps.

I do have the custom component installed so it is my issue as well. I don't think I can do without it so I will just keep watching.

I run into the same issue after upgrading. I just changed my home automation completely to use hass.io with AppDaemon and programmed all hue motion sensors to control light in the entire home which worked great. But this is a bummer. I will roll-back and wait for the next release with integrated hue motion sensors. This is still an incredible platform!

Was this page helpful?
0 / 5 - 0 ratings