slesinger / HomeAssistant-PREdistribuce

Home Assistant integration to display info about energy plan
https://slesinger.info
Apache License 2.0
11 stars 8 forks source link

Not working since DST change? #14

Closed Plawasan closed 1 year ago

Plawasan commented 1 year ago

Ahoj,

seems to me like the sensor stopped working properly this morning since the DST change ... or it might be a coincidence (PRE changed something?) however I'm not getting the same results now without any change to my config

- platform: predistribuce
  receiver_command_id: 605

Logs:

Logger: homeassistant.components.binary_sensor
Source: custom_components/predistribuce/binary_sensor.py:104
Integration: Binary sensor ([documentation](https://www.home-assistant.io/integrations/binary_sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+binary_sensor%22))
First occurred: 11:37:08 AM (2 occurrences)
Last logged: 11:37:08 AM

Error adding entities for domain binary_sensor with platform predistribuce
Error while setting up predistribuce platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 807, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 565, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 211, in state
    if (is_on := self.is_on) is None:
  File "/config/custom_components/predistribuce/binary_sensor.py", line 104, in is_on
    time_start = datetime.strptime(t, '%H:%M').time()
  File "/usr/local/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.10/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data ' - 05' does not match format '%H:%M'