zigul/HomeAssistant-CEZdistribuce

Entity is not added

Closed this issue · 2 comments

Hi,
I have a problem with this component. Here is message from logs. Can you help me please?

Logger: homeassistant.components.binary_sensor
Source: custom_components/cezdistribuce/downloader.py:36
Integration: Binary Sensor (documentation, issues)
First occurred: 19:46:30 (2 occurrences)
Last logged: 19:46:30

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 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 587, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 698, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in _stringify_state
state = self.state
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py", line 178, in state
return STATE_ON if self.is_on else STATE_OFF
File "/config/custom_components/cezdistribuce/binary_sensor.py", line 60, in is_on
return downloader.isHdo(self.responseJson["data"])
File "/config/custom_components/cezdistribuce/downloader.py", line 36, in isHdo
days = jsonCalendar[1]
IndexError: list index out of range

Go to the page https://www.cezdistribuce.cz/cs/pro-zakazniky/spinani-hdo, select the region and enter the same code you have in the configuration. If that doesn't work for you, you have the wrong code. Additionally, the error may be 0, for example, enter A1B5DP06 instead of A1B5DP6.

No more info