[APP][Pro] Alfen - Optimal Charging, Smarter Homes: Powering Efficiency for You and the Grid

Tried it today with another tool. But it looks like they use Certificate Pinning. So can’t use that to sniff the network calls. Maybe I will try to contact Alfen to see if they are willing to share their API definition. But otherwise I don’t know how to figure out which API requests to use. Have found the current calls somewhere on the web, but didn’t find any calls to set settings…

With Home Assistant it is possible to control the Alfen. I think.
Maybe you can get the needed info here:

I’m just guessing. I wish i know more about this myself.

1 Like

Thanks, this will definitely help and looks quite well documented.

Main features to implement in the new version:

  • Actual power usage
  • Setting green share (how much green energy minimal to use 0 - 100%)
  • Setting comfort charge (how many kWh allowed to charge without redelivering green energy)
  • Reboot wallbox

Any more requests / use cases?

2 Likes

Yes, stop charging after xx kWh or set to power = 0 Watt after xx kWh or pauze/delay charging after xx kWh to far in the future so the end result is the ability to stop charging after xx kWh of added energy

These would be perfect. especially switching between green and full power would be fantastic!

Let me know if you give us the opportunity to get you a beer for the work!

Open to testing as well.

This would be great! Start and stop would also be nice. Don’t know if that is possible.
Thanks for the great work!

Maybe iso setting the kWh for comfort or delta, can we flexibly set any power rating? I would then just continuously check how much power is going into the net and pass that to the car.

Thanks!

It is available now as test version! :partying_face:

1 Like

Thanks will test!

What do I do with the CLI version? Do I have to reinstall that one first?

Met vriendelijk groet / with kind regards
Patrick van Deursen

1 Like

You can just install this version, it will replace the CLI one. Don’t know if you need to remove the old device and create a new one. That depends on which version of the CLI one you installed :slight_smile:

Working!:+1:t2::+1:t2:

Perfect!

I am able to add the charger. I own a Alfen Eve Single Pro. Great work so far!

For now I wont actively use it, but might do so with a next, more advanced version including more control options.

Due to my network setup the Alfen Charger and Homey are in a different VLAN. The Charger is controlled with EVCC, giving easy control options, for example based on tarrif. Or the option to switch between charging mode Solar and Fast. All is done by MQTT if you use EVCC for this. And EVCC and Homey communicate by MQTT as well, allowing both reading of values and controlling by Homey.

This VLAN restriction of Alfen is a pain. I read something to solve it, but that would mean to allow more traffic between both VLAN’s, which I am trying to prevent. Unfortunately this makes it impossible for me for now to connect both EVCC and this Homey app.

Controlling with EVCC has my preference for now, but will definitely follow developments here and might switch to this app over EVCC. Who knows :wink:

Working like a charm, great job! Going to charge tonight so will see how Energy Dashboard integrates

Update: also Energy Dashboard working perfect

@MrDutchfighter Love seeing your progress! :rocket:

We’re in touch with Alfen about an integration, but they’re unsure about the technical side of things and have pointed us towards Modbus. How about we connect and see if we can get some official support from Alfen for your Homey app? Would love to make this happen! > partners@athom.com

8 Likes

Any update to if you were able to get a talk with Alfen? Looking forwards to the next steps🤞🏻

2 Likes

I’m happy to share that I have a first version where you are able to set the requested properties (some through UI, and all are available in flow cards):

  • Authentication Mode (switch between free plug & charge and RFID authentication);
  • Charge Type (Normal, Comfort, Green)
  • Comfort Charge Level (when charge type is Comfort, this is the minimum that will be charged regardless of how much redelivery takes place)
  • Green Share (% of how much green energy should be used (I think applied when you set your thing to green… but not sure :slight_smile:))
  • Current Limit (1 - 32A): It can’t be set to 0. So the only way to fully stop charging is probably switching the charger to Charge Type: Green.

I haven’t been able to test everything. But it seems to be working. Any feedback is welcome through either GitHub, PM or here in the thread.

Please note that changing your settings of your charger is fully at own risk.

2 Likes

that is fantastic!!! Will have an immediate look.

making flows worked, however, switching to green worked once. After that I get a time out/network request failed.

Some time later (like 5 minutes) I am able to switch again, once. Apparently it is blocked to switch too fast?

Maybe a bit more random (the timeout). Maybe it is my network. Is it possible to check of that is happening, so I can send the request again.

However good news it works! You are fantastic. Where is the option for a beer😀

Good to hear that it is working! A donation is much appreciated and can be done through the donate button on the app page! :slight_smile:

With regards to the timeout thing. The connection with the charger is a bit ‘unstable’, in the sense that only ONE connection is allowed at the same time to the charger. This means that when you are logged in through your smartphone app, or when you are logged in through another device, you can’t login / retrieve data through Homey. I tried to build some kind of check to give proper errors, but it is not always that straighforward.

The same might be if you send a couple of commands back to back or synchronously through Homey. Then it might be that it tries to login twice at the same time. I added some checks and parallel processing in the app in the hope to prevent this… but there might be times that that fails.

If it happens, can you try sending a crash report straight after? Then I can see if there is enough debugging info to see if I can make the connection even more stable.