enkama / hass-variables

Home Assistant variables component
89 stars 12 forks source link

ValueError for Datetime on restore #79

Closed Snuffy2 closed 1 year ago

Snuffy2 commented 1 year ago
2023-07-09 11:21:04.557 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform variable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 504, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 788, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1006, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 742, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 531, in state
raise ValueError(
ValueError: Invalid datetime: sensor.last_time_ha_was_up provides state '2023-07-09 00:00:00', which is missing timezone information