lbbrhzn / ocpp

Home Assistant integration for electric vehicle chargers that support the Open Charge Point Protocol (OCPP).
MIT License
224 stars 70 forks source link

ZJ BENY - changing current gives invalid JSON error #1078

Closed ToastySefac closed 4 months ago

ToastySefac commented 8 months ago

Version of the custom_component

OCPP: v0.5.1 ZJ BENY: v1.0.31 BCP-A2N-L

Describe the bug

When I change the charging current it starts giving errors and the device goes offline for about 25 seconds before coming back online, then repeating.

I can see in the logs that it is reporting that the message is not valid JSON and ChatGPT suggests the issue is the leading comma before the first object in the 'sampledValue' array. Would that be causing the unit to become unresponsive. If so, does this mean there is an issue with the firmware, or is there a possible work around to get the unit stable?

Debug log


2024-02-06 19:06:21.580 INFO (MainThread) [ocpp] charger: send [2,"f2b57d3b-1d2d-47ec-ab9d-d3778b0fc8e7","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:06:21.977 INFO (MainThread) [ocpp] charger: receive message [3,"f2b57d3b-1d2d-47ec-ab9d-d3778b0fc8e7",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]
2024-02-06 19:06:21.978 INFO (MainThread) [ocpp] charger: send [2,"0e75fc9a-1906-4d7a-a1cf-00a1d47bcecf","GetConfiguration",{"key":["ChargeProfileMaxStackLevel"]}]
2024-02-06 19:06:22.084 INFO (MainThread) [ocpp] charger: receive message [3,"0e75fc9a-1906-4d7a-a1cf-00a1d47bcecf",{"configurationKey":[{"key":"ChargeProfileMaxStackLevel","readonly":true,"value":"10"}]}]
2024-02-06 19:06:22.090 INFO (MainThread) [ocpp] charger: send [2,"768714ab-5d43-4da1-96d2-4e9ada87eaa6","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":10,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":19.0}]}}}]
2024-02-06 19:06:22.235 INFO (MainThread) [ocpp] charger: receive message [3,"768714ab-5d43-4da1-96d2-4e9ada87eaa6",{"status":"Accepted"}]
2024-02-06 19:06:33.831 INFO (MainThread) [ocpp] charger: send [2,"9ccb5185-bc1a-4329-8c26-41caa55f457e","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:07:03.834 INFO (MainThread) [ocpp] charger: send [2,"9315d242-e8ee-49a9-87bd-9d957bcd6e86","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:07:03.835 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140343519912896] Waited 30s for response on [2,"9ccb5185-bc1a-4329-8c26-41caa55f457e","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}].
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 500, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/queues.py", line 158, in get
    await getter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 327, in call
    response = await self._get_specific_response(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 893, in _get_specific_response
    resp = await super()._get_specific_response(unique_id, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 361, in _get_specific_response
    response = await asyncio.wait_for(self._response_queue.get(), timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 502, in wait_for
    raise exceptions.TimeoutError() from exc
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 111, in async_set_value
    await entity.async_set_native_value(native_value)
  File "/config/custom_components/ocpp/number.py", line 129, in async_set_native_value
    resp = await self.central_system.set_max_charge_rate_amps(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 289, in set_max_charge_rate_amps
    return await self.charge_points[cp_id].set_charge_rate(limit_amps=value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 605, in set_charge_rate
    resp = await self.get_configuration(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 828, in get_configuration
    resp = await self.call(req)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 331, in call
    raise asyncio.TimeoutError(
TimeoutError: Waited 30s for response on [2,"9ccb5185-bc1a-4329-8c26-41caa55f457e","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}].
2024-02-06 19:07:04.168 INFO (MainThread) [ocpp] charger: receive message [3,"9315d242-e8ee-49a9-87bd-9d957bcd6e86",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]
2024-02-06 19:07:04.169 INFO (MainThread) [ocpp] charger: send [2,"5680766b-54f2-45c2-9f9e-c621d7fc7bc1","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:07:04.277 INFO (MainThread) [ocpp] charger: receive message [3,"5680766b-54f2-45c2-9f9e-c621d7fc7bc1",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]
2024-02-06 19:07:04.278 INFO (MainThread) [ocpp] charger: send [2,"29bfe3b5-dc38-410c-9346-7dbe8e12f909","GetConfiguration",{"key":["ChargeProfileMaxStackLevel"]}]
2024-02-06 19:07:04.398 INFO (MainThread) [ocpp] charger: receive message [3,"29bfe3b5-dc38-410c-9346-7dbe8e12f909",{"configurationKey":[{"key":"ChargeProfileMaxStackLevel","readonly":true,"value":"10"}]}]
2024-02-06 19:07:04.400 INFO (MainThread) [ocpp] charger: send [2,"01d17eac-8ec3-478d-bd1c-9fa2422c3769","GetConfiguration",{"key":["ChargeProfileMaxStackLevel"]}]
2024-02-06 19:07:04.499 INFO (MainThread) [ocpp] charger: receive message [3,"01d17eac-8ec3-478d-bd1c-9fa2422c3769",{"configurationKey":[{"key":"ChargeProfileMaxStackLevel","readonly":true,"value":"10"}]}]
2024-02-06 19:07:04.501 INFO (MainThread) [ocpp] charger: send [2,"5f9dd208-f771-4cfa-887a-682c18ecea15","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":10,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":25.0}]}}}]
2024-02-06 19:07:04.751 INFO (MainThread) [ocpp] charger: receive message [3,"5f9dd208-f771-4cfa-887a-682c18ecea15",{"status":"Accepted"}]
2024-02-06 19:07:04.752 INFO (MainThread) [ocpp] charger: send [2,"a876aa5a-5cd7-4246-ae0f-3c3d7ad49305","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":10,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":13.0}]}}}]
2024-02-06 19:07:05.091 INFO (MainThread) [ocpp] charger: receive message [3,"a876aa5a-5cd7-4246-ae0f-3c3d7ad49305",{"status":"Accepted"}]
2024-02-06 19:07:25.122 INFO (MainThread) [ocpp] charger: send [2,"aaccc5b5-1f1f-428b-914d-5b78b54b09cb","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:07:25.459 INFO (MainThread) [ocpp] charger: receive message [3,"aaccc5b5-1f1f-428b-914d-5b78b54b09cb",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]
2024-02-06 19:07:25.461 INFO (MainThread) [ocpp] charger: send [2,"d7c1959c-aed7-41dd-bd22-e60eaa4c10a7","GetConfiguration",{"key":["ChargeProfileMaxStackLevel"]}]
2024-02-06 19:07:25.595 INFO (MainThread) [ocpp] charger: receive message [3,"d7c1959c-aed7-41dd-bd22-e60eaa4c10a7",{"configurationKey":[{"key":"ChargeProfileMaxStackLevel","readonly":true,"value":"10"}]}]
2024-02-06 19:07:25.596 INFO (MainThread) [ocpp] charger: send [2,"ceab6279-3351-4bee-b9ad-07079e5e3f93","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":10,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":32.0}]}}}]
2024-02-06 19:07:25.744 INFO (MainThread) [ocpp] charger: receive message [3,"ceab6279-3351-4bee-b9ad-07079e5e3f93",{"status":"Accepted"}]
2024-02-06 19:07:54.535 DEBUG (MainThread) [custom_components.ocpp] Connection latency from 'central' to 'charger': ping=0.0 ms, pong=388.0 ms
2024-02-06 19:07:57.251 INFO (MainThread) [ocpp] charger: send [2,"42c54a18-42aa-4aa5-baeb-38a53f084b04","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:07:57.411 INFO (MainThread) [ocpp] charger: receive message [3,"42c54a18-42aa-4aa5-baeb-38a53f084b04",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]
2024-02-06 19:07:57.412 DEBUG (MainThread) [custom_components.ocpp] Get Configuration for ChargingScheduleAllowedChargingRateUnit: Current,Power
2024-02-06 19:07:57.412 INFO (MainThread) [custom_components.ocpp] Charger supports setting the following units: Current,Power
2024-02-06 19:07:57.412 INFO (MainThread) [custom_components.ocpp] If more than one unit supported default unit is Amps
2024-02-06 19:07:57.413 INFO (MainThread) [ocpp] charger: send [2,"6377e2ce-78a6-49bd-ab8e-28f2b00fa7ed","GetConfiguration",{"key":["ChargeProfileMaxStackLevel"]}]
2024-02-06 19:07:57.544 INFO (MainThread) [ocpp] charger: receive message [3,"6377e2ce-78a6-49bd-ab8e-28f2b00fa7ed",{"configurationKey":[{"key":"ChargeProfileMaxStackLevel","readonly":true,"value":"10"}]}]
2024-02-06 19:07:57.546 DEBUG (MainThread) [custom_components.ocpp] Get Configuration for ChargeProfileMaxStackLevel: 10
2024-02-06 19:07:57.547 INFO (MainThread) [ocpp] charger: send [2,"93034109-3401-4fa0-a489-788a9641b987","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":10,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":14.0}]}}}]
2024-02-06 19:07:57.694 INFO (MainThread) [ocpp] charger: receive message [3,"93034109-3401-4fa0-a489-788a9641b987",{"status":"Accepted"}]
2024-02-06 19:08:06.627 INFO (MainThread) [ocpp] charger: send [2,"6ecd5bbb-0b49-4936-a324-001a3c95676e","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:08:06.833 INFO (MainThread) [ocpp] charger: receive message [3,"6ecd5bbb-0b49-4936-a324-001a3c95676e",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]
2024-02-06 19:08:06.834 DEBUG (MainThread) [custom_components.ocpp] Get Configuration for ChargingScheduleAllowedChargingRateUnit: Current,Power
2024-02-06 19:08:06.834 INFO (MainThread) [custom_components.ocpp] Charger supports setting the following units: Current,Power
2024-02-06 19:08:06.834 INFO (MainThread) [custom_components.ocpp] If more than one unit supported default unit is Amps
2024-02-06 19:08:06.835 INFO (MainThread) [ocpp] charger: send [2,"48e78bba-ebec-4c72-b4f3-b3bb55a9b404","GetConfiguration",{"key":["ChargeProfileMaxStackLevel"]}]
2024-02-06 19:08:06.967 INFO (MainThread) [ocpp] charger: receive message [3,"48e78bba-ebec-4c72-b4f3-b3bb55a9b404",{"configurationKey":[{"key":"ChargeProfileMaxStackLevel","readonly":true,"value":"10"}]}]
2024-02-06 19:08:06.968 DEBUG (MainThread) [custom_components.ocpp] Get Configuration for ChargeProfileMaxStackLevel: 10
2024-02-06 19:08:06.969 INFO (MainThread) [ocpp] charger: send [2,"257ccf76-9843-47d5-b176-7c5eaa82dd5f","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":10,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":32.0}]}}}]
2024-02-06 19:08:07.118 INFO (MainThread) [ocpp] charger: receive message [3,"257ccf76-9843-47d5-b176-7c5eaa82dd5f",{"status":"Accepted"}]
2024-02-06 19:08:14.700 DEBUG (MainThread) [custom_components.ocpp] Connection latency from 'central' to 'charger': ping=0.0 ms, pong=162.0 ms
2024-02-06 19:08:35.108 DEBUG (MainThread) [custom_components.ocpp] Connection latency from 'central' to 'charger': ping=0.0 ms, pong=407.0 ms
2024-02-06 19:08:55.238 DEBUG (MainThread) [custom_components.ocpp] Connection latency from 'central' to 'charger': ping=0.0 ms, pong=129.0 ms
2024-02-06 19:08:58.223 INFO (MainThread) [ocpp] charger: receive message [2,"3w5c2fuqqfzmnexl3w4g93rq","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Preparing","timestamp":"2024-02-06T08:08:58Z"}]
2024-02-06 19:08:58.224 INFO (MainThread) [ocpp] charger: send [3,"3w5c2fuqqfzmnexl3w4g93rq",{}]
2024-02-06 19:09:03.323 INFO (MainThread) [ocpp] charger: send [2,"cf7ca473-36a1-4c4a-9976-28817badcad1","GetConfiguration",{"key":["AuthorizeRemoteTxRequests"]}]
2024-02-06 19:09:03.463 INFO (MainThread) [ocpp] charger: receive message [3,"cf7ca473-36a1-4c4a-9976-28817badcad1",{"configurationKey":[{"key":"AuthorizeRemoteTxRequests","readonly":false,"value":"false"}]}]
2024-02-06 19:09:03.464 DEBUG (MainThread) [custom_components.ocpp] Get Configuration for AuthorizeRemoteTxRequests: false
2024-02-06 19:09:03.468 INFO (MainThread) [ocpp] charger: send [2,"c785ab85-368c-42af-8203-340830c6e2b8","RemoteStartTransaction",{"idTag":"charger","connectorId":1}]
2024-02-06 19:09:03.567 INFO (MainThread) [ocpp] charger: receive message [3,"c785ab85-368c-42af-8203-340830c6e2b8",{"status":"Accepted"}]
2024-02-06 19:09:03.844 INFO (MainThread) [ocpp] charger: receive message [2,"0kzq33gkhf81p7w76wfd5szx","StartTransaction",{"connectorId":1,"idTag":"charger","meterStart":139954,"timestamp":"2024-02-06T08:09:04Z"}]
2024-02-06 19:09:03.849 DEBUG (MainThread) [custom_components.ocpp] id_tag='charger' not found in auth_list, default authorization_status='Accepted'
2024-02-06 19:09:03.851 INFO (MainThread) [ocpp] charger: send [3,"0kzq33gkhf81p7w76wfd5szx",{"transactionId":1707206943,"idTagInfo":{"status":"Accepted"}}]
2024-02-06 19:09:04.583 INFO (MainThread) [ocpp] charger: receive message [2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:04.583 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:09.593 INFO (MainThread) [ocpp] charger: receive message [2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:09.594 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:14.603 INFO (MainThread) [ocpp] charger: receive message [2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:14.604 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:15.311 DEBUG (MainThread) [custom_components.ocpp] Connection latency from 'central' to 'charger': ping=0.0 ms, pong=72.0 ms
2024-02-06 19:09:19.613 INFO (MainThread) [ocpp] charger: receive message [2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:19.614 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9386nmn4ktjx4znjck54b8k2","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:05Z","sampledValue":[,{"value":"139954","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:30.429 INFO (MainThread) [ocpp] charger: send [2,"706efad7-87ba-4350-a864-6572dd94159b","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:09:33.616 DEBUG (MainThread) [custom_components.ocpp] Connection closed to 'charger': no close frame received or sent
2024-02-06 19:09:33.616 INFO (MainThread) [custom_components.ocpp] Charger charger disconnected from 192.168.1.106:9000.
2024-02-06 19:09:36.361 INFO (MainThread) [custom_components.ocpp] Websocket Subprotocol matched: ocpp1.6
2024-02-06 19:09:36.361 INFO (MainThread) [custom_components.ocpp] Charger websocket path=///charger
2024-02-06 19:09:36.361 INFO (MainThread) [custom_components.ocpp] Charger charger reconnected to 192.168.1.106:9000.
2024-02-06 19:09:36.361 DEBUG (MainThread) [custom_components.ocpp] Reconnect websocket to charger
2024-02-06 19:09:37.153 INFO (MainThread) [ocpp] charger: receive message [2,"t99o4weaxjsy5tl1p5xk2h7b","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Charging","timestamp":"2024-02-06T08:09:05Z"}]
2024-02-06 19:09:37.154 INFO (MainThread) [ocpp] charger: send [3,"t99o4weaxjsy5tl1p5xk2h7b",{}]
2024-02-06 19:09:37.522 INFO (MainThread) [ocpp] charger: receive message [2,"b4r3j7d3r1dlbnvm2zfwpu0s","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2024-02-06T08:09:36Z"}]
2024-02-06 19:09:37.523 INFO (MainThread) [ocpp] charger: send [3,"b4r3j7d3r1dlbnvm2zfwpu0s",{}]
2024-02-06 19:09:37.897 INFO (MainThread) [ocpp] charger: receive message [2,"q6pvnqrzkknby78vpg13y0b9","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Charging","timestamp":"2024-02-06T08:09:36Z"}]
2024-02-06 19:09:37.898 INFO (MainThread) [ocpp] charger: send [3,"q6pvnqrzkknby78vpg13y0b9",{}]
2024-02-06 19:09:38.289 INFO (MainThread) [ocpp] charger: receive message [2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:38.289 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:43.300 INFO (MainThread) [ocpp] charger: receive message [2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:43.301 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:48.312 INFO (MainThread) [ocpp] charger: receive message [2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:48.312 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:53.318 INFO (MainThread) [ocpp] charger: receive message [2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]
2024-02-06 19:09:53.318 ERROR (MainThread) [ocpp] Unable to parse message: '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]', it doesn't seem to be valid OCPP: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 83, in unpack
    msg = json.loads(msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 155 (char 154)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 175, in route_message
    msg = unpack(raw_msg)
          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 85, in unpack
    raise FormatViolationError(
ocpp.exceptions.FormatViolationError: FormatViolationError: Payload for Action is syntactically incorrect or structure for Action, {'cause': 'Message is not valid JSON', 'ocpp_message': '[2,"9lmha8x27fuad8cemfzn5bxr","MeterValues",{"connectorId":1,"transactionId":1707206943,"meterValue":[{"timestamp":"2024-02-06T08:09:37Z","sampledValue":[,{"value":"139955","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","format":"Raw","unit":"Wh"},{"value":"0","measurand":"Power.Active.Import","format":"Raw","unit":"W"}]}]}]'}
2024-02-06 19:09:56.634 DEBUG (MainThread) [custom_components.ocpp] Connection latency from 'central' to 'charger': ping=0.0 ms, pong=271.0 ms
2024-02-06 19:10:00.430 INFO (MainThread) [ocpp] charger: send [2,"acbd2b61-8c20-4ae7-80bf-ff76c1236f57","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
2024-02-06 19:10:00.430 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140343519912896] Waited 30s for response on [2,"706efad7-87ba-4350-a864-6572dd94159b","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}].
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 500, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/queues.py", line 158, in get
    await getter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 327, in call
    response = await self._get_specific_response(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 893, in _get_specific_response
    resp = await super()._get_specific_response(unique_id, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 361, in _get_specific_response
    response = await asyncio.wait_for(self._response_queue.get(), timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 502, in wait_for
    raise exceptions.TimeoutError() from exc
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 111, in async_set_value
    await entity.async_set_native_value(native_value)
  File "/config/custom_components/ocpp/number.py", line 129, in async_set_native_value
    resp = await self.central_system.set_max_charge_rate_amps(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 289, in set_max_charge_rate_amps
    return await self.charge_points[cp_id].set_charge_rate(limit_amps=value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 605, in set_charge_rate
    resp = await self.get_configuration(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 828, in get_configuration
    resp = await self.call(req)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 331, in call
    raise asyncio.TimeoutError(
TimeoutError: Waited 30s for response on [2,"706efad7-87ba-4350-a864-6572dd94159b","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}].
2024-02-06 19:10:05.971 INFO (MainThread) [custom_components.ocpp] Websocket Subprotocol matched: ocpp1.6
2024-02-06 19:10:05.971 INFO (MainThread) [custom_components.ocpp] Charger websocket path=///charger
2024-02-06 19:10:05.971 INFO (MainThread) [custom_components.ocpp] Charger charger reconnected to 192.168.1.106:9000.
2024-02-06 19:10:05.971 DEBUG (MainThread) [custom_components.ocpp] Reconnect websocket to charger
2024-02-06 19:10:05.971 DEBUG (MainThread) [custom_components.ocpp] Closing websocket to 'charger'
2024-02-06 19:10:08.826 INFO (MainThread) [ocpp] charger: receive message [2,"8ihps4pd1460etv1yj2ra5nb","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2024-02-06T08:10:06Z"}]
2024-02-06 19:10:08.827 INFO (MainThread) [ocpp] charger: send [3,"8ihps4pd1460etv1yj2ra5nb",{}]
2024-02-06 19:10:08.828 DEBUG (MainThread) [custom_components.ocpp] Closing websocket to 'charger'
2024-02-06 19:10:09.197 INFO (MainThread) [ocpp] charger: receive message [2,"zfx0uomszb7rw369wbkz7zoc","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Charging","timestamp":"2024-02-06T08:10:06Z"}]
2024-02-06 19:10:09.198 INFO (MainThread) [ocpp] charger: send [3,"zfx0uomszb7rw369wbkz7zoc",{}]
2024-02-06 19:10:19.072 DEBUG (MainThread) [custom_components.ocpp] Connection closed to 'charger': sent 1000 (OK); no close frame received
2024-02-06 19:10:19.073 INFO (MainThread) [custom_components.ocpp] Charger charger disconnected from 192.168.1.106:9000.
Conradical314 commented 8 months ago

I finally got my ZJ Beny connected to OCPP today. I get this issue as well. BCP-AT2N-L firmware 1.0.31. Though I am stoked to be able to use the on/off via HA instead of the tedious Bluetooth control!

PeterBorfai commented 8 months ago

I appear to have the same issue. During charging, the charger becomes unavailable for 25 seconds or so. Then recovers after 40 seconds. This cycle repeats throughout the charging session.

BCP-AT2N-P by Benyi Firmware: 1.0.31

ToastySefac commented 8 months ago

On the Charge HQ site, it mentions a similar issue: https://chargehq.net/kb/zj-beny-ev-charger-configuration#:~:text=There%20is%20a%20known%20issue,caused%20by%20the%20charger%20itself.

There is a known issue where ZJ Beny chargers will frequently disconnect and reconnect to Charge HQ. This can happen tens or even hundreds of times per day. You may see a "charger offline" error message in Charge HQ which appears and disappears frequently.

This issue is caused by the charger itself. It doesn't generally lead to any problems, as the charger should reconnect quickly each time.

We are hoping that this issue will be resolved by a firmware update from ZJ Beny.

Although, when I've used Charge HQ, it seems to work fine. Maybe they have worked around any bug... Have either of you had any success in Charge HQ?

Conradical314 commented 8 months ago

Thanks for covering the Charge HQ side, I'd been wondering about that. I assumed similar to above - that Charge HQ users must get the same issue, but that they must have worked around the bad data in their OCPP implementation.

I got in touch with the company that sold me the ZJ Beny, Ultipower in Australia. I wasn't expecting much but they've got in contact with ZJ Beny and at least by appearances we're getting engagement.

A few days ago I tried to dig into the error and the code to see how one might workaround the charger bug when using this HA project. Other issue threads has people mentioning that it's possible, I think I saw for the Grizzl-E. But I couldn't figure out how to edit (permanently or in a nice way) the messages.py in the underlying OCPP Python project that this HA project uses. I'd appreciate any tips, though I suspect any workaround like that could be truly nasty. Best to get ZJ Beny to fix. How long that will take, who knows.

I got this response from ZJ Beny:

I have sent your information to our engineer this morning.

But he want to get below informations of Home Assistant, so that we can solve this issue.

1) URL address:
2) WEB or APP Account:
3) Pile Number: 

So could you please provide your account of Home Assistant for our reference? 

I think they're asking to access my server >.<. Which is not something I'll be doing as I haven't setup any remote access yet. I honestly don't know how to respond and assist them just yet. If anyone can safely provide them their server I can connect you.

PeterBorfai commented 8 months ago

I just connected my Benyi to ChargeHQ. Connection State = Online. Status = Charging. Looks stable over several minutes. Chargehq says they've tested Benyi firmware 1.0.14 and 1.0.23. But my 1.0.31 works ok.

CP-AT2N-P by Benyi Firmware: 1.0.31

ToastySefac commented 8 months ago

I think they're asking to access my server >.<. Which is not something I'll be doing as I haven't setup any remote access yet. I honestly don't know how to respond and assist them just yet. If anyone can safely provide them their server I can connect you.

I bought from Ultipower as well. Their contact at ZJ Beny has sent me a similar request.

I've setup a sandboxed home assistant install with the charger connected and sent them the details to access it. So, hopefully that helps them work out the problem.

ToastySefac commented 7 months ago

Here's the response I got back from ZJ Beny after I followed them up. Pretty disappointing.

Sorry for the late reply, due to the customer visited us last week.

Our engineer have login and test the Home Assistant. This program is a free charge software, and will be often offline after connected. Their Open Source Server has the problem, will not respone the message from EV Charger.

It is better to use our EV-BOX (EVB) App, free charge to use, more stable than Home Assistant.

Please note and feel free to let me know if any question, thank you.

Anyone got any suggestions on what to reply with? I'm not technical enough to work out if the "Message is not valid JSON" is the root cause, and the supplier's limited answer in the email doesn't really help.

Conradical314 commented 7 months ago

wow that's quite disappointing. They should do better, and present a much better argument than "HA is free open source therefore it's bad".

How to reply and continue.... hmm. So it's not that I think that the JSON error is an absolute smoking gun. We can acknowledge the ambiguity coming from an interface between the ZJ Beny and a server.

I'll email them in my own thread as well, but I think the pressure to apply is in OCPP capability and compliance. While we cannot assess compliance with our level of knowledge, we an argue that their charger is not demonstrating OCPP capability. Their suggestion to use their App does not address the fact their charger is sold as OCPP capable.

Home Assistant is showing offline because ZJ Beny is dumping what seems to be invalid input messages. The engineer on the ZJ Beny side is possibly having an even worse time of it on a remote connection.

Body of what I sent to Ultipower + ZJ Beny rep:

The engineer has said that the issue is with the Home Assistant software, due to it often failing to respond to the message.I suggest that this is an incorrect conclusion - in that with the evidence we have, the ZJ Beny is sending an incorrect message to the OCPP service. The suggestion to use the ZJ Beny app does not address many elements of the functionality we as users are looking for. At a high level, using the app does not meet OCPP, which this ZJ Beny charger is sold as capable of. So focussing on the ZJ Beny's OCPP compliance, can the engineer do further troubleshooting and justification of why the Charger is transmitting the message that is invalid? The Home Assistant software which the engineer says has the problem is used by many users with other brand chargers via OCPP.

ToastySefac commented 7 months ago

I've sent a similar response.

ToastySefac commented 7 months ago

I got another message back from ZJ BENY and they have released a beta firmware update 1.0.33.

I updated my unit and it's now working properly with Home Assistant! Might need some time to check that there are no errors, but I tried a few different settings and current levels and it responded as expected.

Here's their email with the right firmware link for BCP-A2N-L OCPP.

Thank you for the information, helpful for us and we have found the problem.

Please upgrade the firmware as per the instruction as attached.

Your charger model number is BCP-A2N-L OCPP, so please select first URL address for updating. Household EV charger, Signel phase with cable http://106.15.78.131/V_DEBUG/BCP-A2N-P_SW1_0_33_HW1_DEBUG.bin

It is Beta Version, we will launch a official version around May.

PeterBorfai commented 7 months ago

Thank you for the update. The new version 1.0.33 BETA appears to work correctly on my BCP-AT2N-P! I will monitor it and report back any issues. Thanks again!

Conradical314 commented 7 months ago

Yeah outstanding, I was surprised by the same reply this morning. I only had time for a quick look in the docs for how to update the firmware over OCPP. I know I've seen it talked about in other threads but couldn't find any documentation. Sorry if I've missed something obvious, would one of you mind pointing me at the right process to update via OCPP? Or just the best way to update? Hopefully without factory resetting to use the Bluetooth connection

ToastySefac commented 7 months ago

I changed the server over to use my Charge hq account. In there you can tap on your charger and update the firmware. Just need to paste in the url from the post above

Just make sure you can reach the firmware server first with your computer. For some reason my router was blocking it.

PeterBorfai commented 7 months ago

To update the firmware: Check the list of available files at http://106.15.78.131 The new BETA firmware is in the V_DEBUG folder. In Home Assistant, go to Developer Tools / Services Scroll through the list of Services to "Open Charge Point Protocol (OCPP): Update charger firmware" Go to YAML mode and modify the example provided to match your URL for your model. My YAML looked like this:

service: ocpp.update_firmware data: firmware_url: http://106.15.78.131/V_DEBUG/BCP-AT2N-P_SW1_0_33_HW1_DEBUG.bin delay_hours: 0

Then press "Call Service" I got timestamped notifications to show:

Ocpp integration Firmware upload status: Downloading

Ocpp integration Firmware upload status: Downloaded

Ocpp integration Firmware upload status: Installing

Ocpp integration Firmware upload status: Installed

It worked first time!

GuzziDoug commented 6 months ago

I have been running the OCPP version of the ZJBeny charger for about 18 months. The only issue I have is that after a firmware update, one needs to perform a ´Clear Profile' otherwise one cannot change the current. On the ver 31 update, I also needed to power cycle the charger. Personally, I think it is a well priced Charger (also sourced from Ultipower). Currently running Ver 32 firmware.

Conradical314 commented 6 months ago

Thanks PeterBofai for the details of firmware update. And @GuzziDoug for mentioning the current change issue. If you might be able to continue to help, I seem to have that issue, however I can't Clear Profile. I've tried power cycling the charger (turn break off and on)

Y_CHARGER: send [2,"[key]","ClearChargingProfile",{}]
Y_CHARGER: receive message [3,"[key]",{"status":"Unknown"}]
WARNING (MainThread) [custom_components.ocpp] Failed with response: Unknown

Calling the Clear Profile Service from Home Assistant. I looked at the YAML but I can't figure out what data {} I might want to put in from a crude dig of the code https://github.com/mobilityhouse/ocpp/blob/d96d243c8fb3e042f6837aa4ccecda5356598064/ocpp/v201/call.py#L47

GuzziDoug commented 6 months ago

fyi, I had trouble with the Clear Profile. But after I power cycled the charger, I found initially it ran full tilt (ie max rate), but if I moved the current setting on the Overview page, the current changed to the setting. So, the secret may be to try changing the current on the overview page,

regards, Doug

On Sat, 20 Apr 2024 21:37:42 -0700 Conradical314 @.***> wrote:

Thanks PeterBofai for the details of firmware update. And @GuzziDoug for mentioning the current change issue. If you might be able to continue to help, I seem to have that issue, however I can't Clear Profile. I've tried power cycling the charger (turn break off and on)

Y_CHARGER: send [2,"c54169c6-42fa-46fd-891f-177dbe3c0d3a","ClearChargingProfile",{}]
Y_CHARGER: receive message [3,"c54169c6-42fa-46fd-891f-177dbe3c0d3a",{"status":"Unknown"}]
WARNING (MainThread) [custom_components.ocpp] Failed with response: Unknown

Calling the Clear Profile Service from Home Assistant. I looked at the YAML but I can't figure out what data {} I might want to put in from a crude dig of the code https://github.com/mobilityhouse/ocpp/blob/d96d243c8fb3e042f6837aa4ccecda5356598064/ocpp/v201/call.py#L47

-- Reply to this email directly or view it on GitHub: https://github.com/lbbrhzn/ocpp/issues/1078#issuecomment-2067901405 You are receiving this because you were mentioned.

Message ID: @.***>

github-actions[bot] commented 4 months ago

Stale issue message