Giter Club home page Giter Club logo

ocpp's People

Contributors

birneee avatar bjarnebitscrambler avatar dependabot[bot] avatar drc38 avatar dreimer1986 avatar grantkeymer avatar jeremycoppey avatar jonasgustavsson avatar kovlo avatar lbbrhzn avatar malaiwah avatar matejdro avatar mazzy89 avatar moorgrove avatar munterkalmsteiner avatar n3rdix avatar nano1237 avatar nlindn avatar npirtube avatar ohadlevy avatar scruysberghs avatar strixx76 avatar victorsanva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocpp's Issues

Sensors come and go

Version of the custom_component

v0.3.7 (with the input_number code)
-->

Configuration

No yaml requried

Describe the bug

When first installed and launched OCPP gets most of the parameters from my Evnex unit. I see them under 'configuration..Device''" and in the panel copied to Lovelace. Then gradually most of them disappear. The log file linked below shows this occuring, you can see parameters like serial number and firmware version lilsted at 17:36:10 but by 17:40:24 the same query (getConfiguration) returns significantly less parameters

Debug log

https://pastebin.ubuntu.com/p/jtnXCr3Nnm/

Log entry after update to #11

after the update to #11 I have the following log entry. (no car connected)
INFO log entry

2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [2,"54a87f14-f204-4f70-a508-4505faac628e","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [3,"54a87f14-f204-4f70-a508-4505faac628e",{"status":"Accepted"}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [2,"9ea8e02d-1a37-43e4-a18d-daa42e1d6680","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [3,"9ea8e02d-1a37-43e4-a18d-daa42e1d6680",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"10"}]}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [2,"d4739ea1-338c-40b8-89e2-85f2d6177a0a","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [3,"d4739ea1-338c-40b8-89e2-85f2d6177a0a",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"120"}]}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [2,"9864bb4f-1e49-4c6a-a589-41fc2498bc3b","ChangeConfiguration",{"key":"WebSocketPingInterval","value":"60"}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [3,"9864bb4f-1e49-4c6a-a589-41fc2498bc3b",{"status":"Accepted"}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [2,"388fa207-3bc6-4471-8f52-6df9caa552db","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [3,"388fa207-3bc6-4471-8f52-6df9caa552db",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Energy.Active.Import.Register"}]}]
2021-06-17 14:12:04 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [2,"ce08517a-aca9-4875-a898-5491c062f242","ChangeConfiguration",{"key":"MeterValuesSampledData","value":"Current.Export,Current.Import,Current.Offered,Energy.Active.Export.Register,Energy.Active.Import.Register,Energy.Reactive.Export.Register,Energy.Reactive.Import.Register,Energy.Active.Export.Interval,Energy.Active.Import.Interval,Energy.Reactive.Export.Interval,Energy.Reactive.Import.Interval,Frequency,Power.Active.Export,Power.Active.Import,Power.Factor,Power.Offered,Power.Reactive.Export,Power.Reactive.Import,RPM,SoC,Temperature,Voltage"}]
2021-06-17 14:12:05 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [3,"ce08517a-aca9-4875-a898-5491c062f242",{"status":"Rejected"}]

The Error

2021-06-17 14:12:05 ERROR (MainThread) [custom_components.ocpp.sensor] Configuration of the charger failed: ConfigurationError("charger returned 'Rejected' while setting 'MeterValuesSampledData' to 'Current.Export,Current.Import,Current.Offered,Energy.Active.Export.Register,Energy.Active.Import.Register,Energy.Reactive.Export.Register,Energy.Reactive.Import.Register,Energy.Active.Export.Interval,Energy.Active.Import.Interval,Energy.Reactive.Export.Interval,Energy.Reactive.Import.Interval,Frequency,Power.Active.Export,Power.Active.Import,Power.Factor,Power.Offered,Power.Reactive.Export,Power.Reactive.Import,RPM,SoC,Temperature,Voltage'")

INFO log entry

2021-06-17 14:12:07 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [2,"21647","Heartbeat",{}]
2021-06-17 14:12:07 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [3,"21647",{"currentTime":"2021-06-17T12:12:07.474490"}]
2021-06-17 14:12:07 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [2,"21648","Heartbeat",{}]
2021-06-17 14:12:07 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [3,"21648",{"currentTime":"2021-06-17T12:12:07.568418"}]

add charging limit service

Discussed in #48

Originally posted by jeremycoppey July 6, 2021
Would be nice to have some more info/sensors

  • Charge time of session
  • The energy usage for the current charging session
  • Set charging limit

Maximum_Current is set to 32 after HA restart

Version of the custom_component

v0.3.11

Configuration

Describe the bug

Maximum_Current is set to 32 after HA restart. Wouldn't it be better to set Maximum_Current to the value it had before the restart?

Debug log

Improve processing of measurands with phase components

Some improvements are possible for processing measurands with phase components. Currently we only process currents and line-to-neutral voltages. We can extend this to support power and line-to-line voltages.

In general we should aim to provide the one-phase equivalent voltage, current, power and power factor whenever multiple phases are reported.

When the voltages Vx-n are balanced (hope this is safe to assume?), we can do the following:

  • Power and current values are summed.
  • Power factors are averaged.
  • Line-to-line voltages are divided by sqrt(3) to get line-to-neutral voltages.
  • Reported and calculated line-to-neutral voltages are simply averaged.

See here for some background info.

Originally posted by @lbbrhzn in #98 (comment)

on_stop_transaction() missing 1 required positional argument: 'reason'

Version of the custom_component

Version of 06/07/2021 (where can I find it in the const.py file?)

Configuration

1 central
1 charepoint

Sensors: all that could be checked for m the list

Describe the bug

on_stop_transaction() missing 1 required positional argument: 'reason'

Debug log


2021-07-06 18:44:50 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: receive message [2,"2107","StopTransaction",{"meterStop":322,"timestamp":"2021-05-02T06:52:08Z","transactionId":1625568827}]
2021-07-06 18:44:50 ERROR (MainThread) [ocpp] Error while handling request '<Call - unique_id=2107, action=StopTransaction, payload={'meterStop': 322, 'timestamp': '2021-05-02T06:52:08Z', 'transactionId': 1625568827}>'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 185, in _handle_call
response = handler(**snake_case_payload)
File "/usr/local/lib/python3.8/site-packages/ocpp/routing.py", line 33, in inner
return func(*args, **kwargs)
TypeError: on_stop_transaction() missing 1 required positional argument: 'reason'
2021-07-06 18:44:50 INFO (MainThread) [ocpp] 00:80:F4:43:0B:34: send [4,"2107","InternalError","An unexpected error occurred.",{}]

Charger offline not handled in HA

Describe the bug

When a charger disconnects from the websocket eg powered down the sensors/switches should be set to offline. At the moment they remain online with the last known value. This results in a websocket error when operating a switch for example.

Setup entry on discovery

@lbbrhzn , it would be useful to split the integration setup. The first user form essentially sets up the central system server and can be set when adding the integration, then when a charger successfully connects to the central server the default sensors can be automatically added by calling get_configuration("MeterValuesSampledData"). If the user wanted to set extra options for the charger device the measurands form could be used with extra items relating to the charger also added such as MeterValueSampleInterval, WebSocketPingInterval, etc. These extra options could be auto-generated from the charger by iterating get_configuration and checking whether ReadOnly is false. Is that possible?

Images

This is a dummy issue, to allow easy upload of images

EV car not charging after restart HASS/OCPP service

I restarted HASS after some config changes (another component) and the car stopped charging.
On the wallbox I had a (un)/plug error but he re-established the connection with the OCPP service without any errors but didn't restart charging.
Restarted HASS around 11:45
At 12 I went to the car and removed and inserted the plug back into the car.
image

The hass config:

- platform: ocpp
   monitored_variables:
      - "Current.Export"
      - "Current.Import"
      - "Current.Offered"
      - "Energy.Active.Export.Register"
      - "Energy.Active.Import.Register"
      - "Energy.Reactive.Export.Register"
      - "Energy.Reactive.Import.Register"
      - "Energy.Active.Export.Interval"
      - "Energy.Active.Import.Interval"
      - "Energy.Reactive.Export.Interval"
      - "Energy.Reactive.Import.Interval"
      - "Frequency"
      - "Heartbeat"
      - "Power.Active.Export"
      - "Power.Active.Import"
      - "Power.Factor"
      - "Power.Offered"
      - "Power.Reactive.Export"
      - "Power.Reactive.Import"
      - "RPM"
      - "SoC"
      - "Status"
      - "Temperature"
      - "Voltage"
   port: 9000
   scan_interval:
    seconds: 60

My OCPP config on the wallbox:

# Ocpp Conf

[OCPP]
ocppVersion=              1.6
ocppCentralAddress=       ws://192.168.1.21:9000
ocppBoxLocalPort=         8080
ocppBoxPublicIp=          
ocppBoxPublicPort=        8080
ocppBoxLocalSSL=          0
ocppBoxAddressReplyTo=    http://www.w3.org/2005/08/addressing/anonymous
ocppModemIpAddress=       192.168.0.254
ocppModemPresence=       0
modemType=                
confModemRetryInterval=   30
boxIdentity=              UNDEFINED
defaultIdTag=             UNDEFINED
isMeterValueSimulated=    false
MeterValuesAlignedData=   Energy.Active.Import.Register
MeterValuesSampledData=   Energy.Active.Import.Register
meterValueSampleInterval= 900
clockAlignedDataInterval= 0
ocppConnectTimeOut=       60
WebSocketPingInterval=    120
MinimumStatusDuration=    0
TransactionMessageRetryInterval=60
TransactionMessageAttempts=500
truncateBootNotificationsSerialNumbers=    true
serverCertificatePassword=UNDEFINED
clientHttpsOptions=       DEFAULT
cacheListEnabled=         false
enablePlugNumbering=      false
enableDoubleNotification=      false
lastAcceptedOcppCentralAddress=ws://192.168.1.21:9000/00:80:F4:43:0B:34
lastAcceptedBoxIdentity=       00:80:F4:43:0B:34
lastAcceptedHeartBeatInterval= 10
compressDiagnostic=            1
ocppEMDegradedModeEnabled=     0
EnergyLimitValue=       0
isEnergyLimitedActive=     false

Error adding entities for domain number

Version of the custom_component

v0.3.6

Describe the bug

The changes in v 0.3.6 to supportedfeatures result in a runtime error

Debug log


2021-08-26 23:20:34 ERROR (MainThread) [homeassistant.components.number] Error adding entities for domain number with platform ocpp
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 587, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 711, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in _stringify_state
    if not self.available:
  File "/config/custom_components/ocpp/number.py", line 49, in available
    Profiles.SMART & self.central_system.get_supported_features(self.cp_id)

sensor.charger_temperature has unknown unit Celsius

Version of the custom_component

0.3.14

Configuration

Describe the bug

sensor.charger_temperature has unknown unit Celsius

It really should be °C

Debug log


Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:264
Integration: Sensor (documentation, issues)
First occurred: 01:05:10 (1 occurrences)
Last logged: 01:05:10

sensor.charger_temperature has unknown unit Celsius

Best way to help get a charger supported (Grizzl-E Smart)

Version of the custom_component

v0.3.13

Configuration

Set up through integrations.

Describe the bug

Would like to help work with devs to get the Grizzl-E Smart charger working with the component. Debug log from start of HA through the start of a charging session is below. I can connect to the acharger.ca site and sniff the traffic from the unit if that can help - let me know.

FWIW Grizzl-e's guide for working with their portal is here: https://grizzl-e.com/wp-content/uploads/2021/09/acharger-user_manual_and_connection_guide-1.pdf which may gives some insight into what is supported.

thanks!

Debug log


2021-10-08 14:29:53 WARNING (SyncWorker_7) [homeassistant.loader] We found a custom integration ocpp which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-10-08 14:39:07 INFO (MainThread) [ocpp] : receive message [2,"4011002b9cfdfe82f7","BootNotification",{"chargePointSerialNumber":"GRS-4011002b9c","chargePointModel":"GRS-*","chargePointVendor":"United Chargers","firmwareVersion":"05.43","meterType":"SW","iccid":"-67"}]
2021-10-08 14:39:07 INFO (MainThread) [ocpp] : send [3,"4011002b9cfdfe82f7",{"currentTime":"2021-10-08T18:39:07.467345+00:00","interval":3600,"status":"Accepted"}]
2021-10-08 14:39:08 INFO (MainThread) [ocpp] : receive message [2,"4011002b9cdb5f744","StatusNotification",{"errorCode":"NoError","status":"Available","timestamp":"2021-10-08T14:39:08.001Z","connectorId":1}]
2021-10-08 14:39:08 INFO (MainThread) [ocpp] : send [3,"4011002b9cdb5f744",{}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"35dc25fa-58d0-45d5-b942-5332c7e7f5d8","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"35dc25fa-58d0-45d5-b942-5332c7e7f5d8",{"configurationKey":[{"key":"SupportedFeatureProfiles","value":"Core,FirmwareManagement,LocalAuthListManagement,Reservation,SmartCharging,RemoteTrigger","readonly":true}]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"786ae445-015c-43a3-8e47-60c507182c3a","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"786ae445-015c-43a3-8e47-60c507182c3a",{"configurationKey":[{"key":"SupportedFeatureProfiles","value":"Core,FirmwareManagement,LocalAuthListManagement,Reservation,SmartCharging,RemoteTrigger","readonly":true}]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"3ac55418-7796-4e65-b097-d6af522afd8c","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"3ac55418-7796-4e65-b097-d6af522afd8c",{"status":"Accepted"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"1f98df79-1f4e-4eda-8fcb-d0a41f30078c","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [2,"4011002b9cdb3df1d0","StatusNotification",{"errorCode":"NoError","status":"Available","timestamp":"2021-10-08T14:39:09.001Z","connectorId":1}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [3,"4011002b9cdb3df1d0",{}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"1f98df79-1f4e-4eda-8fcb-d0a41f30078c",{"status":"Accepted"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"00bfaf3d-89cd-4b46-8e4c-4da556542285","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"00bfaf3d-89cd-4b46-8e4c-4da556542285",{"status":"Accepted"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"28170af7-6da5-4164-9b69-c1813e9e0c7e","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"28170af7-6da5-4164-9b69-c1813e9e0c7e",{"status":"Accepted"}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"c8d92f07-6b55-4263-bf75-401a352224eb","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"c8d92f07-6b55-4263-bf75-401a352224eb",{"configurationKey":[{"key":"HeartbeatInterval","value":"3600","readonly":false}]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"e64c2f88-a80b-487e-8e71-0c4c0ab2f2c1","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"e64c2f88-a80b-487e-8e71-0c4c0ab2f2c1",{"configurationKey":[{"key":"HeartbeatInterval","value":"3600","readonly":false}]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : send [2,"e26cc043-71ee-4e23-bc81-03d6c000b217","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-10-08 14:39:09 INFO (MainThread) [ocpp] : receive message [3,"e26cc043-71ee-4e23-bc81-03d6c000b217",{"configurationKey":[]
2021-10-08 14:39:09 ERROR (MainThread) [ocpp] Unable to parse message: '[3,"e26cc043-71ee-4e23-bc81-03d6c000b217",{"configurationKey":[]', it doesn't seem to be valid OCPP: FormatViolationError: Message is not valid JSON: Expecting ',' delimiter: line 1 column 65 (char 64), {}
  File "/usr/local/lib/python3.9/site-packages/ocpp/messages.py", line 67, in unpack
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 139, in route_message
  File "/usr/local/lib/python3.9/site-packages/ocpp/messages.py", line 69, in unpack
ocpp.exceptions.FormatViolationError: FormatViolationError: Message is not valid JSON: Expecting ',' delimiter: line 1 column 65 (char 64), {}
2021-10-08 14:39:10 INFO (MainThread) [ocpp] : receive message [2,"4011002b9cae21279c","StatusNotification",{"errorCode":"NoError","status":"Available","timestamp":"2021-10-08T14:39:09.001Z","connectorId":1}]
2021-10-08 14:39:10 INFO (MainThread) [ocpp] : send [3,"4011002b9cae21279c",{}]
2021-10-08 14:39:39 INFO (MainThread) [ocpp] : send [2,"64b4a0fc-7282-4e26-ab30-cc3c2955c70d","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-10-08 14:39:40 INFO (MainThread) [ocpp] : receive message [3,"64b4a0fc-7282-4e26-ab30-cc3c2955c70d",{"configurationKey":[]
2021-10-08 14:39:40 ERROR (MainThread) [ocpp] Unable to parse message: '[3,"64b4a0fc-7282-4e26-ab30-cc3c2955c70d",{"configurationKey":[]', it doesn't seem to be valid OCPP: FormatViolationError: Message is not valid JSON: Expecting ',' delimiter: line 1 column 65 (char 64), {}
  File "/usr/local/lib/python3.9/site-packages/ocpp/messages.py", line 67, in unpack
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 139, in route_message
  File "/usr/local/lib/python3.9/site-packages/ocpp/messages.py", line 69, in unpack
ocpp.exceptions.FormatViolationError: FormatViolationError: Message is not valid JSON: Expecting ',' delimiter: line 1 column 65 (char 64), {}
2021-10-08 14:39:42 INFO (MainThread) [ocpp] : receive message [2,"4011002b9caa694292","BootNotification",{"chargePointSerialNumber":"GRS-4011002b9c","chargePointModel":"GRS-*","chargePointVendor":"United Chargers","firmwareVersion":"05.43","meterType":"SW","iccid":"-67"}]
2021-10-08 14:39:42 INFO (MainThread) [ocpp] : send [3,"4011002b9caa694292",{"currentTime":"2021-10-08T18:39:42.529366+00:00","interval":3600,"status":"Accepted"}]
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 267, in call
  File "/config/custom_components/ocpp/api.py", line 705, in _get_specific_response
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 300, in _get_specific_response
  File "/config/custom_components/ocpp/api.py", line 356, in post_connect
  File "/config/custom_components/ocpp/api.py", line 676, in configure
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 270, in call
2021-10-08 14:40:09 INFO (MainThread) [ocpp] : send [2,"3643ae0b-999a-4c29-bd16-f165a36d2624","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : receive message [3,"3643ae0b-999a-4c29-bd16-f165a36d2624",{"configurationKey":[{"key":"SupportedFeatureProfiles","value":"Core,FirmwareManagement,LocalAuthListManagement,Reservation,SmartCharging,RemoteTrigger","readonly":true}]}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : send [2,"5e5e17a3-218a-4bc6-a52b-c3c3d7aebe37","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : receive message [3,"5e5e17a3-218a-4bc6-a52b-c3c3d7aebe37",{"status":"Accepted"}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : send [2,"68343236-0693-4d44-8636-e6c767d9b58c","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : receive message [2,"4011002b9cf94ec305","StatusNotification",{"errorCode":"NoError","status":"Available","timestamp":"2021-10-08T14:40:10.001Z","connectorId":1}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : send [3,"4011002b9cf94ec305",{}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : receive message [3,"68343236-0693-4d44-8636-e6c767d9b58c",{"status":"Accepted"}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : send [2,"1d1f7d82-86c4-4e7b-93cc-35579d3b521b","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : receive message [3,"1d1f7d82-86c4-4e7b-93cc-35579d3b521b",{"configurationKey":[{"key":"HeartbeatInterval","value":"3600","readonly":false}]}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : send [2,"c0ba94fd-7717-485c-85ca-f5791b1968cc","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-10-08 14:40:10 INFO (MainThread) [ocpp] : receive message [3,"c0ba94fd-7717-485c-85ca-f5791b1968cc",{"configurationKey":[]
2021-10-08 14:40:10 ERROR (MainThread) [ocpp] Unable to parse message: '[3,"c0ba94fd-7717-485c-85ca-f5791b1968cc",{"configurationKey":[]', it doesn't seem to be valid OCPP: FormatViolationError: Message is not valid JSON: Expecting ',' delimiter: line 1 column 65 (char 64), {}
  File "/usr/local/lib/python3.9/site-packages/ocpp/messages.py", line 67, in unpack
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 139, in route_message
  File "/usr/local/lib/python3.9/site-packages/ocpp/messages.py", line 69, in unpack
ocpp.exceptions.FormatViolationError: FormatViolationError: Message is not valid JSON: Expecting ',' delimiter: line 1 column 65 (char 64), {}
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 267, in call
  File "/config/custom_components/ocpp/api.py", line 705, in _get_specific_response
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 300, in _get_specific_response
  File "/config/custom_components/ocpp/api.py", line 356, in post_connect
  File "/config/custom_components/ocpp/api.py", line 676, in configure
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 270, in call
2021-10-08 14:47:11 INFO (MainThread) [ocpp] : receive message [2,"4011002b9c6b5928f0","StatusNotification",{"errorCode":"NoError","status":"Preparing","timestamp":"2021-10-08T14:47:11.001Z","info":"TRP:Av->Pr:12:12:24","connectorId":1}]
2021-10-08 14:47:11 INFO (MainThread) [ocpp] : send [3,"4011002b9c6b5928f0",{}]
2021-10-08 14:47:12 INFO (MainThread) [ocpp] : receive message [2,"4011002b9c76edc569","Authorize",{"idTag":"4011002b9c"}]
2021-10-08 14:47:12 INFO (MainThread) [ocpp] : send [3,"4011002b9c76edc569",{"idTagInfo":{"status":"Accepted"}}]
2021-10-08 14:47:13 INFO (MainThread) [ocpp] : receive message [2,"4011002b9cb662afb4","StartTransaction",{"idTag":"4011002b9c","timestamp":"2021-10-08T14:47:12.001Z","connectorId":1,"meterStart":0}]
2021-10-08 14:47:13 INFO (MainThread) [ocpp] : send [3,"4011002b9cb662afb4",{"transactionId":1633718833,"idTagInfo":{"status":"Accepted"}}]
2021-10-08 14:47:20 INFO (MainThread) [ocpp] : receive message [2,"4011002b9ca51e9542","StatusNotification",{"errorCode":"NoError","status":"Charging","timestamp":"2021-10-08T14:47:20.001Z","info":"Prep->Charging","connectorId":1}]
2021-10-08 14:47:20 INFO (MainThread) [ocpp] : send [3,"4011002b9ca51e9542",{}]
2021-10-08 14:49:08 INFO (MainThread) [ocpp] : receive message [2,"4011002b9c2973510d","MeterValues",{"connectorId":1,"meterValue":[{"timestamp":"2021-10-08T14:49:08.001Z","sampledValue":[{"measurand":"Current.Export","unit":"A","value":"23.35"}]}],"transactionId":1633718833}]

Support for 3 phases

Are phases also available?

"Power.Active.Import" is now (L3 ?!)

Back office (OCPP) configuration key list for Alfen chargers

MeterValuesSampledData Sampled measurand(s) to be included in every meter value. The interval can be changed by
changing the key "MeterValueSampleInterval". A combination, up to 9, of measurands is
supported. The measurands can be combined by separating the value by a comma ","
Value example: 'Energy.Active.Import.Register,Voltage.L1-N,Current.Import.L1'

Supported values:
Energy.Active.Import.Register, Power.Active.Import, Current.Import, Voltage,
Temperature, Current.Offered, Frequency, Power.Factor
Measurand(s) must be combined with the phase (separated by a dot ‘.’)

Supported phases:
Voltage meter values support phase configuration:
L1-N, L2-N, L3-N, L1-L2, L2-L3, L3-L1
Value example: 'Voltage.L1-N'

Current, power and power factor meter values support phase configuration:
L1, L2, L3
Value example: 'Current.Import.L1'

When the 'SmartChargingMode' (OCPP 1.5+) is beeing used, the following measurands are
available:

Supported values:
Current.L1 ; Current.L2 ; Current.L3

Keep losing the OCPP device from Home Assistant

Version of the custom_component

Version v0.3.10

Configuration

Describe the bug

If I restart HA, I get the EV Charge info appearing on Lovelace. After only a few minutes it disappears again. I look at the log and can see heartbeat still runnning. I can also see the request for features succesfully bringing verything back,

Debug log


2021-09-09 12:42:26 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"8e108dec-61fd-4b94-b0e9-e95c23779dd1","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-09-09 12:42:26 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"6d455b48-e9b8-b3cc-c924-2aa402067eef","Heartbeat",{}]
2021-09-09 12:42:26 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"6d455b48-e9b8-b3cc-c924-2aa402067eef",{"currentTime":"2021-09-09T00:42:26.832610+00:00"}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"8e108dec-61fd-4b94-b0e9-e95c23779dd1",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core,FirmwareManagement,SmartCharging"}]}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"2fa8cb23-6590-465d-a86c-1b6fbcac030b","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"2fa8cb23-6590-465d-a86c-1b6fbcac030b",{"status":"Accepted"}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"d6d3cd5c-0bc7-491c-8e7e-c9d24ec9ae46","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"e603e441-efab-435d-0c57-1fc113cc7716","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available","timestamp":"2021-09-09T00:42:26Z"}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"e603e441-efab-435d-0c57-1fc113cc7716",{}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"d6d3cd5c-0bc7-491c-8e7e-c9d24ec9ae46",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"30"}]}]
2021-09-09 12:42:27 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"addc4470-c3ee-4499-a062-6d3a0ffa919b","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-09-09 12:42:28 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"addc4470-c3ee-4499-a062-6d3a0ffa919b",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"60"}]}]
2021-09-09 12:42:28 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"ae9edd56-9a51-4505-8e2a-d7413abcc4e7","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-09-09 12:42:28 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"ae9edd56-9a51-4505-8e2a-d7413abcc4e7",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Energy.Active.Import.Register,Power.Active.Import"}]}]
2021-09-09 12:42:28 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"452e81d8-f931-4d08-97ae-a1481913289c","GetConfiguration",{"key":["MeterValueSampleInterval"]}]
2021-09-09 12:42:28 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"452e81d8-f931-4d08-97ae-a1481913289c",{"configurationKey":[{"key":"MeterValueSampleInterval","readonly":false,"value":"60"}]}]
2021-09-09 12:42:28 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"eda4e565-6b84-4591-8245-916baf88c3c2","GetConfiguration",{"key":["NumberOfConnectors"]}]
2021-09-09 12:42:29 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"eda4e565-6b84-4591-8245-916baf88c3c2",{"configurationKey":[{"key":"NumberOfConnectors","readonly":true,"value":"1"}]}]
2021-09-09 12:45:36 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"a3edb558-3885-4bef-a75a-cff02530563d","Reset",{"type":"Hard"}]
2021-09-09 12:45:36 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"a3edb558-3885-4bef-a75a-cff02530563d",{"status":"Accepted"}]
2021-09-09 12:45:54 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"43c4164f-844b-275b-3afc-e2898a915c53","BootNotification",{"chargePointModel":"E7-T2S","chargePointVendor":"Evnex","firmwareVersion":"1.1.0.26E4747","chargePointSerialNumber":"AR21120320","meterType":"D111"}]
2021-09-09 12:45:54 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"43c4164f-844b-275b-3afc-e2898a915c53",{"currentTime":"2021-09-09T00:45:54.739409+00:00","interval":30,"status":"Accepted"}]
2021-09-09 12:45:54 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"ff1f4448-ef1f-4ff0-b945-47611db19169","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"f96b7478-92ae-8004-818f-46ef99f7c1fe","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2021-09-09T00:45:45Z"}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"f96b7478-92ae-8004-818f-46ef99f7c1fe",{}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"ff1f4448-ef1f-4ff0-b945-47611db19169",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core,FirmwareManagement,SmartCharging"}]}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"29ff9d44-60bb-40ce-86b9-ca1b9f49bf2d","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"386cd2d0-c2c0-cb69-9438-9d8a1df04fb9","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available","timestamp":"2021-09-09T00:45:45Z"}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"386cd2d0-c2c0-cb69-9438-9d8a1df04fb9",{}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"29ff9d44-60bb-40ce-86b9-ca1b9f49bf2d",{"status":"Accepted"}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"497b6824-bb03-413a-bd7e-ee3db2fd0207","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"c2c0bd0d-d0f3-b57a-7cc8-d121b29d5210","DataTransfer",{"vendorId":"Evnex","messageId":"info","data":"Reboot Reason: 7, Reboot Flags: 0x0b"}]
2021-09-09 12:45:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"c2c0bd0d-d0f3-b57a-7cc8-d121b29d5210",{"status":"Accepted"}]
2021-09-09 12:45:56 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"497b6824-bb03-413a-bd7e-ee3db2fd0207",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"30"}]}]
2021-09-09 12:45:56 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"858c955b-940c-4301-aab7-02fff1ed73ef","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-09-09 12:45:56 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"089a0057-5de4-7b92-31ad-8ef4fe86c949","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available","timestamp":"2021-09-09T00:45:54Z"}]
2021-09-09 12:45:56 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"089a0057-5de4-7b92-31ad-8ef4fe86c949",{}]
2021-09-09 12:45:56 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"858c955b-940c-4301-aab7-02fff1ed73ef",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"60"}]}]
2021-09-09 12:45:56 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"12fd7f81-6ee4-4b4a-bec2-a8c01f09c304","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-09-09 12:45:57 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"12fd7f81-6ee4-4b4a-bec2-a8c01f09c304",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Energy.Active.Import.Register,Power.Active.Import"}]}]
2021-09-09 12:45:57 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"97e3ae1c-0cf7-477f-ae99-40e099c4bb48","GetConfiguration",{"key":["MeterValueSampleInterval"]}]
2021-09-09 12:45:57 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"97e3ae1c-0cf7-477f-ae99-40e099c4bb48",{"configurationKey":[{"key":"MeterValueSampleInterval","readonly":false,"value":"60"}]}]
2021-09-09 12:45:57 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [2,"f536c931-1d7c-4f37-a06e-c645de825469","GetConfiguration",{"key":["NumberOfConnectors"]}]
2021-09-09 12:45:57 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [3,"f536c931-1d7c-4f37-a06e-c645de825469",{"configurationKey":[{"key":"NumberOfConnectors","readonly":true,"value":"1"}]}]
2021-09-09 12:46:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"032eb682-bee8-7b9e-73a7-ac07e80d25ee","Heartbeat",{}]
2021-09-09 12:46:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"032eb682-bee8-7b9e-73a7-ac07e80d25ee",{"currentTime":"2021-09-09T00:46:25.234596+00:00"}]
2021-09-09 12:46:49 ERROR (MainThread) [aioasuswrt.connection] Host timeout.
2021-09-09 12:46:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"64e24728-5614-b2be-472c-b05646cb8203","Heartbeat",{}]
2021-09-09 12:46:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"64e24728-5614-b2be-472c-b05646cb8203",{"currentTime":"2021-09-09T00:46:55.223248+00:00"}]
2021-09-09 12:47:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"db9b94d0-9f8a-a883-aa39-0308ee25239f","Heartbeat",{}]
2021-09-09 12:47:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"db9b94d0-9f8a-a883-aa39-0308ee25239f",{"currentTime":"2021-09-09T00:47:25.206740+00:00"}]
2021-09-09 12:47:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"409c3cbf-0a70-7eda-59db-c11f26928472","Heartbeat",{}]
2021-09-09 12:47:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"409c3cbf-0a70-7eda-59db-c11f26928472",{"currentTime":"2021-09-09T00:47:55.205761+00:00"}]
2021-09-09 12:48:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"7ab3e71b-651c-7cf2-8637-9dc6ebbcb87c","Heartbeat",{}]
2021-09-09 12:48:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"7ab3e71b-651c-7cf2-8637-9dc6ebbcb87c",{"currentTime":"2021-09-09T00:48:25.281351+00:00"}]
2021-09-09 12:48:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"7fb7b64a-14a4-2a08-7bf5-07832fd6b5a8","Heartbeat",{}]
2021-09-09 12:48:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"7fb7b64a-14a4-2a08-7bf5-07832fd6b5a8",{"currentTime":"2021-09-09T00:48:55.356470+00:00"}]
2021-09-09 12:49:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"be5ea9b8-3243-eb68-2beb-770d3bd8dd6e","Heartbeat",{}]
2021-09-09 12:49:25 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"be5ea9b8-3243-eb68-2beb-770d3bd8dd6e",{"currentTime":"2021-09-09T00:49:25.238923+00:00"}]
2021-09-09 12:49:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: receive message [2,"5ee803ee-4212-dbb5-3e17-7536a74fbeee","Heartbeat",{}]
2021-09-09 12:49:55 INFO (MainThread) [ocpp] EVNEX-JAYDCA: send [3,"5ee803ee-4212-dbb5-3e17-7536a74fbeee",{"currentTime":"2021-09-09T00:49:55.546061+00:00"}]

