When no charging session is active, the ChargePoint API returns an empty dict {} for the charging status payload. This causes a Pydantic validation error because start_time and last_update_data_timestamp are required fields with no defaults in _ChargingStatusData.
Error:
2 validation errors for _ChargingStatusData
start_time
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
last_update_data_timestamp
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
Specific error code
Failed setup, will retry: 2 validation errors for _ChargingStatusData start_time Field required [type=missing, input_value={}, input_type=dict] For further information visit
https://errors.pydantic.dev/2.12/v/missing last_update_data_timestamp Field required [type=missing, input_value={}, input_type=dict] For further information visit
https://errors.pydantic.dev/2.12/v/missing - cintinue with T/S
Environment:
- Home Assistant: 2026.4.3 (Container installation)
- Python: 3.14
- ha-chargepoint: Tested on both v1.3.1 and v1.4.0-beta.1 - same error on both
- python-chargepoint: (see pip show python-chargepoint)
- Pydantic: 2.12+
- Hardware: ChargePoint CPH50-NEMA14-50-L23, firmware 5.5.4.22
Steps to reproduce:
- Install ChargePoint integration via HACS
- Configure with valid ChargePoint account credentials
- Have charger in idle state - cable plugged in but not actively charging (status: "Available")
- Integration fails to set up with the above Pydantic validation error
- HA retries setup indefinitely, never succeeds
Notes:
- The issue is not in the ha-chargepoint integration itself but in the upstream python-chargepoint library, specifically python_chargepoint/session.py
- Observed on both ha-chargepoint v1.3.1 (stable) and v1.4.0-beta.1 - the bug is in the shared dependency
- The integration works fine when a charging session is active (API returns populated fields)
- All other fields in _ChargingStatusData have sensible defaults - only these two datetime fields are required
Workaround:
In python_chargepoint/session.py, make the two fields optional:
Before:
start_time: datetime
last_update_data_timestamp: datetime
After:
start_time: Optional[datetime] = None
last_update_data_timestamp: Optional[datetime] = None
And update the validator to handle None:
@field_validator("start_time", "last_update_data_timestamp", mode="before")
@classmethod
def parse_ms_timestamp(cls, v: Optional[float]) -> Optional[datetime]:
if v is None:
return None
return datetime.fromtimestamp(v / 1000, tz=timezone.utc)
When no charging session is active, the ChargePoint API returns an empty dict {} for the charging status payload. This causes a Pydantic validation error because start_time and last_update_data_timestamp are required fields with no defaults in _ChargingStatusData.
Error:
2 validation errors for _ChargingStatusData
start_time
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
last_update_data_timestamp
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
Specific error code
Environment:
Steps to reproduce:
Notes:
Workaround:
In python_chargepoint/session.py, make the two fields optional:
Before:
start_time: datetime
last_update_data_timestamp: datetime
After:
start_time: Optional[datetime] = None
last_update_data_timestamp: Optional[datetime] = None
And update the validator to handle None: