title: Home Assistant - Meross Ghost Entity & VLAN Routing Fix date: 2026-08-09 lastmod: 2026-08-09 draft: false tags:

  • home-assistant
  • meross
  • vlan
  • networking
  • homelab categories:
  • homelab
  • iot

1 Meross Ghost Entity & VLAN Routing Fix#

1.1 The Issue#

When deleting and re-adding a Meross device, Home Assistant might refuse to connect and continuously restore the old ghost entity name while throwing a KeyError and AttributeError: 'NoneType' object has no attribute 'attach' in the logs.

1.2 Why it happens#

  1. The Registry Ghost: When a device is deleted from the UI, Home Assistant sometimes keeps its UUID permanently trapped in the hidden deleted_devices and deleted_entities recycle bins inside the .storage registry. Whenever you re-add the device, HA automatically restores the old, corrupted data.
  2. The Cloud Profile Cache: The meross_lan integration caches the Meross Cloud Profile. If you re-add a device to the Meross app, meross_lan may still use an expired offline cache (e.g., meross_lan.profile.xxxxxx) which lacks the new UUID or MQTT keys, causing a KeyError.
  3. The VLAN Block: If Home Assistant is on a different VLAN than the IoT devices and HTTP (Port 80) is blocked, meross_lan cannot push the local MQTT configuration to the new device, leaving it “Unavailable”.

1.3 The Complete Fix & Automation Script#

Target SSH Host: root@10.1.2.200

1.3.1 Purge the Registry & Cache via SSH (Automated One-Liner)#

Replace TARGET_UUID with the actual device UUID (e.g. 2105088987914955854648e1e9707285):

TARGET_UUID="<UUID_HERE>"

# 1. Stop Home Assistant Core
ha core stop

# 2. Backup & Purge core.device_registry (Active + Deleted)
cp /config/.storage/core.device_registry /config/.storage/core.device_registry.bak
jq --arg uuid "$TARGET_UUID" '.data.devices |= (if type=="array" then map(select((.identifiers | tostring | contains($uuid)) | not)) else . end) | .data.deleted_devices |= (if type=="array" then map(select((.identifiers | tostring | contains($uuid)) | not)) else . end)' /config/.storage/core.device_registry > /tmp/cdr.json && mv /tmp/cdr.json /config/.storage/core.device_registry

# 3. Backup & Purge core.entity_registry (Active + Deleted)
cp /config/.storage/core.entity_registry /config/.storage/core.entity_registry.bak
jq --arg uuid "$TARGET_UUID" '.data.entities |= (if type=="array" then map(select((.unique_id | tostring | contains($uuid)) | not)) else . end) | .data.deleted_entities |= (if type=="array" then map(select((.unique_id | tostring | contains($uuid)) | not)) else . end)' /config/.storage/core.entity_registry > /tmp/cer.json && mv /tmp/cer.json /config/.storage/core.entity_registry

# 4. Remove Stale Meross Cloud Profile Cache
rm -f /config/.storage/meross_lan.profile.*

# 5. Restart Home Assistant Core
ha core start

1.3.2 Re-Add & UI Dashboard Configuration#

  1. Wait ~60s for HA Core to restart and re-sync the profile from the Meross Cloud.
  2. In Settings > Devices & Services, re-add the device.
  3. Important Dashboard Tip: If the switch fails to control from a Light Card or shows as Off while physically ON, go to Settings > Devices & Services > Entities, open the switch entity, click the gear icon, and change “Show as” from Outlet to Light.