Solution: Controlling OCPP charger through Home Assistant REST API #18414
mfuchs1984
started this conversation in
Lösungen
Replies: 1 comment
-
@premultiply can we fix these?
@mfuchs1984 sure! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Intro
Motivation
In several discussions and issues, people had problems controlling their OCPP chargers through EVCC. In those cases, spec violations of chargers turned out to be the reason. On the other hand, some people claimed that their chargers are controllable through the Home Assistant custom OCPP integration. So just for the pleasure of learning something, I created a custom charger boilerplate to integrate such chargers through the Home Assistant REST API.
Main differences
The main differences between the EVCC OCPP integration and the Home Assistant integration are
remotestart: true
is configured) and stops charging by setting the current limit to 0."chargingProfileKind": "Relative"
while evcc uses"chargingProfileKind": "Absolute"
"chargingProfilePurpose":"ChargePointMaxProfile"
and in case of rejection falls back to"chargingProfilePurpose":"TxDefaultProfile"
while evcc uses"chargingProfilePurpose":"TxDefaultProfile"
Among others, these differences might explain why some chargers work in Home Assistant but fail in EVCC (and maybe the other way around).
Prerequisites
api:
to your Home Assistant configuration.yaml, see https://www.home-assistant.io/integrations/api/)Add the charger to your evcc.yaml
Custom charger boilerplate
Add the following declaration to your evcc.yaml.
<CHARGER_NAME>
with a charger name of your choice.<HOME_ASSISTANT_IP>
with the IP of your Home Assistant instance<YOUR_BEARER_TOKEN>
with the generated "Long-Lived Access Token"charger_
(examplecharger_status_connector
), change the prefix so it matches your installationOptional custom charger meter boilerplate
Optionally, add the following meter configuration to your evcc.yaml. In case no meter entities are available, evcc is able to run without it. It will then take the set current as charge current as a fallback. If single meters like power, energy, currents or voltages are not available, just remove the corresponding section. Units may also differ, so changing or adding might be necessary.
<CHARGE_METER_NAME>
with a charger name of your choice.<HOME_ASSISTANT_IP>
with the IP of your Home Assistant instance<YOUR_BEARER_TOKEN>
with the generated "Long-Lived Access Token"charger_
(examplecharger_status_connector
), change the prefix so it matches your installationAdd charger to loadpoints
In case meters are available, use
otherwise
@andig if this helps a couple of people, I could try to create Home Assistant OCPP API adapter templates.
Beta Was this translation helpful? Give feedback.
All reactions