diff --git a/homeassistant/components/light/hue.py b/homeassistant/components/light/hue.py index cdbea7d2194..be3eea60453 100644 --- a/homeassistant/components/light/hue.py +++ b/homeassistant/components/light/hue.py @@ -206,6 +206,18 @@ def setup_bridge(host, hass, add_devices, filename, allow_unreachable, _LOGGER.error("Got unexpected result from Hue API") return + if not skip_groups: + # Group ID 0 is a special group in the hub for all lights, but it's not + # returned by api.get('groups'), so explicity get it and include it. + # See https://developers.meethue.com/documentation/groups-api#21_get_all_groups + all_lamps = bridge.get_group(0) + if not isinstance(all_lamps, dict): + _LOGGER.error("Got unexpected result from Hue API for group 0") + return + # Hue hub returns name of group 0 as "Group 0", so rename for ease of use in HA + all_lamps['name'] = "All Hue Lights" + api_groups["0"] = all_lamps + new_lights = [] api_name = api.get('config').get('name')