Recently one of my automations which turns off my TV over HDMI CEC from the connected Raspberry Pi running OSMC stopped working (I think after the update to 0.63, but I can’t be sure). I only got the chance to look at this yesterday and I found that I can see the state of the switches but can’t control them (turning the switch off leaves the TV on, etc.). The problem persists in 0.64 and other than upgrading the config has stayed the same.
My HDMI CEC config is as follows:
hdmi_cec:
host: !secret kodi_host
On start up I get the following error in my logs (actually one for each connected HDMI device):
Mar 06 21:51:42 homeassistant hass[543]: 2018-03-06 21:51:42 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Mar 06 21:51:42 homeassistant hass[543]: Traceback (most recent call last):
Mar 06 21:51:42 homeassistant hass[543]: File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
Mar 06 21:51:42 homeassistant hass[543]: result = coro.send(None)
Mar 06 21:51:42 homeassistant hass[543]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
Mar 06 21:51:42 homeassistant hass[543]: msg)
Mar 06 21:51:42 homeassistant hass[543]: homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.hdmi_0
Mar 06 21:51:42 homeassistant hass[543]: 2018-03-06 21:51:42 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: exception=Traceback (most recent call last):
Mar 06 21:51:42 homeassistant hass[543]: File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
Mar 06 21:51:42 homeassistant hass[543]: result = coro.send(None)
Mar 06 21:51:42 homeassistant hass[543]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
Mar 06 21:51:42 homeassistant hass[543]: msg)
Mar 06 21:51:42 homeassistant hass[543]: homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.hdmi_0
Mar 06 21:51:42 homeassistant hass[543]: , timestamp=1520326302.6527023, source=helpers/entity_platform.py, level=ERROR, message=Error doing job: Task exception was never retrieved>
Could be related to the new entity registry feature. Try moving the file entity_registry.yaml to a backup place and restart HA. That should restore this file and probably solve the issue.