From 11e2f516814964cd20352f3ce3418cb12c981ee7 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sun, 5 Dec 2021 18:47:24 +0100 Subject: [PATCH] Fix Hue migration (#61030) --- homeassistant/components/hue/migration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/hue/migration.py b/homeassistant/components/hue/migration.py index 2da13ce8bf2..408ba3fc8e0 100644 --- a/homeassistant/components/hue/migration.py +++ b/homeassistant/components/hue/migration.py @@ -166,6 +166,9 @@ async def handle_v2_migration(hass: core.HomeAssistant, entry: ConfigEntry) -> N continue v1_id = f"/groups/{ent.unique_id}" hue_group = api.groups.room.get_by_v1_id(v1_id) + if hue_group is None or hue_group.grouped_light is None: + # try again with zone + hue_group = api.groups.zone.get_by_v1_id(v1_id) if hue_group is None or hue_group.grouped_light is None: # this may happen if we're looking at some orphaned entity LOGGER.warning(