diff --git a/homeassistant/components/scrape/__init__.py b/homeassistant/components/scrape/__init__.py index 4f48315b03f..d6b49a3e8a8 100644 --- a/homeassistant/components/scrape/__init__.py +++ b/homeassistant/components/scrape/__init__.py @@ -230,6 +230,17 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ScrapeConfigEntry) -> add_config_subentry_id=new_unique_id, new_identifiers={(DOMAIN, new_unique_id)}, ) + if ( + sub_entries := device.config_entries_subentries.get( + entry.entry_id + ) + ) and None in sub_entries: + # Remove None from the subentries if exist + device_reg.async_update_device( + device.id, + remove_config_entry_id=entry.entry_id, + remove_config_subentry_id=None, + ) # Remove the sensors as they are now subentries new_config_entry_data = dict(entry.options)