UnboundLocalError: local variable 'sum' referenced before assignment

Version of the custom_component

OCPP version 0.3.2 21-07-2021

Configuration

Describe the bug

UnboundLocalError: local variable 'sum' referenced before assignment.

No problems with the test version for 3 phase - version 0.3.1 i test today.

Debug log


This error originated from a custom integration.

Logger: ocpp
Source: custom_components/ocpp/api.py:719
Integration: Open Charge Point Protocol (OCPP) (documentation, issues)
First occurred: 20:03:15 (1 occurrences)
Last logged: 20:03:15

Error while handling request '<Call - unique_id=18, action=MeterValues, payload={'connectorId': 1, 'transactionId': 1626878818, 'meterValue': [{'timestamp': '2021-07-21T17:42:42Z', 'sampledValue': [{'value': '1336750.000', 'context': 'Sample.Periodic', 'measurand': 'Energy.Active.Import.Register', 'location': 'Outlet', 'unit': 'Wh'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W', 'phase': 'L1'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W', 'phase': 'L2'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W', 'phase': 'L3'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Factor', 'location': 'Outlet'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Import', 'location': 'Outlet', 'unit': 'A', 'phase': 'L1'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Import', 'location': 'Outlet', 'unit': 'A', 'phase': 'L2'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Import', 'location': 'Outlet', 'unit': 'A', 'phase': 'L3'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Offered', 'location': 'Outlet', 'unit': 'A'}, {'value': '224.700', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L1-N'}, {'value': '224.600', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L2-N'}, {'value': '226.500', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L3-N'}, {'value': '391.400', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L1-L2'}, {'value': '391.200', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L2-L3'}, {'value': '393.100', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L3-L1'}, {'value': '50.040', 'context': 'Sample.Periodic', 'measurand': 'Frequency', 'location': 'Outlet'}, {'value': '43.000', 'context': 'Sample.Periodic', 'measurand': 'Temperature', 'location': 'Body', 'unit': 'Celsius'}]}]}>'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 185, in _handle_call
    response = handler(**snake_case_payload)
  File "/usr/local/lib/python3.9/site-packages/ocpp/routing.py", line 47, in inner
    return func(*args, **kwargs)
  File "/config/custom_components/ocpp/api.py", line 754, in on_meter_values
    self.process_phases(unprocessed)
  File "/config/custom_components/ocpp/api.py", line 719, in process_phases
    self._metrics[metric] = round(sum, 1)
UnboundLocalError: local variable 'sum' referenced before assignment

2021-07-21 20:00:05 INFO (MainThread) [ocpp] RepHome-1: send [4,"15","InternalError","An unexpected error occurred.",{}]
2021-07-21 20:01:23 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"16","MeterValues",{"connectorId":1,"transactionId":1626878818,"meterValue":[{"timestamp":"2021-07-21T17:42:42Z","sampledValue":[{"value":"1336750.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"224.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"224.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"226.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"391.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"391.200","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"393.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"},{"value":"50.040","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"43.000","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"}]}]}]
2021-07-21 20:01:23 ERROR (MainThread) [ocpp] Error while handling request '<Call - unique_id=16, action=MeterValues, payload={'connectorId': 1, 'transactionId': 1626878818, 'meterValue': [{'timestamp': '2021-07-21T17:42:42Z', 'sampledValue': [{'value': '1336750.000', 'context': 'Sample.Periodic', 'measurand': 'Energy.Active.Import.Register', 'location': 'Outlet', 'unit': 'Wh'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W', 'phase': 'L1'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W', 'phase': 'L2'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Active.Import', 'location': 'Outlet', 'unit': 'W', 'phase': 'L3'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Power.Factor', 'location': 'Outlet'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Import', 'location': 'Outlet', 'unit': 'A', 'phase': 'L1'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Import', 'location': 'Outlet', 'unit': 'A', 'phase': 'L2'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Import', 'location': 'Outlet', 'unit': 'A', 'phase': 'L3'}, {'value': '0.000', 'context': 'Sample.Periodic', 'measurand': 'Current.Offered', 'location': 'Outlet', 'unit': 'A'}, {'value': '224.700', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L1-N'}, {'value': '224.600', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L2-N'}, {'value': '226.500', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L3-N'}, {'value': '391.400', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L1-L2'}, {'value': '391.200', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L2-L3'}, {'value': '393.100', 'context': 'Sample.Periodic', 'measurand': 'Voltage', 'location': 'Outlet', 'unit': 'V', 'phase': 'L3-L1'}, {'value': '50.040', 'context': 'Sample.Periodic', 'measurand': 'Frequency', 'location': 'Outlet'}, {'value': '43.000', 'context': 'Sample.Periodic', 'measurand': 'Temperature', 'location': 'Body', 'unit': 'Celsius'}]}]}>'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 185, in _handle_call
response = handler(**snake_case_payload)
File "/usr/local/lib/python3.9/site-packages/ocpp/routing.py", line 47, in inner
return func(*args, **kwargs)
File "/config/custom_components/ocpp/api.py", line 754, in on_meter_values
self.process_phases(unprocessed)
File "/config/custom_components/ocpp/api.py", line 719, in process_phases
self._metrics[metric] = round(sum, 1)
UnboundLocalError: local variable 'sum' referenced before assignment
2021-07-21 20:01:23 INFO (MainThread) [ocpp] RepHome-1: send [4,"16","InternalError","An unexpected error occurred.",{}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: send [2,"d4d75964-4789-4d40-80b2-bb1fbdb5e389","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"d4d75964-4789-4d40-80b2-bb1fbdb5e389",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core,FirmwareManagement,Reservation,LocalAuthListManagement,RemoteTrigger,SmartCharging"}]}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: send [2,"99879625-a021-41ca-b2f6-ab4fda0757d6","TriggerMessage",{"requestedMessage":"BootNotification"}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"99879625-a021-41ca-b2f6-ab4fda0757d6",{"status":"Accepted"}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: send [2,"bf7b6202-9180-44fa-b4c6-06956f2c6493","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"bf7b6202-9180-44fa-b4c6-06956f2c6493",{"status":"Accepted"}]
2021-07-21 20:02:59 INFO (MainThread) [ocpp] RepHome-1: send [2,"6381e53c-3d40-4595-8eee-be9bbb40468e","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"6381e53c-3d40-4595-8eee-be9bbb40468e",{"status":"Accepted"}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: send [2,"6ca8c631-258e-4ae9-8b88-3da434d9becc","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"6ca8c631-258e-4ae9-8b88-3da434d9becc",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"30"}]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: send [2,"f45723ab-9f65-4db8-931a-e9be5e80d241","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"f45723ab-9f65-4db8-931a-e9be5e80d241",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"60"}]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: send [2,"86b765fe-ac66-4587-80c3-1e60de3c132e","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"86b765fe-ac66-4587-80c3-1e60de3c132e",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Energy.Active.Import.Register,Power.Active.Import,Power.Factor,Current.Import,Current.Offered,Voltage,Frequency,Temperature"}]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: send [2,"e3e1b761-e043-45d3-8251-0e7e3655dde9","GetConfiguration",{"key":["MeterValueSampleInterval"]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"e3e1b761-e043-45d3-8251-0e7e3655dde9",{"configurationKey":[{"key":"MeterValueSampleInterval","readonly":false,"value":"60"}]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: send [2,"04e578a5-b41d-49a0-895f-b1625249b4ce","GetConfiguration",{"key":["NumberOfConnectors"]}]
2021-07-21 20:03:00 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"04e578a5-b41d-49a0-895f-b1625249b4ce",{"configurationKey":[{"key":"NumberOfConnectors","readonly":true,"value":"1"}]}]
2021-07-21 20:03:04 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"17","BootNotification",{"chargePointVendor":"Alfen BV","chargePointModel":"NG910-60023","chargePointSerialNumber":"ace0025893","chargeBoxSerialNumber":"RepHome-1","firmwareVersion":"4.15.0-3910"}]
2021-07-21 20:03:04 INFO (MainThread) [ocpp] RepHome-1: send [3,"17",{"currentTime":"2021-07-21T18:03:04.791874+00:00","interval":30,"status":"Accepted"}]

Support for EV charger-card UI

Is your feature request related to a problem? Please describe.
Our ocpp integration represents the ChargePoint as a set of sensors and switches. Some may find it more user friendly to use a single graphical representation of the charger that shows the status and access to services, like lock/unlock, reset, fw upgrade etc.

Describe the solution you'd like
There is a HACS project for a custom
EV charger-card
We should see what would be required to facilitate users to combine our integration with this.

Describe alternatives you've considered
Alternatively, we can create our own card that is specifically designed for ocpp. Not sure if we can integrate the .js file of the card with the custom_component in a single hacs integration, though, so installation may still be a multi-step process.

Additional context
I’ve opened an issue at the charge-card project to discuss how to facilitate integration.

using Enums that inherit from str

Is your feature request related to a problem? Please describe.
Key values are currently defined in enums, which is great for preventing typos through linting. The syntax that is currently used is a bit verbose though:

self._metrics[om.Frequency.value]=value

Describe the solution you'd like
With enums derived from str (Using multiple inheritance) you can use the enum value itself as a string value, so you can use:

self._metrics[om.Frequency]=value

Describe alternatives you've considered
None

Additional context
See here for more info.

Using services in automation actions

Discussed in #150

Originally posted by jonasbkarlsson September 7, 2021
Not sure what the problem is so I try to ask here.

If I configure the automation action as

service: ocpp.configure
data:
  ocpp_key: MeterValueSampleInterval
  value: "120"

it works well. But if I try

service: ocpp.configure
data:
  ocpp_key: MeterValueSampleInterval
  value: "{{ states('input_number.ocpp_test') | round (0)}}"

I get the ERROR:

2021-09-07 09:47:56 ERROR (MainThread) [homeassistant.components.automation.ocpp_test] OCPP test: Error executing script. Invalid data for call_service at pos 1: expected str for dictionary value @ data['value']
2021-09-07 09:47:56 ERROR (MainThread) [homeassistant.components.automation.ocpp_test] Error while executing automation automation.ocpp_test: expected str for dictionary value @ data['value']

How to convert the numerical value to a string? Or what should be done?

Setting max current using sliders

Is your feature request related to a problem? Please describe.
We provide services through switches, and service calls. Some simple services like setting the max charging current could be represented in the user interface as simple controls.

Describe the solution you'd like
Use a slider for setting max charging current.

Describe alternatives you've considered
None

Additional context
entity_view
from goecharger

Services are failing

Version of the custom_component

0.3.0

Describe the bug

When toggling a switch, home assistant shows a pop-up:

Failed to call service switch/turn_on. Local variable 'resp' used before assignment.

Second OCPP

OCPP is already in use in my Wallbox.
Is there a option to connect the Wallbox to HA via OCCP?

Add to HACS default integrations

Version of the custom_component

v0.3.0

Configuration

Not applicable

Describe the bug

Ocpp currently needs to be added as an additional repository to hacs. By adding ocpp to the HACS default integration list, this step is no longer needed

Debug log

Not applicable.

Timeout when talking to charger

My Home Assistant is running inside docker inside a Ubuntu 20.04 computer that also uses nginx reverse proxy. Do you think the reverse proxy could be screweing up communications? If the charger sends a message on the defined port to my ubuntu machine how does that know to pass that message to Home Assistant inside the docker container?

Version of the custom_component

custom_components/ocpp/api.py:382

Configuration

Logger: custom_components.ocpp
Source: custom_components/ocpp/api.py:382
Integration: Open Charge Point Protocol (OCPP) (documentation, issues)
First occurred: 15:25:18 (1 occurrences)
Last logged: 15:25:18

Exception occurred: Waited 30s for response on [2,"01de410a-8efb-4817-a7d2-34816aff4fb4","GetConfiguration",{"key":["SupportedFeatureProfiles"]}].
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/queues.py", line 166, in get
await getter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
fut.result()
asyncio.exceptions.CancelledError

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

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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/ocpp/api.py", line 160, in on_connect
await self.charge_points[self.cpid].start()
File "/config/custom_components/ocpp/api.py", line 698, in start
await asyncio.gather(super().start(), self.post_connect())
File "/config/custom_components/ocpp/api.py", line 324, in post_connect
await self.get_supported_features()
File "/config/custom_components/ocpp/api.py", line 382, in get_supported_features
resp = await self.call(req)
File "/usr/local/lib/python3.9/site-packages/ocpp/charge_point.py", line 268, in call
raise asyncio.TimeoutError(
asyncio.exceptions.TimeoutError: Waited 30s for response on [2,"01de410a-8efb-4817-a7d2-34816aff4fb4","GetConfiguration",{"key":["SupportedFeatureProfiles"]}].

Error in connection handler

Hello,
I just installed your custom component:
HA: core-2021.4.6
HACS: 1.12.3
My wallbox: EVlink schneider electric, OCPP 1.6

Error log:

Logger: websockets.server
Source: custom_components/ocpp/sensor.py:276
First occurred: 1:43:14 AM (2 occurrences)
Last logged: 1:57:19 AM

Error in connection handler
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 1047, in read_frame
    frame = await Frame.read(
  File "/usr/local/lib/python3.8/site-packages/websockets/framing.py", line 105, in read
    data = await reader(2)
  File "/usr/local/lib/python3.8/asyncio/streams.py", line 723, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/local/lib/python3.8/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/websockets/server.py", line 191, in handler
    await self.ws_handler(self, path)
  File "/config/custom_components/ocpp/sensor.py", line 110, in on_connect
    await cp.start()
  File "/config/custom_components/ocpp/sensor.py", line 276, in start
    await asyncio.gather(super().start(), self.post_connect())
  File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 123, in start
    message = await self._connection.recv()
  File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 812, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason

The only working sensors in my setup is the status and the heartbeat.

image

Cannot write to maximum current in HA 2021.9

That this seems to be wrong: class Number(InputNumber):
Seems like it should derive from https://github.com/home-assistant/core/tree/dev/homeassistant/components/number

Log error is:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/number/init.py:61
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 17:44:08 (3 occurrences)
Last logged: 18:21:09

[140123908151952] 'Number' object has no attribute 'min_value'
[140123874083888] 'Number' object has no attribute 'min_value'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 61, in async_set_value
if value < entity.min_value or value > entity.max_value:
AttributeError: 'Number' object has no attribute 'min_value'

First time setup - HA throws error on sensor configuration

Version of the custom_component

97b83fe

Configuration

sensor:
  - platform: ocpp
    name: charger_1
    meter_interval: 60
    monitored_variables:
      - "Current.Export"
      - "Current.Import"
      - "Current.Offered"
      - "Energy.Active.Export.Register"
      - "Energy.Active.Import.Register"
      - "Energy.Reactive.Export.Register"
      - "Energy.Reactive.Import.Register"
      - "Energy.Active.Export.Interval"
      - "Energy.Active.Import.Interval"
      - "Energy.Reactive.Export.Interval"
      - "Energy.Reactive.Import.Interval"
      - "Frequency"
      - "Power.Active.Export"
      - "Power.Active.Import"
      - "Power.Factor"
      - "Power.Offered"
      - "Power.Reactive.Export"
      - "Power.Reactive.Import"
      - "RPM"
      - "SoC"
      - "Temperature"
      - "Voltage"
    port: 9000
    scan_interval:
      seconds: 60

Describe the bug

I'm trying to set this up for the first time (just got a charger that supports ocpp) and I setup HACS and added the repo. When I add the sensor configuration it passes config check but nothing shows up in entities, and the below shows up in Configuration -> Logs.

HAOS on a Pi4
Core: core-2021.6.6
Supervisor: 2021.06.6
Host: Home Assistant OS 6.1

Debug log

 Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:165
Integration: Sensor (documentation, issues)
First occurred: 1:03:27 PM (1 occurrences)
Last logged: 1:03:27 PM
The ocpp platform for the sensor integration does not support platform setup. Please remove it from your config.

Missing 'version' key in manifest

I get this message on start of HA:
"No 'version' key in the manifest file for custom integration 'ocpp'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'ocpp'"
Just adding a corresponding line to it makes HA happy again.


Btw, a big thx for maintaining the OCPP addin! The one from OrangeTux for example had no heartbeat and this one alone was good enough to give me feedback that it's working at all. All other sensors show Unknown and I was already wondering if a line like ws://192.168.181.42:9000/ is not working with my EVBOX ELVI. (OCPP 1.6 supportive) Tbh, I did not charge with it the last two days. Maybe it only sends information if really used.

Thanks again :D

Split Features list into separate items

Is your feature request related to a problem? Please describe.
The charger.Features sensor shows the list of supported features as a list of comma separated strings. This does not display nicely on small screens (phone) and is cumbersome to access in scripts.

Describe the solution you'd like
It would be better to create separate (binary) sensor metrics for each possible feature.

Describe alternatives you've considered
None

Additional context
image

Automated testing

We should improve automated testing.
There are some automated tests defined that I took from an example project, but these currently fail.

Some somple tests we should add:

  • test configFlows and optionFlow

A more complicated test:

  • add a Charge Point simulator, verify that our CentralSystem / ChargePoint implementation can connect with it

no value on some sensors

No value on sensors chargePointSerialNumber and firmwareVersion.
The value is in the log

Version of the custom_component

0.2 (6-7-2021)

Configuration

to intergration

Describe the bug

No value on sensors chargePointSerialNumber and firmwareVersion.

Value is now: Unknown

The value is in the log
"chargePointSerialNumber":"ace0025893"
"firmwareVersion":"4.15.0-3910"}]

ocpp-2

Debug log


2021-07-06 17:03:37 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ocpp which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: send [2,"0ccdd3b6-d0dc-4cd4-a4b3-b54124e3de90","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"0ccdd3b6-d0dc-4cd4-a4b3-b54124e3de90",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core,FirmwareManagement,Reservation,LocalAuthListManagement,RemoteTrigger,SmartCharging"}]}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: send [2,"9309645e-ca2a-4381-bc28-9ab71ee63ba6","TriggerMessage",{"requestedMessage":"BootNotification"}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"92","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T15:02:33Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.050","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"36.750","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"225.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"224.900","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"228.000","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"391.800","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"392.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"395.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: send [3,"92",{}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"9309645e-ca2a-4381-bc28-9ab71ee63ba6",{"status":"Accepted"}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: send [2,"f9c7bc6d-3744-4378-bf8b-a2fcc0216495","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"f9c7bc6d-3744-4378-bf8b-a2fcc0216495",{"status":"Accepted"}]
2021-07-06 17:03:42 INFO (MainThread) [ocpp] RepHome-1: send [2,"a4152bdd-922c-4085-8247-e41ad3144008","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"a4152bdd-922c-4085-8247-e41ad3144008",{"status":"Accepted"}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: send [2,"f061803e-cf60-4005-a9c4-977813b704ee","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"f061803e-cf60-4005-a9c4-977813b704ee",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"30"}]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: send [2,"48479c11-7b61-45cc-ae9a-99abceea8ae6","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"48479c11-7b61-45cc-ae9a-99abceea8ae6",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"60"}]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: send [2,"d0a895f6-4214-48e2-80d9-52634fee1c47","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"d0a895f6-4214-48e2-80d9-52634fee1c47",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Current.Import,Current.Offered,Energy.Active.Import.Register,Frequency,Power.Active.Import,Power.Factor,Temperature,Voltage"}]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: send [2,"e7881113-a841-4a2c-91ea-28e189bb1f2e","GetConfiguration",{"key":["MeterValueSampleInterval"]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"e7881113-a841-4a2c-91ea-28e189bb1f2e",{"configurationKey":[{"key":"MeterValueSampleInterval","readonly":false,"value":"60"}]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: send [2,"46686c7c-0562-4239-b549-1ec27cd69810","GetConfiguration",{"key":["NumberOfConnectors"]}]
2021-07-06 17:03:43 INFO (MainThread) [ocpp] RepHome-1: receive message [3,"46686c7c-0562-4239-b549-1ec27cd69810",{"configurationKey":[{"key":"NumberOfConnectors","readonly":true,"value":"1"}]}]
2021-07-06 17:03:47 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"93","BootNotification",{"chargePointVendor":"Alfen BV","chargePointModel":"NG910-60023","chargePointSerialNumber":"ace0025893","chargeBoxSerialNumber":"RepHome-1","firmwareVersion":"4.15.0-3910"}]
2021-07-06 17:03:47 INFO (MainThread) [ocpp] RepHome-1: send [3,"93",{"currentTime":"2021-07-06T15:03:47.600574","interval":30,"status":"Accepted"}]
2021-07-06 17:04:26 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"94","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T15:03:31Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.060","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"36.750","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"225.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.300","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"228.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"392.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"393.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"395.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 17:04:26 INFO (MainThread) [ocpp] RepHome-1: send [3,"94",{}]
2021-07-06 17:04:27 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"95","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2021-07-06T15:03:42Z"}]
2021-07-06 17:04:27 INFO (MainThread) [ocpp] RepHome-1: send [3,"95",{}]
2021-07-06 17:04:28 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"96","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available","timestamp":"2021-07-06T15:03:42Z"}]
2021-07-06 17:04:28 INFO (MainThread) [ocpp] RepHome-1: send [3,"96",{}]
2021-07-06 17:05:31 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"97","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T15:04:32Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.040","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"36.750","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"225.000","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"224.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"227.200","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"391.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"392.000","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"394.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 17:05:31 INFO (MainThread) [ocpp] RepHome-1: send [3,"97",{}]
2021-07-06 17:06:22 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"98","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T15:05:32Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.060","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"36.750","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"225.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"227.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"392.300","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"392.800","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"395.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 17:06:22 INFO (MainThread) [ocpp] RepHome-1: send [3,"98",{}]
2021-07-06 17:07:20 INFO (MainThread) [ocpp] RepHome-1: receive message [2,"99","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T15:06:33Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.040","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"36.750","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"225.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.200","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"227.900","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"392.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"393.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"395.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 17:07:20 INFO (MainThread) [ocpp] RepHome-1: send [3,"99",{}]

charger.Session.Time negative value

I get a negative value for charger.Session.Time

Version of the custom_component

Version 0.2 (code 6-7-2021)

Configuration

central
Open Charge Point Protocol (OCPP)
3 devices and 26 entities

sensors
"Energy.Active.Import.Register":` "Active energy imported from the grid", "Current.Import": "Instantaneous current flow to EV", "Current.Offered": "Maximum current offered to EV", "Frequency": "Powerline frequency", "Power.Active.Import": "Instantaneous active power imported by EV", "Power.Factor": "Instantaneous power factor of total energy flow", "Temperature": "Temperature reading inside Charge Point", "Voltage": "Instantaneous AC RMS supply voltage"

Describe the bug

I get a negative value for charger.Session.Time

charger.Session.Time
10 minutes ago
-153.722.867.253.819.900 min

Debug log

2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"49278991-dc53-4459-964d-e115f455d078","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"49278991-dc53-4459-964d-e115f455d078",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core,FirmwareManagement,Reservation,LocalAuthListManagement,RemoteTrigger,SmartCharging"}]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"3095f400-15e5-4e4e-8f46-cc87656e121b","TriggerMessage",{"requestedMessage":"BootNotification"}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"3095f400-15e5-4e4e-8f46-cc87656e121b",{"status":"Accepted"}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"c06070c5-f8a5-4d5b-bbdc-e07ab3b00947","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"c06070c5-f8a5-4d5b-bbdc-e07ab3b00947",{"status":"Accepted"}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"713f3172-e854-49f6-9dca-a4ebb2028282","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"713f3172-e854-49f6-9dca-a4ebb2028282",{"status":"Accepted"}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"ecfd42a4-07fe-48f8-a809-5cfd19ef30f0","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"ecfd42a4-07fe-48f8-a809-5cfd19ef30f0",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"30"}]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"f9b9a86d-fb08-4e53-ad50-87ed03fd831f","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"f9b9a86d-fb08-4e53-ad50-87ed03fd831f",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"60"}]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"ac159344-d472-474c-bce4-4616a998a841","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"ac159344-d472-474c-bce4-4616a998a841",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Current.Import,Current.Offered,Energy.Active.Import.Register,Frequency,Power.Active.Import,Power.Factor,Temperature,Voltage"}]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"3009a3cd-59cf-4fbd-a7cd-f02a2a5fe43c","GetConfiguration",{"key":["MeterValueSampleInterval"]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"3009a3cd-59cf-4fbd-a7cd-f02a2a5fe43c",{"configurationKey":[{"key":"MeterValueSampleInterval","readonly":false,"value":"60"}]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"26bf53aa-ee21-4ba2-b25d-871becc0fc93","GetConfiguration",{"key":["NumberOfConnectors"]}]
2021-07-06 16:10:51 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"26bf53aa-ee21-4ba2-b25d-871becc0fc93",{"configurationKey":[{"key":"NumberOfConnectors","readonly":true,"value":"1"}]}]
2021-07-06 16:10:56 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"8","BootNotification",{"chargePointVendor":"Alfen BV","chargePointModel":"NG910-60023","chargePointSerialNumber":"ace0025893","chargeBoxSerialNumber":"Reppel Beheer","firmwareVersion":"4.15.0-3910"}]
2021-07-06 16:10:56 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"8",{"currentTime":"2021-07-06T14:10:56.330803","interval":30,"status":"Accepted"}]
2021-07-06 16:11:36 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"9","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T14:08:31Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.050","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"34.875","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"227.200","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.300","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"228.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"394.900","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"393.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"396.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 16:11:36 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"9",{}]
2021-07-06 16:12:08 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"10","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T14:09:32Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.070","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"34.875","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"227.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"228.900","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"395.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"394.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"397.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 16:12:08 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"10",{}]
2021-07-06 16:12:29 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"11","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T14:10:32Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.050","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"35.000","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"227.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"229.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"395.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"394.800","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"397.500","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 16:12:29 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"11",{}]
2021-07-06 16:12:30 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"12","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2021-07-06T14:10:50Z"}]
2021-07-06 16:12:30 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"12",{}]
2021-07-06 16:12:31 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"13","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available","timestamp":"2021-07-06T14:10:50Z"}]
2021-07-06 16:12:31 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"13",{}]
2021-07-06 16:13:15 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"14","MeterValues",{"connectorId":1,"transactionId":9223372036854775807,"meterValue":[{"timestamp":"2021-07-06T14:11:31Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"},{"value":"1318920.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"50.010","context":"Sample.Periodic","measurand":"Frequency","location":"Outlet"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W","phase":"L3"},{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Factor","location":"Outlet"},{"value":"35.375","context":"Sample.Periodic","measurand":"Temperature","location":"Body","unit":"Celsius"},{"value":"227.800","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"225.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"229.300","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"396.100","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-L2"},{"value":"394.700","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-L3"},{"value":"397.400","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-L1"}]}]}]
2021-07-06 16:13:15 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"14",{}]

Maximum Current not working

Using v0.3.9, I used the Maximum_Current slider to set 10 A, which sent "limit":10.0 to the charger.
After that, clicking on the Charge_Control switch, "limit":32.0 was sent to the charger.
Is that correct behavior?

2021-09-06 20:31:39 INFO (MainThread) [ocpp] CHARGER: send [2,"98b3812a-7dae-40f7-affd-253b1831435f","SetChargingProfile",{"connectorId":0,"csChargingProfiles":{"chargingProfileId":8,"stackLevel":20,"chargingProfileKind":"Relative","chargingProfilePurpose":"ChargePointMaxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":10.0}]}}}]
2021-09-06 20:31:39 INFO (MainThread) [ocpp] CHARGER: receive message [3,"98b3812a-7dae-40f7-affd-253b1831435f",{"status":"Accepted"}]
2021-09-06 20:32:31 INFO (MainThread) [ocpp] CHARGER: send [2,"a874459f-24d6-4b4c-9c7f-efb779ce8ab2","RemoteStartTransaction",{"idTag":"CHARGER","connectorId":1,"chargingProfile":{"chargingProfileId":1,"stackLevel":20,"chargingProfileKind":"Relative","chargingProfilePurpose":"TxProfile","chargingSchedule":{"chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":32}]}}}]
2021-09-06 20:32:31 INFO (MainThread) [ocpp] CHARGER: receive message [3,"a874459f-24d6-4b4c-9c7f-efb779ce8ab2",{"status":"Accepted"}]

KeyError measurand

Hi I'm testing this integration on all the Alfen charge stations

have a Error in the log.
I have a Alfen Eve Single Pro-line - NG910-60023
OCPP 1.6

Error in log HA:

This error originated from a custom integration.

Logger: ocpp
Source: custom_components/ocpp/sensor.py:420
Integration: ocpp (documentation, issues)
First occurred: 14:43:32 (13 occurrences)
Last logged: 15:02:45

Error while handling request '<Call - unique_id=128, action=MeterValues, payload={'connectorId': 1, 'transactionId': 1624271340, 'meterValue': [{'timestamp': '2020-08-29T19:53:37Z', 'sampledValue': [{'value': '0.010', 'context': 'Transaction.Begin', 'unit': 'kWh'}]}]}>'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 185, in _handle_call
response = handler(**snake_case_payload)
File "/usr/local/lib/python3.8/site-packages/ocpp/routing.py", line 33, in inner
return func(*args, **kwargs)
File "/config/custom_components/ocpp/sensor.py", line 420, in on_meter_values
self._units[sampled_value["measurand"]] = sampled_value["unit"]
KeyError: 'measurand'

HA image: entity:
HA-Alfen-entity

Unknown values

Description:
it looks like my charger only returns total energy values when charging. The device is connected and heartbeat is passed consistently, but total energy values are not refreshed so HA starts to report ‘unknown’ after a while (despite showing the correct graph when checking the entity). Values start refreshing when charging.

No logs retrieved yet, if needed I can provide them.

Config:
HA running on rpi, Alfen pro-line charger in same subnet. Again: connecting like a charm and all functionality is working consistently and continuously

Support for secure authentication

We currently accept connections from any charger, and don't use any encryption. This may be ok for a private network, but is not acceptable when you connect to home assistant through a public network.

Hence, we should support password based authentication, and TLS for encryption.

OCPP Not working or i don't understand it.

Hi there,

Maybe we can add some documentation about what sensors do.
When I connect my wallbox to OCPP it goes into lock mode and enable the bool unlock doesn't do much. I have to turn of availability:

image

It's all prety unclear what switch does what. I also can't figure out how to pause charging and when i play to much with it my wallbox gets confused and bugged.

Refactor file structure

The current ChargePoint is an extension from ocpp.v16.ChargePoint. To enable entity services, and allow multiple chargepoint instances, a chargepoint should be modeled as an homeassistant Entity. There are two options:

  1. Use multiple inheritance to make ChargePoint both an ocpp.v16.ChargePoint as well as an homeassistant Entity
  2. Create a new new ChangePointEntity class that contains a occp.v16.Chargepoint object.

I prefer option 2, this makes it much clearer which methods belong to which interface, and avoids naming clashes.

Error in connection handler

Maybe you have a clue why this happens quite often.

Logger: websockets.server
Source: custom_components/ocpp/sensor.py:254
First occurred: 9:26:24 (42 occurrences)
Last logged: 9:51:27

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/websockets/server.py", line 191, in handler
    await self.ws_handler(self, path)
  File "/config/custom_components/ocpp/sensor.py", line 108, in on_connect
    await cp.start()
  File "/config/custom_components/ocpp/sensor.py", line 270, in start
    await asyncio.gather(super().start(), self.post_connect())
  File "/config/custom_components/ocpp/sensor.py", line 145, in post_connect
    await self.trigger_boot_notification()
  File "/config/custom_components/ocpp/sensor.py", line 177, in trigger_boot_notification
    resp = await self.call(req)
  File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 264, in call
    await self._get_specific_response(call.unique_id,
  File "/config/custom_components/ocpp/sensor.py", line 254, in _get_specific_response
    resp = await super()._get_specific_response(unique_id, timeout)
  File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 292, in _get_specific_response
    response = await asyncio.wait_for(self._response_queue.get(),
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

Used HA: Home Assistant 2021.3.4 (Home Assistant OS)
Used component: 35df000

Unexpected state class in HA core-2021.9.x

Version of the custom_component

"version": "0.3.7"

Configuration

Add your logs here.

Describe the bug

Unexpected state class
The following entities do not have the expected state class 'total_increasing'
sensor.charger_energy_active_import_register (measurement)

sensor.py

change (state_class: measurement) to  (state_class: total_increasing)
remove -->   self._last_reset = homeassistant.util.dt.utc_from_timestamp(0)


Error setting up entry central for ocpp

Version of the custom_component

v0.3.12

Configuration

Error occurs at the config flow, no additional YAML configuration.
image

Describe the bug

Error setting up entry central for ocpp.
This error occurs when trying to configure the integration from the config flow, with the default configuration.
HA version: core-2021.9.7
HACS version: 1.15.2

Debug log

Error setting up entry central for ocpp
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/ocpp/__init__.py", line 28, in async_setup_entry
    central_sys = await CentralSystem.create(hass, entry)
  File "/config/custom_components/ocpp/api.py", line 137, in create
    server = await websockets.serve(
  File "/usr/local/lib/python3.9/site-packages/websockets/imports.py", line 81, in __getattr__
    source = deprecated_aliases[name]
  File "/usr/local/lib/python3.9/site-packages/websockets/imports.py", line 26, in import_name
    assert level < len(source), "importing from parent isn't supported"
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/server.py", line 26, in <module>
    from ..connection import State
  File "/usr/local/lib/python3.9/site-packages/websockets/connection.py", line 17, in <module>
    from .frames import (
ImportError: cannot import name 'OK_CLOSE_CODES' from 'websockets.frames' (/usr/local/lib/python3.9/site-packages/websockets/frames.py)

KeyError: 'measurand' in new intergation

New Intergration not working.
I deleted the existing configuration in configuration.yaml.

Old intergation config

  - platform: ocpp
    name: charger_alfen
    meter_interval: 60
    monitored_variables:
      - "Energy.Active.Import.Register"
      - "Current.Import"
      - "Current.Offered"
      - "Frequency"
      - "Power.Active.Import"
      - "Power.Factor"
      - "Temperature"
      - "Voltage"
    port: 9000
    scan_interval:
      seconds: 60

New intergation version 0.2 (code copy on 06-07-2021)
What should I select now for sensors?
I have tried several sensors here...

Instantaneous current flow from EV
Instantaneous current flow to EV
Maximum current offered to EV
Active energy exported to the grid
Active energy imported from the grid
Reactive energy exported to the grid
Reactive energy imported from the grid
Active energy exported to the grid during last interval
Active energy imported from the grid during last interval
Reactive energy exported to the grid during last interval
Reactive energy imported from the grid during last interval
Powerline frequency
Instantaneous active power exported by EV
Instantaneous active power imported by EV
Instantaneous power factor of total energy flow
Maximum power offered to EV
Instantaneous reactive power exported by EV
Instantaneous reactive power imported by EV
Fan speed in RPM
State of charge of EV in percentage
Temperature reading inside Charge Point
Instantaneous AC RMS supply voltage

OCPP
Version 0.2 code copy on 06-07-2021

Describe the bug

KeyError: 'measurand' in new intergation

Debug log

2021-07-06 13:25:13 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"6587298c-1c82-4d09-b971-879ceb1a2ffc","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"6587298c-1c82-4d09-b971-879ceb1a2ffc",{"configurationKey":[{"key":"SupportedFeatureProfiles","readonly":true,"value":"Core,FirmwareManagement,Reservation,LocalAuthListManagement,RemoteTrigger,SmartCharging"}]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"b7a7d021-3dc2-4623-ba2f-b2a673c760cd","TriggerMessage",{"requestedMessage":"BootNotification"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"b7a7d021-3dc2-4623-ba2f-b2a673c760cd",{"status":"Accepted"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"e3b0076e-0755-49a9-9985-05d730097e91","TriggerMessage",{"requestedMessage":"StatusNotification"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"e3b0076e-0755-49a9-9985-05d730097e91",{"status":"Rejected"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"bfec5b10-bc79-441c-808a-23a83056f104","ChangeAvailability",{"connectorId":0,"type":"Operative"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"bfec5b10-bc79-441c-808a-23a83056f104",{"status":"Accepted"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"4270d34e-8edc-407f-a39f-cbd8baaa7eca","GetConfiguration",{"key":["HeartbeatInterval"]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"4270d34e-8edc-407f-a39f-cbd8baaa7eca",{"configurationKey":[{"key":"HeartbeatInterval","readonly":false,"value":"900"}]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"acb6712c-3564-4136-a759-28bd1fc83fd4","GetConfiguration",{"key":["WebSocketPingInterval"]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"acb6712c-3564-4136-a759-28bd1fc83fd4",{"configurationKey":[{"key":"WebSocketPingInterval","readonly":false,"value":"60"}]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"7f2755e3-605a-4fbd-9081-616be8b95858","GetConfiguration",{"key":["MeterValuesSampledData"]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"7f2755e3-605a-4fbd-9081-616be8b95858",{"configurationKey":[{"key":"MeterValuesSampledData","readonly":false,"value":"Energy.Active.Import.Register"}]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"63a1e8a6-704d-46d9-a9fd-fb511ad44deb","ChangeConfiguration",{"key":"MeterValuesSampledData","value":"Energy.Active.Import.Register,Temperature"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"63a1e8a6-704d-46d9-a9fd-fb511ad44deb",{"status":"Accepted"}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"72ec9fb8-d055-431e-8e70-7bda16f033d1","GetConfiguration",{"key":["MeterValueSampleInterval"]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"72ec9fb8-d055-431e-8e70-7bda16f033d1",{"configurationKey":[{"key":"MeterValueSampleInterval","readonly":false,"value":"60"}]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: send [2,"020b7647-3a7b-44b4-aaf0-e736f59fe580","GetConfiguration",{"key":["NumberOfConnectors"]}]
2021-07-06 13:25:14 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [3,"020b7647-3a7b-44b4-aaf0-e736f59fe580",{"configurationKey":[{"key":"NumberOfConnectors","readonly":true,"value":"1"}]}]
2021-07-06 13:25:19 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"1","BootNotification",{"chargePointVendor":"Alfen BV","chargePointModel":"NG910-60023","chargePointSerialNumber":"ace0025893","chargeBoxSerialNumber":"Reppel Beheer","firmwareVersion":"4.15.0-3910"}]
2021-07-06 13:25:19 INFO (MainThread) [ocpp] Alfen-Beheer: send [3,"1",{"currentTime":"2021-07-06T11:25:19.021947","interval":30,"status":"Accepted"}]
2021-07-06 13:25:53 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"2","MeterValues",{"connectorId":1,"transactionId":1625084784,"meterValue":[{"timestamp":"2021-06-30T20:27:07Z","sampledValue":[{"value":"1310.290","context":"Transaction.Begin","unit":"kWh"}]}]}]
2021-07-06 13:25:53 ERROR (MainThread) [ocpp] Error while handling request '<Call - unique_id=2, action=MeterValues, payload={'connectorId': 1, 'transactionId': 1625084784, 'meterValue': [{'timestamp': '2021-06-30T20:27:07Z', 'sampledValue': [{'value': '1310.290', 'context': 'Transaction.Begin', 'unit': 'kWh'}]}]}>'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 185, in _handle_call
    response = handler(**snake_case_payload)
  File "/usr/local/lib/python3.8/site-packages/ocpp/routing.py", line 33, in inner
    return func(*args, **kwargs)
  File "/config/custom_components/ocpp/api.py", line 473, in on_meter_values
    self._units[sampled_value["measurand"]] = sampled_value["unit"]
KeyError: 'measurand'
2021-07-06 13:25:53 INFO (MainThread) [ocpp] Alfen-Beheer: send [4,"2","InternalError","An unexpected error occurred.",{}]
2021-07-06 13:27:50 INFO (MainThread) [ocpp] Alfen-Beheer: receive message [2,"3","MeterValues",{"connectorId":1,"transactionId":1625084784,"meterValue":[{"timestamp":"2021-06-30T20:27:07Z","sampledValue":[{"value":"1310.290","context":"Transaction.Begin","unit":"kWh"}]}]}]
2021-07-06 13:27:50 ERROR (MainThread) [ocpp] Error while handling request '<Call - unique_id=3, action=MeterValues, payload={'connectorId': 1, 'transactionId': 1625084784, 'meterValue': [{'timestamp': '2021-06-30T20:27:07Z', 'sampledValue': [{'value': '1310.290', 'context': 'Transaction.Begin', 'unit': 'kWh'}]}]}>'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/ocpp/charge_point.py", line 185, in _handle_call
    response = handler(**snake_case_payload)
  File "/usr/local/lib/python3.8/site-packages/ocpp/routing.py", line 33, in inner
    return func(*args, **kwargs)
  File "/config/custom_components/ocpp/api.py", line 473, in on_meter_values
    self._units[sampled_value["measurand"]] = sampled_value["unit"]
KeyError: 'measurand'
2021-07-06 13:27:50 INFO (MainThread) [ocpp] Alfen-Beheer: send [4,"3","InternalError","An unexpected error occurred.",{}]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.