Skip to content

OverflowError: date value out of range #12

@bpennypacker

Description

@bpennypacker

I just tried setting this up but it didn't seem to be doing anything. I found the debug log option and tried that. The logs are showing the below exception. Any thoughts on how to resolve this?

2026-03-11 14:09:19.507 ERROR (MainThread) [homeassistant.components.datetime] Error adding entity datetime.solarcharger_mqtt_tesla_ble_5yjygdee7mf190560_next_charge_time for domain datetime with platform solarcharger
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 680, in _async_add_entities
    await self._async_add_entity(
        entity, False, entity_registry, config_subentry_id
    )
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 998, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1393, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/solarcharger/datetime.py", line 62, in async_added_to_hass
    datetime.fromisoformat(last_state.state).astimezone(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        ZoneInfo(self.hass.config.time_zone)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
OverflowError: date value out of range
2026-03-11 14:09:22.533 WARNING (MainThread) [custom_components.solarcharger.utils] mqtt_tesla_ble_5yjygdee7mf190560: Saved callback: callback_ha_stop
2026-03-11 14:09:22.534 WARNING (MainThread) [custom_components.solarcharger.utils] mqtt_tesla_ble_5yjygdee7mf190560: Saved callback: callback_next_charge_time_update
2026-03-11 14:09:22.535 WARNING (MainThread) [custom_components.solarcharger.utils] mqtt_tesla_ble_5yjygdee7mf190560: Saved callback: callback_sun_elevation_update
2026-03-11 14:09:22.535 ERROR (MainThread) [custom_components.solarcharger.chargers.controller] mqtt_tesla_ble_5yjygdee7mf190560: Charger already stopped
2026-03-11 14:11:23.540 DEBUG (MainThread) [custom_components.solarcharger.coordinator] SolarChargerCoordinator _async_execute_update_cycle is running in event loop thread: True
2026-03-11 14:11:23.540 DEBUG (MainThread) [custom_components.solarcharger.sc_state] SolarChargerCoordinator: 'sensor.net_power' = '6'
2026-03-11 14:11:23.541 DEBUG (MainThread) [custom_components.solarcharger.coordinator] No running charger for net power allocation. Try again next cycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions