Kostal Enector Wallbox mode maintained from home assistant

Dear community,
I use the Kostal Plenticore Integration within Home Assistant and it works just perfect.
My installation does not only contain a Kostal Plenticore 8.5 Plus inverter, I do also have the Kostal Smart Energy Meter and the Kostal Enector Wallbox.

There is one piece of functionality I’m missing. The Wallbox has certain modes for loading the car battery:

  • Lock mode (e.g. to pause loading)
  • Power Mode (load with max speed, even if it from grid)
  • Solar Pure Mode (loads only the excess solar energy to the battery and does not “purhase” energy from the grid)
  • Solar Plus Mode (loads as soon as there is a certain amount of solar energy reached, and tops it up with grid power)
    (This is a quick and dirty description, there might me more details to it :slight_smile: )

The issue that I am facing now: The Kostal Smart Energy Meter is not as smart as it should be. This means they handle battery power equally as solar power in this calculation. This means if I connect the car in the evening to the wallbox, it instantly sucks emtpy my battery system in solar pure mode (as it is treated as “solar power”).

I would like to have more control about loading and e.g. set the wallbox mode to “Lock” every evening after sunset, to leave the battery system for house energy usage. Home assistant could help me to set this lock automatically and to release it the next morning as soon as there is enough excess power.
(The car is hybrid and only in use every 2-3 days and therefore it does not have to be loaded instantly it is connected.)

To set and release the lock manually each day is a big pain in the a**.

So is there any idea on how to access this enector mode via home assistant?
I already integrated the wallbox via modbus according to some tutorials - but this are all read only values and do not even cover reading the loading mode.

So I think the only way might to be via the Inverter / KSEM integration to extend it (as the mode itself can be selected on the KSEM web interface):

Thanks a lot,

Thomas

Hey Thomas,

I faced the same challenge :wink:

My final solution is now realized via the REST API that also the local webserver APP from the KOSTAL Smart Energy Meter is using.

Using a http request (with a bearer authentication) allows to do everything, that you can interactively do with the webapp.
To integrate those requests in HA you can use several ways. I choose a Node-Red solution.

  1. bearer certificat needs to be called @ http://192.168.178.161/api/web-login/token (IP of the KSME), “content type”: “application/x-www-form-urlencoded”, with payload: {“grant_type”:“password”,“client_id”:“emos”,“client_secret”:56951025,“username”:“admin”,“password”:“YOUR PASSWORD”}
    The result of these request will be the bearer token. Add to this token the “Bearer “ as a string.
  2. PUT request @ http://192.168.178.161/api/e-mobility/config/chargemode with basic bearer authentication token from 1st step, with payload: { “mode”: “pv”, “mincharginpowerquota”: 0, “minpvpowerquota”: 100 } (possible modes: Lock, grid, pv, hybrid for the four modes)
  3. GET request, with same payload, to read the current state.

I reverse engineered it by using the developer tool of chrome when using the Kostal webInterface. In the network chapter one can see the traffic between KSEM and browser. Any action is logged. Looking on each action you can identify the messages that are forced by your interaction. One can see the endpoint URL and the corresponding payload…

If you have further questions, just ask!
It was an eye opener for me, because you have now all degree of freedom. No need for the modbus interface, no need for the hardware switch (I started with)!

BR,
Lars