Python library and Home Assistant integration

A couple of months ago I wrote a Python library and custom home assistant integration for Evnex chargers.

The evnex Python library can be used to communicate with the evnex api from a Python program or script. It can be installed using: pip install evnex

The Home Assistant integration can be installed from the Home Assistant Community Store, or manually using the source code from https://github.com/hardbyte/ha-evnex

Once authenticated, the integration creates a device in Home Assistant for any chargers you have access to. Each charger exposes a bunch of sensor data, and a switch to control starting and pausing of charging.

Some of the data exposed to Home Assistant can be seen in the screenshot:

2 Likes

Thats awesome. Having this integration will be the reason I buy an evnex charger. Being able to start and stop the charger based on the charge percentage of my Sonnen battery and solar charging rate will be a game changer. Thanks!

1 Like

Hey, Interested in obtaining some of the data from the EVNEX Charger. Where did you manage to get the Client ID and Secret from on CP-Link? I can’t seem to find it:

Hi Bruce.

These are part of the Enterprise subscription to CP-Link. The python library described in this thread uses the driver app endpoints which have different access controls.

Regards,

Tom

Talking to Mitchell @ Evnex you don’t support controlling the charger with an external OCPP server. He pointed to this as a way to control it from Home Assistant.
I realise it isn’t officially supported but does Evnex plan to allow the way this integration works in the longer term? I don’t want to go to the expense of buying/installing the charger and setting up Home Assistant integration only to find that Evnex change their mind and block access.

1 Like

Hi Peter.

There are no plans to block access, but we don’t test against this library when making changes so may unintentionally break things. The endpoints tend to be pretty stable in this part of the code so haven’t changed much in recent years.

Kind regards,

Tom

This library is really cool. There is an option to set the charge current but it doesn’t seem to work. Am I doing something wrong or is there something I have to enable

thanks

I am interested in this integration as well and have a few questions re functionality:

  • Is there any way to use this without the cloud API and just local network access?
  • Is there a control available to change the power setpoint, e.g. reduce or increase charge rate?
  • Can the mode be changed, e.g. track solar excess energy or charge using grid energy?

I’m afraid I don’t use the integration so I don’t know all the answers, but:

  • It definitely can’t be used locally.
  • I don’t think the charge rate can be controlled but I’m not sure.
  • I’m not sure if the HA plugin can do this but the Evnex driver app can so hypothetically it could be made to work with HA.

Kind regards,

Tom

Anyone knows if this integration with Home assistant is still working?

Still working for me - I didn’t want to invest heaps of my personal time getting it working for older versions of Home Assistant but if you’re on 2024.5 or newer and running into issues let me know and I’ll try take a look. I mostly just use it to collect data and occasionally toggle it to “charge now”.

I am using HA version 2024.10.4 with version 0.5.3. After integration and signing in, it indicates a failed setup. Below is the error message log. If this is a straightforward fix, I’d be more than happy to buy you a coffee in appreciation for the help!

Can you try the latest pre-release of the integration? I’ve just tried with the latest ha core (v2024.11.1) and version 0.6.0a3 of the evnex integration is working. Otherwise there is likely a dependency conflict with another plugin because the python environment is shared globally in home assistant.

The reason I haven’t tagged the v0.6.0 final version is many core plugins for homeassistant rely on a very popular library called pydantic that I heavily use in the evnex library. I used the latest stable release which unfortunately can conflict with the version required by some integrations.

The core ha team is having to update all the core integrations before they can update to the v2 version of pydantic - after more than a year they appear close in Pydantic v2 migration issue · Issue #99218 · home-assistant/core · GitHub