Home Assistant release with the issue:
0.66.0
Last working Home Assistant release (if known):
0.65.6
Operating environment (Hass.io/Docker/Windows/etc.):
HA running in official docker container for Raspberry Pi 3 on Raspbian Stretch
Component/platform:
https://www.home-assistant.io/components/hue
Description of problem:
After upgrading the Hue bridge is not recognized any more. This is not related to the new configuration scheme as mentioned by the 0.66.0 release notes. Traceback is available below. The final error message says: 'Config' object has no attribute 'apiversion'
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
hue:
bridges:
- host: 192.168.5.49
allow_hue_groups: False
Traceback (if applicable):
app_1 | 2018-03-31 09:43:58 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform hue
app_1 | Traceback (most recent call last):
app_1 | File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
app_1 | SLOW_SETUP_MAX_WAIT, loop=hass.loop)
app_1 | File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
app_1 | return fut.result()
app_1 | File "/usr/lib/python3.6/site-packages/homeassistant/components/light/hue.py", line 61, in async_setup_platform
app_1 | int(v) for v in bridge.api.config.apiversion.split('.'))
app_1 | AttributeError: 'Config' object has no attribute 'apiversion'
Additional information:
I think this error is a related to a required configuration change with 0.66.0. With 0.65.6 the bridge's host-attribute could be a DNS name ("philips-hue" in my case) and that name is also present in file phue.conf . With 0.66.0 only IPv4 addresses are allowed for the host-attribute and obviously (and without discovery enabled) the association to the hue bridge is lost.
Enabling the discovery component and restarting HA brings back the Hue configuration dialog and linking the bridge creates a new file named "phue-
However, no light bulb or other Hue component (motion sensor in my case) is available.
Restarting HA after linking the bridge to HA using discovery bring's back the error. Traceback:
app_1 | 2018-03-31 10:24:09 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform hue
app_1 | Traceback (most recent call last):
app_1 | File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
app_1 | SLOW_SETUP_MAX_WAIT, loop=hass.loop)
app_1 | File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
app_1 | return fut.result()
app_1 | File "/usr/lib/python3.6/site-packages/homeassistant/components/light/hue.py", line 61, in async_setup_platform
app_1 | int(v) for v in bridge.api.config.apiversion.split('.'))
app_1 | AttributeError: 'Config' object has no attribute 'apiversion'
Additional info: The bridge is accessible from the HA host / docker container by IP and DNS name. Using the API key present in file phue.conf ("username") to open http://192.168.5.49/api/
Reverting to 0.65.6 while keeping the configuration (using IP address instead of DNS name) brings back the bridge and the associated lights and motion sensors.
If you need any more information, I am willing to help.
I'm getting a similar error,
Error while setting up platform hue
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/src/app/homeassistant/components/light/hue.py", line 56, in async_setup_platform
bridge = hass.data[hue.DOMAIN][discovery_info['host']]
KeyError: 'host'
My config is as follows:
hue:
bridges:
- host: 192.168.1.3
allow_hue_groups: false
I have also lost my hue lights and sensors. I'm trying to downgrade with "sudo pip3 install homeassistant==0.65.6", but i get "[sudo] password for homeassistant" and have no idea what password is needed?
homeassistant user does not have any password. No need to use sudo if you are homeassistant user.
same behaviour over here.
Tried to modify the conf file manually to have both ip and dns name and matching config file but no way
If you are using the @robmarkcole sensor component you will need to update it. It has been fixed for 0.66
Using standard component. Same symptoms as above. Any solution ?
You mention "motion sensor" in your description. We do not have a Hue motion sensor integration. This means that you are using a custom component. As written in the release notes, they no longer work.
````yaml
binary_sensor:
Standard REST.
Btw: I don't know about Python, but the reported line(s) 61 of file hue.py contains:
api_version = tuple(
int(v) for v in bridge.api.config.apiversion.split('.'))
I can modify this line and use "api_version = (1,24,0)" but then another line fails (209). Seems that detecting the features of the bridge fails since 0.66 for me and some others.
How can I check that aiohue is present in the proper versions?
Well the Docker image should install it properly, but you can spin up python3 in your container and run this to see if somehow you're running it from a different location:
>>> import aiohue
>>> aiohue.__file__
It will print out the location where aiohue is found

Thanks for the instruction. Here's the complete output (the container's name is hassstack_app_1):
$ docker exec -ti hassstack_app_1 python3
Python 3.6.3 (default, Nov 21 2017, 21:28:39)
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiohue
>>> aiohue.__file__
'/usr/lib/python3.6/site-packages/aiohue/__init__.py'
Can you check to make sure that you definitely do not have any custom component for Hue? Also make sure that your <config dir>/deps does not contain anything hue related in the name.
I never used any custom component so the custom_component folder does not even exist. But - the deps folder contains some files related to hue, including aiohue 0.3.0 .
Can I remove the deps folder in total and restart the container to download them again?
yes, that is your problem. delete the folder.
The container should always contain all dependencies when running under Docker. Only a few dependencies are not installed but aiohue is not one of them.
I deleted my deps folder and HA complained couldn鈥檛 setup HUE due to lack of dependancies. I鈥檓 running in docker also.
yes, that is your problem. delete the folder.
@balloob Yes, that was the problem at my side. After deleting the deps folder and restarting the container, the Hue component did not complain any longer and all lights and (REST attached) motion sensors are working as expected. Infact, the deps folder was recreated, but stayed empty.
Thanks for the excellent support!
@aptonline Did you restart the container or did you re-create it (docker rm && docker run)? I did the later and it worked.
@m0wlheld I restarted it, I鈥檓 using it on a Synology Diskstation docker, I鈥檒l clear the container and try again.
@m0wlheld nope same error after clearing the container and restarting.
Seems I did have a custom components for HUE switches... removed and now working 馃憤
Excellent.