Hue lights were working my HA (v.0.78.0) setups with no issues for long time but yesterday I noticed they are gone from UI and not showing in “Services” list.
and json with all necessary data is retuned from Hue bridge when I ssh in to hassio terminal and do curl http://192.168.0.12/api/<username>/lights. That is why I assume the problem is in HA itself or configuration.
Only related entries I can find in logs is
2018-09-22 12:13:31 ERROR (MainThread) [homeassistant.components.hue] Error connecting to the Hue bridge at 192.168.0.12
2018-09-22 12:13:31 ERROR (MainThread) [homeassistant.components.hue] Error connecting to the Hue bridge at 192.168.0.12. Retrying in 32 seconds
but I think I have seen these entries in logs even some time ago when Hue lights were fully functional in HA.
After extensive digging I finally found out root cause.
It appears that HA entity_registry.yaml is not used anymore and hue devices were reinitialized in .storage/core.entity_registry file with entity_id values created from friendly names in Hue that may have changed over time for many HA users.
So be aware that since HA 0.77 there is breaking change
The entity registry yaml file has been removed. It is now stored inside .storage and should only be managed via the UI (@balloob - #16018)
This may not be so obvious because entity_registry.yaml file is actually still there and .storage directory is hidden and at least in my case custom default view is set up in HA.
No clear solution yet - still trying to debug.
Tried to delete “old” /config/entity_registry.yaml and “new” files /config/.storage/core.config_entries /config/.storage/core.device_registry /config/.storage/core.entity_registry
and reboot hassio to recreate files in .storage directory.
after reconnecting to Hue bridge via Setting -> Integration and updating entity_id to those discovered automatically I had my hue lights back. But now I have issues with emulated wemo switches
One is clear - this breaking change should not be mentioned in read and bold. And migration to new approach should be handled better.
After Hassio reboot configure Hue Bridge once more;
Reconfigured wemo switches to MQTT switches in HA since wemo discovery did not work reliably even before. After getting Hue devices appear again I could not make wemo devices to be discovered by HA.
Updated configuration.yaml to (because Tasmotized Sonoffs switches are still emulating wemo for Alexa):
I removed the bridge and added it again immediately afterwards, which did the trick for me, so my lights are back. Didn’t even need a restart.
The entity_registry.yaml file was removed automatically. I didn’t touch the hidden files in .storage that you’ve mentioned but it wasn’t necessary to delete those I guess.