I constantly get this error message after restarting HA.
Error while setting up homematic platform for cover
Then the state of the HMIP-BROLL window covers is unavailable. However this does not effect my HMIP-PSM plugs, which keep on working as desired.
I am running Home Assistant Supervised on Debian 10 and Debmatic on the same host.
The only way to get the covers working in HA again is to restart Debmatic AND then restart HA again. (Alternatively restarting the entire Host does the same)
But as soon as I restart HA afterwards (e.g. due to changes in configuration.yaml) the error message is back and the covers are unavailable.
Full log error message:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 192, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in _async_add_entity
supported_features=entity.supported_features,
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 219, in supported_features
if self.current_cover_position is not None:
File "/usr/src/homeassistant/homeassistant/components/homematic/cover.py", line 45, in current_cover_position
return int(self._hm_get_state() * 100)
ValueError: invalid literal for int() with base 10: ''
I assume this has nothing to do with the common issue of loosing the connection between CCU and HA after rebooting CCU - since 1. this happens on HA reboot and 2. the HMIP-PSM keep on working.
These covers report either 100 for fully open or 0 for everything else.
In the past I used templates for this state attribute but since I migrated my HA installation I removed these templates and that’s when the error appears.
So now I added the templates back to my configuration and interestingly after HA restart the same error happens again and the covers are unavailable BESIDES the cover “cover.xxxxxxxxxxxxxx3” (wohnzimmer_links) which is available and working.
But I don’t see any difference in the configuration of cover 3 in comparison to the others.
Ok. I was thinking that perhaps you had used the states.cover.object_id.attrributes.position format instead of the states('cover.object_id', 'position') form for the templates - that can have issues at start up. That is not the case.
The thing is that I can easily reproduce this faulty behavior:
I restart debmatic
I restart HA
Result: all four covers are available
I restart HA again
Result: only 1 of 4 covers are still available
troubleshooting options:
Devices in Debmatic CCU: all covers are still usable via CCU directly
Connection between CCU and HU: 1 cover and all switches are still available
Templates in HA: no difference between templates of the available cover in comparison to the others. Furthermore, even without using any templates this error occurs.
Entities in HA: I removed all covers from CCU and deleted the entities in HA. Re-added them to CCU and HA.