0.66 changes for Hue

Hi,

my Hue config looks like this since ages:

hue:
  bridges:
    - host: 192.168.10.5
    - allow_unreachable: true
    - allow_hue_groups: true

With the change regarding Hue in 0.66, the component stopped working and I’m getting:

"Invalid config for [hue]: required key not provided @ data['hue']['bridges'][1]['host']. Got None."

I don’t see the error - the host parameter is obviously there.

Also, it would be really great if the documentation was up to date when these kind of breaking changes are introduced - https://home-assistant.io/components/hue/ still lists the host parameter as optional, which it is not, if I’m reading the release notes correctly.

Sebastian

You need to remove the leading hyphen (-) infront of allow_unreachable and allow_hue_groups. These are keys in a HashMap that decribe a bridge. In you setting the are elements of the brdiges array, that’s why HA cannot find a host attribute in the second(!) bridge definition (index 1).

The JSON equivalent of the correct configuration is

{
 hue: {
  bridges: [{
   host: 192.168.10.5,
   allow_unreachable: true,
   allow_hue_groups: true
  }]
 }
}

while you setup gives

{
 hue: {
  bridges: [{
   host: 192.168.10.5
  },{
   allow_unreachable: true
  },{
   allow_hue_groups: true
  }]
 }
}
1 Like

Thanks a lot, that did the trick!
But again, it would have been very helpful to find this mentioned in the release notes or the official docs, especially after an additional week of beta testing before the release.

Sebastian

1 Like

Your configuration was invalid even before 0.66.0, but this did not trigger because “host” was optional.

A I said, you previous configuration defined 3 Hue bridges. One with an host, one with allow_unreachable: True and one with allow_hue_groups: True

I assume, that you infact have only one bridge …

Ok, I understand it now and now I finally understand how it’s meant in the documentation.
Should have been the other way around :wink:
Let me see if I can make some clarifying modifications to the docs.

Sebastian

Btw: Is your Hue bridge working with 0.66.0? Mine is gone (again), see my issue report.

I don’t see any issues with my bridge, everything looks fine now (after updating the config ;).
The apiversion attribute in your issue report seems to be part of the bridge configuration.
You can see it at the top-level when you retrieve the config doing a GET /api/<userid>/config on the bridge.
So it looks as if HA is not talking to your bridge or can’t retrieve your bridge config.
Or maybe something breaks while parsing the config.

I’d start with a tcpdump on the HA host to check communications between HA and the bridge.

Sebastian

Thanks for the hint, however no success. I can call the API config (using cURL) from the HA host using the “username” / API key from file phue,conf and an apiVersion is 1.24.0 is present in the response.

1 Like

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

Any ideas?

Do you have the discovery component enabled too?

Sebastian

I do, but I have hue set to be ignored:

discovery:
  ignore:
    - apple_tv
    - belkin_wemo
    - philips_hue
    - ikea_tradfri
    - harmony

Ok, it was just a shot in the dark.

Sebastian

1 Like

I can do the same, still no HUE in 0.66.0 even if I just try with discovery. Seems 0.66.0 broke it :frowning:

If any of you are using the Hue sensors component by @robmarkcole then you will need to update it. The component has been updated for 0.66.

1 Like

Just using the stock component here.

Still not working :frowning:

Hi
Same situation
No luck having 0.66 hue working
tried both discovery andsetup.
no luck.
standard compnent
Is everybody having trouble?

Strange. I can only say that it works for me without any issues.

Sebastian

See my issue report on Gtihub. I had to remove the deps folder, as it contained outdated libraries for Hue.

Same problem for me, not showing up anymore
I dont have a deps folder, running it in venv but remove the package in site-packages. Still no-go

EDIT: rolled back to 65.6 and everything is fine

Had the same problem, fell back to 65.6 and it all worked again. Fired up Philips app, and found I had a Hue software update pending. Installed that, and retried the Hass update - everything now works with 66.1

EDIT I take that back, something else had triggered lights to come on. 66.1 does not appear to be communicating with the Hue bridge, getting timeout messages during setup:

WARNING (SyncWorker_2) [homeassistant.components.light.hue] Timeout trying to reach the bridge