Charging openHAB with OCPP

Plus also for a working binding that allows for an ocpp server for starting unlocking and stopping plus dynamic power adjustments. It would be nice if an dev can chime in.

1 Like

I was able to establish a connection from my wattpilot to the OCCP server.
It also found my wattpilot as charger but got stuck in init state.

the binding is not finished the only thing it does it create the ocpp server and listen something like that

I am very interested in the binding to control charger according to rules (on / off / unlocking / charging current control).

I have no java experience and can not contribute to binding development. So with my minor skills in python I made a small python code which runs as a daemon. It communicates with OH via mqtt (receives commands and sends readings), while OCPP is implemented by this library GitHub - mobilityhouse/ocpp: Python implementation of the Open Charge Point Protocol (OCPP).

I think this is as far as you can reach get right now until @splatch get hold of chargers to test. Ocpp is complicated and implemented differently by each manufacturer one has this feature available the other not even trough they both talk ocpp 1.6 you will see that python library has it’s limitations of how many brands it supports try home assistant it uses that library and my charger did not work with it so I got back to openhab and found a charger that has modbus and everything was was good. I am not trying to push anybody away but if the developer doesn’t have access to hardware it’s very difficult to make it work.
I had a wallbox that I could not made it work with anything but their undocumented cloud api and stumbled upon a python library and also came to the same solution as your by using that and then push the messages to mqtt back and forth to openhab but for me the problem was that if the internet is not working the whole think is useless so 
 I did not publish anything on the forums but if someone is interested I can put it here how I did it.

It would be possible to try this addon on openhab 4.1.0. How could I install it?

I have to make a new build. Eventually, you can try making a build yourself based on 3.4.x branch.

Hi Jari,

I have a PV installation using SolarEdge inverter and grid meter together with an ABB Terra charger and I am trying to run the whole set up using the evcc softaware and binding, which requires modbus connection with all components.
I managed to establish proper modbus connection to my Inverter and meter, using both the modbus or evcc bindings.
However I cannot establish modbus communication with the ABB Terra charger.
I can connect to the ABB charger using the ABB Charger Sync and the TerraConfig applications over Ethernet or WiFi without problem.
But when I try to connect over modbus/TCP (using Ethernet or Wifi) the connection is refused.
Could you please assist me with some info how to get this connection running?

I am using OH 4.1.0

Thanks
Andreas

Hi Andreas,

What is your Terra model, i.e. does it have a display? Not all Terras have Modbus TCP. I think that the Terras without a display don’t have Modbus TCP. At first I had a basic Terra without a display and I was in contact with ABB Finland and they told that it doesn’t have Modbus TCP so I had to get a Terra with display (ABB TERRA AC W22-T-RD-M-0). If your Terra has a display then most likely it has Modbus TCP. I’m now in Juelich and will be back at home on Friday so I can then check the Modbus settings. This is done

Hj Juri

Thanks for the quick reply.

My Terra charger is the TACW2240922t1035 and it is without display.
You are probably right that this model does not support modbus TCP because this thing is driving mr crazy. I tried all sorts of things without any success.
Unfortunately it is not very easy to get information and advise from ABB in Greece, from where I bought the charger. Maybe ABB in Finland know better.
The strange thiing is that you are the first source of information that tells me about such a problem. Besides ABB in Greece, who never suggested anything like that, I never came across such information in any of the ABB manuals and instructions, regrding the modbus connection, that I have read so far.
Also when I try to connect, it appears that there is initial connection with the charger but I always get the message that connection is refused.
I do not know if any other person in this forum has faced the same problem.
I any case I will try to verify this with ABB in Greece.

Hi Andreas,

I looked at my email discussion with an ABB expert regarding the Terra charger. This guy told that only Terra chargers with a MID certified energy meter have Modbus TCP. I haven’t checked whether any Terra charger without a display has a MID meter so you need to check whether your Terra has a MID energy meter.

