Alternative EVCC integration via MQTT

I’m a big fan of the EVCC binding and have used it for years, but since I’m impatient and always keen to run the latest EVCC versions, I’ve set up a direct MQTT integration instead.
It takes a bit of effort to configure, but it works flawlessly, and in fact, control is even more direct than through the binding.

For anyone interested, I’ve attached a complete example setup (Things, Items, Sitemap) for OpenHAB, covering:

  • Site data (PV, grid, battery, home consumption)

  • Two loadpoints with available control & monitoring

  • Vehicle info for two vehicles and charging session infos

evcc_mqtt.items.txt (11.3 KB)

evcc_mqtt.things.txt (11.4 KB)

evcc_mqtt.sitemap.txt (6.0 KB)

support has been added in daily snapshots (5.0) and an extensive rewrite is almost merged, please help test with these jars from the link above if possible

This mqtt approach is also a nice method to get all sorted. I do think it will cost more maintenance in the long run.

Totally fair points, many thanks! I’ll also test the updated binding with the 5.0 snapshots/JARs.
I hope you’re right about long-term maintenance being easier; for me it really hinges on whether EVCC keeps introducing breaking API changes. That part is frustrating, even though EVCC itself is fantastic.
I built this as a quick workaround since I already had MQTT running, and it worked really fast.
That said, figuring out the correct channels/items took more effort than expected, so yes, the binding is definitely the better way in the long run.

Continuing the discussion from Alternative EVCC integration via MQTT:

Hello,

thanks a lot for this great peace of work. As I prefer file base openHAB configuration and the documentation of the new EVCC-Binding does not mention how to define things and items in files MQTT sounds as a great alternativ way to integrate EVCC inb openHAB.

That’s wrong, of course it does: evcc - Bindings | openHAB

I used this binding until the recent EVCC update to 0.209. In the Add-on Store I see a new binding “Evcc Binding [4.0.0;5.0.0)” which is mentioned to be needed as of EVCC 0.207.0 (“Please not that in evcc 0.207.0 there is a breaking change in the API, users need to intsall this binding instead of the old one!”).

So I tried the new binding also and it seemed to work when things and items were created the UI, but I did not find infos how to define them via files and the “old” .items and .things file did not work with the new binding.

EVCC via MQTT works very well for my needs. Maybe I’ll give the dedicated binding a try in the future, but for the time being MQTT is Ok for me.

I guess you’re mistaken here. There’s no 2 different evcc bindings.
The very same documentation applies and works.
The marketplace version is just the forerunner before it gets updated in OH.
This just takes quite some time while anyone author can update the marketplace instantly.
Moving to MQTT complicates many things, relies on more components and means a lot more maintenance type of work users have to master.
That’s why we as a community really should not advocate that as a general solution.

Thanks for clarification. I mixed some things up and to me it was not clear that the “emergency binding” did not introduce new configuration syntax despite the EVCC API changed.

I agree that MQTT adds complexity compared to a dedicated binding. But this way I improved my MQTT knowledge which could be useful for the upcoming heat pump. :wink: