Solution: Controlling OCPP charger through Home Assistant REST API #18414
mfuchs1984
started this conversation in
Solutions
Replies: 4 comments 18 replies
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
|
I have a Wallbox Pulsar Max which is working heratic using the evcc template, so I am thinking to give a try to your solution, but I am concerned that I read that also the OCPP add-on is not working well with my charger. What do you think using instead the standard Wallbox integration and adapt your custom charger accordingly? Wouldn't be more stable? Could be that the API call to wall-box may involve a too hifh delay making evcc unable to optimize the solar surplus? |
2 replies
@mfuchs1984 this is outdated. Optional support for "relative" was added. |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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: trueis configured) and stops charging by setting the current limit to 0.The Home Assistant integration usesEVCC allows to optionally use relative profiles since Ocpp: add optional support for profileKind "relative" #22139"chargingProfileKind": "Relative"while evcc uses"chargingProfileKind": "Absolute"."chargingProfilePurpose":"ChargePointMaxProfile"and in case of rejection falls back to"chargingProfilePurpose":"TxDefaultProfile"while evcc uses"chargingProfilePurpose":"TxDefaultProfile". See https://github.com/lbbrhzn/ocpp/wiki/Charge_automation#adjusting-the-charge-current and The right way to adjust charge current with a slider lbbrhzn/ocpp#1566 for more recommendations on the profiles and how to influence which type is used.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.
All reactions