I have to say that ABB Terra datasheets are really misleading because they say that Terra chargers have Modbus. This is only partly true because Terra has Modbus RTU but this is only for a communication between Terra and an external energy meter for load balance so Modbus RTU is not for communication between openHAB and Terra. I also made a mistake when I bought my first Terra without a MID meter. Only afterwards I realised that it doesn’t have Modbus TCP so I bought another Terra with MID. Somewhat annoying situation. Hopefully this helps.

Thanks Jary

I am now certain that you are correct and I will check if my charger has the MID meter.

Coming back to this fairly old topic with an inquiry to all interested parties. There was some work related to dependency updates in connectorio-addons. Since I’ve ran into some troubles with OH 4, and I have to prioritize work somehow, I would like you to register ticket “Support ocpp for openHAB X”. Other people can vote tickets up in github: Issues · ConnectorIO/connectorio-addons · GitHub.

For X pick openHAB version (3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, 4.0.x) of your interest.

Hi Juri,

I thing it would be nice to post an update with my findings regarding the ABB Terra wall box working with modbus, just for information for you and any other person interested in this.
To start with, you are absolutely correct in saying that only the ABB Terra chargers fitted with a display can work with modbus TCP. ABB Terra chargers without display do not include the MID meter and therefore cannot communicate over modbus TCP.
Fortunately there is an easy and cheap solution to this problem since chargers without a display can communicate over modbus RTU.
In this case it is enough to purchase and install a Modbus RTU to Modbus TCP gateway to convert RTU serial signal back and forth to modbus TCP signal.
In my case I used the " PUSR - DR302 Modbus Gateway with Modbus RTU to Modbus TCP RS485 to Ethernet Converter" (cost around 25 euros from Amazon.de) which worked just fine.
This unit requires 5V DC power, which is readily available in the ABB Terra and can easily fit inside the ABB Terra. (Other units working with 230V AC power supply are also available)
It is just necessary to connect the RTU terminal of the ABB Terra to the RS485 terminal of the gateway and an Ethernet cable from the gate way to your local internet router providing internet access to OpenHAB server. (I am using evcc binding in openHAB.)
Of course it will be necessary to do small programming of the gateway (to define proper serial communication data such as baud rate, parity etc and also to define the gateway’s IP address and gateway address of your router.
You need to download two small software packages in order to program and test the gateway.
After that you only need to setup evcc for operation over modbus TCP (using openhabian-config or manually editing the yaml file) and everything should be fine.

Good to hear that you got Terra working with Modbus RTU. I thought that RTU is only for communication with the load balance electricity meter because this is what I was told by ABB so it seems that even ABB people don’t know the details of Terra.

The RTU terminal on the TERRA is primarily for connection to the external electricity grid meter, in the case that you want to use the ABB config application for setting up and using load balancing. Unfortunately this is working only with ABB electricity meters ( full control) and a couple of other meters ( partial control).
In my case I had already installed the SolarEdge meter that works perfectly with my SolarEdge inverter but does not work with the ABB application. This is the reason why I had to use the evcc software that can utilize a very big combination of inverters, meters, vehicles, chargers, and even home batteries.
If you do not use the RTU terminal on the TERRA for connection to the meter, then you can use it for comunication with any other device over modbus RTU or over modbus TCP if you use and RTU to TCP gateway.

Hello, did the developpement for a OCPP binding died? I’m currently to buy a ev charger and found out there’s no binding at all for openhab except a few available only in europe/germany. OCPP could change that.

Thank you

I myself implemented standalone OCPP-to-MQTT service, so that openhab can control charging via the MQTT. Sure, binding would be best option, but easy workaround exists.

1 Like

Oh, do you have something that you could share?

I implemented standalone linux service OCPP-MQTT using this library:

GitHub - mobilityhouse/ocpp: Python implementation of the Open Charge Point Protocol (OCPP). ](https://github.com/mobilityhouse/ocpp)

If you are interested I can clean up the code and post my implementation example

2 Likes