EVEC VEC01 - can't start charging
I've successfully managed to connect my charger, an EVEC VEC01 (which is using OCPP 1.6J), using v0.5.1 of the custom component, and various diagnostic values are shown correctly in the entities. Various entities also change correctly if I turn the charger on manually, and the charge control toggle shows as being turned on. The charger is connected via ethernet (it doesn't support OCPP over Wi-Fi). If I turn the charger on manually, and off using home assistant, no error is shown.
However if I toggle the charge control in Home Assistant when the charger is off, the control reverts to the off position, and I get the error
'list index out of range'
The error details are as follows:
Logger: custom_components.ocpp
Source: custom_components/ocpp/api.py:961
integration: Open Charge Point Protocol (OCPP) ([documentation](https://github.com/lbbrhzn/ocpp/blob/main/README.md), [issues](https://github.com/lbbrhzn/ocpp/issues))
First occurred: 22:53:14 (630 occurrences)
Last logged: 23:25:23
Unexpected exception in connection to '': 'list index out of range'
Traceback (most recent call last):
File "/config/custom_components/ocpp/api.py", line 961, in run
await asyncio.gather(*self.tasks)
File "/config/custom_components/ocpp/api.py", line 432, in post_connect
resp = await self.get_configuration(ckey.number_of_connectors.value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ocpp/api.py", line 830, in get_configuration
value = resp.configuration_key[0][om.value.value]
~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Further logs:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 22:55:10 (6 occurrences)
Last logged: 23:51:07
[546945187648] list index out of range
[546913669184] list index out of range
[546939491648] list index out of range
[546939006144] list index out of range
[546866619328] list index out of range
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/ocpp/switch.py", line 125, in async_turn_on
self._state = await self.central_system.set_charger_state(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ocpp/api.py", line 301, in set_charger_state
resp = await self.charge_points[cp_id].start_transaction()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ocpp/api.py", line 698, in start_transaction
resp = await self.get_configuration(ckey.authorize_remote_tx_requests.value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ocpp/api.py", line 830, in get_configuration
value = resp.configuration_key[0][om.value.value]
~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
can you add a log of the OCPP messages between charger and server?
Sure thing. I turned on debug logging for the websockets server see below. This is just 9 seconds, but it does this constantly. If I leave it on for very long then the log gets so big it won't render in the web browser any more.
I triggered the charge control at 19:29:44, just before the final message included here.
2024-03-25 19:29:41.722 DEBUG (MainThread) [websockets.server] = connection is OPEN
2024-03-25 19:29:43.728 DEBUG (MainThread) [websockets.server] > TEXT '[2,"01a4b8b1-86ed-4f50-9d04-36fd63b6c213","GetC...rtedFeatureProfiles"]}]' [98 bytes]
2024-03-25 19:29:43.960 DEBUG (MainThread) [websockets.server] < TEXT '[3,"01a4b8b1-86ed-4f50-9d04-36fd63b6c213",{"con...ing, RemoteTrigger"}]}]' [206 bytes]
2024-03-25 19:29:43.964 DEBUG (MainThread) [websockets.server] > TEXT '[2,"f0d1bf8d-dee7-42dd-bcab-02af59789b46","GetC..."NumberOfConnectors"]}]' [92 bytes]
2024-03-25 19:29:44.426 DEBUG (MainThread) [websockets.server] < TEXT '[3,"f0d1bf8d-dee7-42dd-bcab-02af59789b46",{"configurationKey":[]}]' [66 bytes]
2024-03-25 19:29:44.438 DEBUG (MainThread) [websockets.server] = connection is CLOSING
2024-03-25 19:29:44.439 DEBUG (MainThread) [websockets.server] > CLOSE 1000 (OK) [2 bytes]
2024-03-25 19:29:44.617 DEBUG (MainThread) [websockets.server] ! failing connection with code 1006
2024-03-25 19:29:44.618 DEBUG (MainThread) [websockets.server] = connection is CLOSED
2024-03-25 19:29:44.620 DEBUG (MainThread) [websockets.server] x half-closing TCP connection
2024-03-25 19:29:44.621 INFO (MainThread) [websockets.server] connection closed
2024-03-25 19:29:44.735 DEBUG (MainThread) [websockets.server] = connection is CONNECTING
2024-03-25 19:29:44.739 DEBUG (MainThread) [websockets.server] < GET / HTTP/1.1
2024-03-25 19:29:44.740 DEBUG (MainThread) [websockets.server] < Upgrade: websocket
2024-03-25 19:29:44.740 DEBUG (MainThread) [websockets.server] < Host: 10.0.1.62
2024-03-25 19:29:44.740 DEBUG (MainThread) [websockets.server] < Connection: Upgrade
2024-03-25 19:29:44.741 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:44.741 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Version: 13
2024-03-25 19:29:44.741 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Key: JATeGott6Se1fYM67pryfg==
2024-03-25 19:29:44.742 DEBUG (MainThread) [websockets.server] > HTTP/1.1 101 Switching Protocols
2024-03-25 19:29:44.743 DEBUG (MainThread) [websockets.server] > Upgrade: websocket
2024-03-25 19:29:44.743 DEBUG (MainThread) [websockets.server] > Connection: Upgrade
2024-03-25 19:29:44.743 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Accept: r+OeyfD+dePRJm87SwhoaeIkAVE=
2024-03-25 19:29:44.743 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:44.744 DEBUG (MainThread) [websockets.server] > Date: Mon, 25 Mar 2024 19:29:44 GMT
2024-03-25 19:29:44.744 DEBUG (MainThread) [websockets.server] > Server: Python/3.12 websockets/11.0.3
2024-03-25 19:29:44.746 INFO (MainThread) [websockets.server] connection open
2024-03-25 19:29:44.746 DEBUG (MainThread) [websockets.server] = connection is OPEN
2024-03-25 19:29:46.751 DEBUG (MainThread) [websockets.server] > TEXT '[2,"e66d0719-bba6-4543-a62d-5df95d27c39a","GetC...rtedFeatureProfiles"]}]' [98 bytes]
2024-03-25 19:29:46.980 DEBUG (MainThread) [websockets.server] < TEXT '[3,"e66d0719-bba6-4543-a62d-5df95d27c39a",{"con...ing, RemoteTrigger"}]}]' [206 bytes]
2024-03-25 19:29:46.983 DEBUG (MainThread) [websockets.server] > TEXT '[2,"7c2936eb-b00a-4643-9987-0871a0548131","GetC..."NumberOfConnectors"]}]' [92 bytes]
2024-03-25 19:29:47.448 DEBUG (MainThread) [websockets.server] < TEXT '[3,"7c2936eb-b00a-4643-9987-0871a0548131",{"configurationKey":[]}]' [66 bytes]
2024-03-25 19:29:47.462 DEBUG (MainThread) [websockets.server] = connection is CLOSING
2024-03-25 19:29:47.462 DEBUG (MainThread) [websockets.server] > CLOSE 1000 (OK) [2 bytes]
2024-03-25 19:29:47.643 DEBUG (MainThread) [websockets.server] ! failing connection with code 1006
2024-03-25 19:29:47.643 DEBUG (MainThread) [websockets.server] = connection is CLOSED
2024-03-25 19:29:47.646 DEBUG (MainThread) [websockets.server] x half-closing TCP connection
2024-03-25 19:29:47.647 INFO (MainThread) [websockets.server] connection closed
2024-03-25 19:29:47.760 DEBUG (MainThread) [websockets.server] = connection is CONNECTING
2024-03-25 19:29:47.764 DEBUG (MainThread) [websockets.server] < GET / HTTP/1.1
2024-03-25 19:29:47.765 DEBUG (MainThread) [websockets.server] < Upgrade: websocket
2024-03-25 19:29:47.765 DEBUG (MainThread) [websockets.server] < Host: 10.0.1.62
2024-03-25 19:29:47.765 DEBUG (MainThread) [websockets.server] < Connection: Upgrade
2024-03-25 19:29:47.766 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:47.766 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Version: 13
2024-03-25 19:29:47.766 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Key: RHdH1FU67X4Im+NY2nUD1Q==
2024-03-25 19:29:47.767 DEBUG (MainThread) [websockets.server] > HTTP/1.1 101 Switching Protocols
2024-03-25 19:29:47.767 DEBUG (MainThread) [websockets.server] > Upgrade: websocket
2024-03-25 19:29:47.768 DEBUG (MainThread) [websockets.server] > Connection: Upgrade
2024-03-25 19:29:47.768 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Accept: 8GSjzMU4gYjuVvfBSLI/cHfxsYI=
2024-03-25 19:29:47.768 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:47.768 DEBUG (MainThread) [websockets.server] > Date: Mon, 25 Mar 2024 19:29:47 GMT
2024-03-25 19:29:47.769 DEBUG (MainThread) [websockets.server] > Server: Python/3.12 websockets/11.0.3
2024-03-25 19:29:47.770 INFO (MainThread) [websockets.server] connection open
2024-03-25 19:29:47.770 DEBUG (MainThread) [websockets.server] = connection is OPEN
2024-03-25 19:29:50.081 DEBUG (MainThread) [websockets.server] > TEXT '[2,"57d37a8f-69ec-4ccd-bda9-763427f4143e","GetC...rtedFeatureProfiles"]}]' [98 bytes]
Here are the ocpp logs from the same time period:
2024-03-25 19:29:41.397 INFO (MainThread) [ocpp] : receive message [3,"3277e24f-4992-4109-a989-59426f633ae6",{"configurationKey":[]}]
2024-03-25 19:29:41.398 ERROR (MainThread) [custom_components.ocpp] Unexpected exception in connection to '': 'list index out of range'
File "/config/custom_components/ocpp/api.py", line 961, in run
File "/config/custom_components/ocpp/api.py", line 432, in post_connect
File "/config/custom_components/ocpp/api.py", line 830, in get_configuration
2024-03-25 19:29:41.593 INFO (MainThread) [custom_components.ocpp] Charger disconnected from 0.0.0.0:9000.
2024-03-25 19:29:41.718 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:41.720 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:41.723 INFO (MainThread) [custom_components.ocpp] Websocket Subprotocol matched: ocpp1.6
2024-03-25 19:29:41.723 INFO (MainThread) [custom_components.ocpp] Charger websocket path=/
2024-03-25 19:29:41.723 INFO (MainThread) [custom_components.ocpp] Charger reconnected to 0.0.0.0:9000.
2024-03-25 19:29:43.727 INFO (MainThread) [ocpp] : send [2,"01a4b8b1-86ed-4f50-9d04-36fd63b6c213","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-03-25 19:29:43.961 INFO (MainThread) [ocpp] : receive message [3,"01a4b8b1-86ed-4f50-9d04-36fd63b6c213",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core, FirmwareManagement, LocalAuthListManagement, SmartCharging, RemoteTrigger"}]}]
2024-03-25 19:29:43.964 INFO (MainThread) [ocpp] : send [2,"f0d1bf8d-dee7-42dd-bcab-02af59789b46","GetConfiguration",{"key":["NumberOfConnectors"]}]
2024-03-25 19:29:44.427 INFO (MainThread) [ocpp] : receive message [3,"f0d1bf8d-dee7-42dd-bcab-02af59789b46",{"configurationKey":[]}]
2024-03-25 19:29:44.428 ERROR (MainThread) [custom_components.ocpp] Unexpected exception in connection to '': 'list index out of range'
File "/config/custom_components/ocpp/api.py", line 961, in run
File "/config/custom_components/ocpp/api.py", line 432, in post_connect
File "/config/custom_components/ocpp/api.py", line 830, in get_configuration
2024-03-25 19:29:44.621 INFO (MainThread) [custom_components.ocpp] Charger disconnected from 0.0.0.0:9000.
2024-03-25 19:29:44.741 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:44.743 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:44.747 INFO (MainThread) [custom_components.ocpp] Websocket Subprotocol matched: ocpp1.6
2024-03-25 19:29:44.747 INFO (MainThread) [custom_components.ocpp] Charger websocket path=/
2024-03-25 19:29:44.747 INFO (MainThread) [custom_components.ocpp] Charger reconnected to 0.0.0.0:9000.
2024-03-25 19:29:46.750 INFO (MainThread) [ocpp] : send [2,"e66d0719-bba6-4543-a62d-5df95d27c39a","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-03-25 19:29:46.981 INFO (MainThread) [ocpp] : receive message [3,"e66d0719-bba6-4543-a62d-5df95d27c39a",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core, FirmwareManagement, LocalAuthListManagement, SmartCharging, RemoteTrigger"}]}]
2024-03-25 19:29:46.983 INFO (MainThread) [ocpp] : send [2,"7c2936eb-b00a-4643-9987-0871a0548131","GetConfiguration",{"key":["NumberOfConnectors"]}]
2024-03-25 19:29:47.449 INFO (MainThread) [ocpp] : receive message [3,"7c2936eb-b00a-4643-9987-0871a0548131",{"configurationKey":[]}]
2024-03-25 19:29:47.450 ERROR (MainThread) [custom_components.ocpp] Unexpected exception in connection to '': 'list index out of range'
File "/config/custom_components/ocpp/api.py", line 961, in run
File "/config/custom_components/ocpp/api.py", line 432, in post_connect
File "/config/custom_components/ocpp/api.py", line 830, in get_configuration
2024-03-25 19:29:47.647 INFO (MainThread) [custom_components.ocpp] Charger disconnected from 0.0.0.0:9000.
2024-03-25 19:29:47.766 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:47.768 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Protocol: ocpp1.6
2024-03-25 19:29:47.771 INFO (MainThread) [custom_components.ocpp] Websocket Subprotocol matched: ocpp1.6
2024-03-25 19:29:47.771 INFO (MainThread) [custom_components.ocpp] Charger websocket path=/
2024-03-25 19:29:47.772 INFO (MainThread) [custom_components.ocpp] Charger reconnected to 0.0.0.0:9000.
2024-03-25 19:29:50.080 INFO (MainThread) [ocpp] : send [2,"57d37a8f-69ec-4ccd-bda9-763427f4143e","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-03-25 19:29:50.316 INFO (MainThread) [ocpp] : receive message [3,"57d37a8f-69ec-4ccd-bda9-763427f4143e",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core, FirmwareManagement, LocalAuthListManagement, SmartCharging, RemoteTrigger"}]}]
2024-03-25 19:29:50.319 INFO (MainThread) [ocpp] : send [2,"2b49cb95-261c-46d0-971b-afaeb8c4620b","GetConfiguration",{"key":["NumberOfConnectors"]}]
2024-03-25 19:29:50.783 INFO (MainThread) [ocpp] : receive message [3,"2b49cb95-261c-46d0-971b-afaeb8c4620b",{"configurationKey":[]}]
2024-03-25 19:29:50.784 ERROR (MainThread) [custom_components.ocpp] Unexpected exception in connection to '': 'list index out of range'
Looks like your charger is not responding to this request as per the ocpp standard [2,"2b49cb95-261c-46d0-971b-afaeb8c4620b","GetConfiguration",{"key":["NumberOfConnectors"]}]
Suggest raising it with them, in the meantime you can comment out the request.
Stale issue message