EVSE Keba P30 integration

@dannerph, Did you get anywhere with this? If not, I now have a working implementation which I could submit a PR for (one for keba-kecontact and one for home-assistant core).

Sorry, I had not time so far.
Very nice @matli, I would suggest to first PR the keba-kecontact, then I can update the version at pypi. Afterwards you can create a PR to home-assistant core, we also need to update the documentation at home-assistant.io (I can help here, I suppose you just added a service call for that).

I just checked your code, seems to be good, just two small questions:

  • in homeassistant/components/keba/init.py line 248 is the self._set_fast_polling() required? It should be set, in case you push some commands to the wallbox (e.g. set current) and you require a faster polling interval to update the state of the wallbox (e.g. if the current is now set correctly). Correct me if I am wrong, but I think the displayed text is not part of the status reports, that are fetched, thus from my point of view no fast polling is required.
  • concerning keba_kecontact/connection.py have you tested how the wallbox reacts in case the time is negative or the text is longer than 23 characters? In case it produces an unwanted behaviour, we should check an avoid this here.

You are right, we could probably skip the _set_fast_polling(). Regarding the text length, I only use text[0:23]. I will try to find out what will happen if we submit negative values. But maybe we should clamp it to 0 in any case?

We should follow the UDP programming guide:

  • times should be between “min-time = 2 sec, max-time = 10 sec” if not raise a ValueError or clamp to the minium/maximum.
    Edit: I think I got this wrong, what is the minium and maximum time the wallbox accepts? For all the other commands it is given in the document 


Concerning the message length, the official UDP programming guide is little bit confusing, it states: “Text shown on the display. Maximum 23 ASCII characters can be used. 0 
 23 characters”. So is it 23 characters in total or 0 
 23 characters starting to count from zero, so in total 24 characters?

I have done some tests now:

  • The times appear to be unsigned 16-bit values with wraparound. So 65535 leads to a long time, while 65538 gives 2 seconds.
  • It seems to be ok to send the value 0, and to let min time be larger than max.
  • Negative values are not ok. I had to power cycle the charger in order to get it back to normal and stop displaying “RĂ€ksmörgĂ„s!” for ever.
  • The text is truncated to 23 visible characters.

I will update the code accordingly!

2 Likes

Great! “RĂ€ksmörgĂ„s” FTW :slight_smile:

Your PR of keba-kecontact is merged and I pushed it to pypi. You can now PR the changes to home-assistant core.

Great! I’m away for a couple of days, but I will look into it as soon as possible.

Hi all, checking how the text to display is doing? Curious if this Is this something to be expected in near future release? :slight_smile:
Cheers

It has been merged to HA core, https://github.com/home-assistant/core/pull/36056, so it should appear in an upcoming release soon. :slight_smile:

1 Like

Hi Matli,
The text to display feature works really really great, many thanks!! :smiley:
Btw. it adds a space and an exclamation mark after the text? Does not matter for me but is that by design?

1 Like

I’m glad you like it :slight_smile:

That exclamation sign seems odd. I have not seen it on my charger, and it is not expected. Does it happen on every message you send, regardless of content or length? Do you know the firmware version of your charger?

Hi Matli, sorry my fault, for some reason the exclamation sign sneaked in my automation yaml.
Again, many thanks again :slight_smile:

Hi Philipp,
thank you so much for your nice KEBA integration! I am using it with automations since weeks and everything is fine so far.
I wonder if i could integrate multiple charging points. I have three more in our Company which i would like to control in order to maximize the use of our PV-energy.

I tried a configuration.yaml like this:

Example configuration.yaml entry

keba:
host: 16.132.84.171
rfid: XXXXXXXX
failsafe: True
failsafe_timeout: 30
failsafe_fallback: 10
failsafe_persist: 0

host: 16.132.84.170
rfid: XXXXXXXX
failsafe: True
failsafe_timeout: 30
failsafe_fallback: 10
failsafe_persist: 0

I had no success because the station with ip .170 overruled the .171 at the end.

Is there a possibility to use your integration for more than one charing point?
Thank you very much!

2 Likes

Hi Thomas,

currently only one wallbox is supported as I only have one at my (test) site :wink:
However, I plan to work on the configuration workflow when I find some time, so adding multiple wallbox support might be good opportunity to work on.

Multiple wallbox support will most probably be a breaking change for all users, thus was not yet considered as separate PR by me. For me it only makes sense to combine this breaking change with the ability to add wallboxes via the web frontend.

Greetings
Philipp

I am currently using Openhab for controlling my Keba wallbox but I would rather use Home Assist. Is it possible to give some pointers on where to start? Is there nothing to install? I have added keba: and the host to my config file but then?

Hi @kave,
once you have setup the host and optional rfid (required for control services), relevant sensors and services are added to home assistant automatically. You just need to integrate them into the UI and/or automations (e.g. for changing charging power accoring to PV power).
In case they are not shown up, please provide us your log file.

It would be nice if this integration could be used by the new energy framework. I believe it would be a good starting point to add state_class=measurement, last_reset and device_class=energy to the total_energy entity. Is total_energy ever reset? If not, last_reset can be constantly set to the epoch. More details at https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics

I just made these changes as described, and they appear to work fine. I will try to submit a PR soon.

2 Likes