-
-
Notifications
You must be signed in to change notification settings - Fork 105
Description
Describe the bug
When the OCPP charger is charging and I switch off the switch.charger_charge_control it does not stop charging and throws an error.
To Reproduce
Steps to reproduce the behavior:
Set the switch.charger_charge_control from on to off for Sigen EVDC charger
Expected behavior
Charging to stop
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Error log
2025-11-13 09:20:30.359 INFO (MainThread) [ocpp] 110A42BL0102: receive message [2,"4688","StopTransaction",{"meterStop":250390,"timestamp":"2025-11-10T10:23:58Z","transactionId":1762770182,"idTag":"X16WG99J2QIEGCC0MCJ5-"}]
2025-11-13 09:20:30.360 ERROR (MainThread) [ocpp] Error while handling request '<Call - unique_id=4688, action=StopTransaction, payload={'meterStop': 250390, 'timestamp': '2025-11-10T10:23:58Z', 'transactionId': 1762770182, 'idTag': 'X16WG99J2QIEGCC0MCJ5-'}>'
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/ocpp/messages.py", line 240, in _validate_payload
validator.validate(message.payload)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/jsonschema/validators.py", line 451, in validate
raise error
jsonschema.exceptions.ValidationError: 'X16WG99J2QIEGCC0MCJ5-' is too long
Failed validating 'maxLength' in schema['properties']['idTag']:
{'type': 'string', 'maxLength': 20}
On instance['idTag']:
'X16WG99J2QIEGCC0MCJ5-'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/ocpp/charge_point.py", line 272, in route_message
await self._handle_call(msg)
File "/config/custom_components/ocpp/chargepoint.py", line 532, in _handle_call
await super()._handle_call(msg)
File "/usr/local/lib/python3.13/site-packages/ocpp/charge_point.py", line 300, in _handle_call
await validate_payload(msg, self._ocpp_version)
File "/usr/local/lib/python3.13/site-packages/ocpp/messages.py", line 179, in validate_payload
await asyncio.get_event_loop().run_in_executor(
None, _validate_payload, message, ocpp_version
)
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.13/site-packages/ocpp/messages.py", line 254, in _validate_payload
raise TypeConstraintViolationError(
details={"cause": e.message, "ocpp_message": message}
) from e
ocpp.exceptions.TypeConstraintViolationError: TypeConstraintViolationError: Payload for Action is syntactically correct but at least one of the fields violates data type constraints (e.g. “somestring”: 12), {'cause': "'X16WG99J2QIEGCC0MCJ5-' is too long", 'ocpp_message': <Call - unique_id=4688, action=StopTransaction, payload={'meterStop': 250390, 'timestamp': '2025-11-10T10:23:58Z', 'transactionId': 1762770182, 'idTag': 'X16WG99J2QIEGCC0MCJ5-'}>}
2025-11-13 09:20:30.365 INFO (MainThread) [ocpp] 110A42BL0102: send [4,"4688","TypeConstraintViolation","Payload for Action is syntactically correct but at least one of the fields violates data type constraints (e.g. \u201csomestring\u201d: 12)",{"cause":"'X16WG99J2QIEGCC0MCJ5-' is too long","ocpp_message":"[2,"4688","StopTransaction",{"meterStop":250390,"timestamp":"2025-11-10T10:23:58Z","transactionId":1762770182,"idTag":"X16WG99J2QIEGCC0MCJ5-"}]"}]