Mistype in CEZ website
Closed this issue · 2 comments
CEZ has mistype in their system of presentation of HDO signal codes.
In your account details, codes are presented one character longer than validation page you use for your plugin can handle - let's check the pic.
After changing my "code" in sensor config to "a1b4dp01" or "a1b4dp02", sensor is no longer loaded into homeassistant. Changing to correct value "a1b4dp1" and "a1b4dp2" fixes this.
Error trace when "code" is typed as CEZ presents it:
Logger: homeassistant.components.binary_sensor
Source: custom_components/cezdistribuce/downloader.py:29
Integration: Binární senzor (documentation, issues)
First occurred: 23:47:47 (2 occurrences)
Last logged: 23:47:47
Error adding entities for domain binary_sensor with platform cezdistribuce
Error while setting up cezdistribuce platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 314, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 505, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
sstate = self.state
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py", line 158, in state
return STATE_ON if self.is_on else STATE_OFF
File "/config/custom_components/cezdistribuce/binary_sensor.py", line 61, in is_on
return downloader.isHdo(self.responseJson)
File "/config/custom_components/cezdistribuce/downloader.py", line 29, in isHdo
days = jsonCalendar[1]
IndexError: list index out of range
It would be nice to add some error handling, which throws link to wiki describing this situation to the log.
Je to tak, bohužel stále neopraveno.
Toto je problém v API ČEZ Destribuce nikoliv v této integraci.