Modbus binding with Sunny Boy SMA inverter

No, I do not have the home manager, I only have the energy meter. And there I already have installed the binding. It works, but there is no total consumption value.

sorry for the late reply on this.
Unfortunatly you cant. You need to calculate it yourself. If you have the SMA energy meter, then you can get the current usage on each phases. Thats probably the best option.

Energy Meter will tell you the current (consumption) of each phases, Then you just have to calculate it to kWh´s (energy) :smiley:

Check your openhab log to make sure you get answers from the registers (channels) you´ve been adding.

In generel: Start simple. Modbus is not complicated, but it´s very easy to loose overview when dealing with many channels (things).
Make sure you have the correct registers. And know what data to expect to receive.

This is probably the best advices I can give.

1 Like

thanks for the answer I calculated it in that way:

  val Number TotalPower = (inverter1ActivePower.state as DecimalType
    + inverter2PreBatDischarge.state as DecimalType
    + inverter1PowerDrawn.state as DecimalType
    - inverter2PreBatCharge.state as DecimalType
    - inverter1PowerGridFeedIn.state as DecimalType)
  if ( TotalPower >= 0 ) {
    TotalPowerConsumption.postUpdate(TotalPower)
  }

But I will try your solution, too :slight_smile:

Just for documentation here …
I have installed the two inverters SMA Tripower 8 and SMA SunnyBoy Storage 3.7-10.

I uploaded all my configuration files to GitHub:

Also did a German documentation on my wiki:

2 Likes

thanks for sharing.
As a little feedback, get familiar with usingUnits of Measurement. Do not use [%s] everywhere in .items (but %d, %.0f etc). If you properly define the items with UoM you won’t need that [ ] part.

you are totally right :slight_smile:

could you please give me a hint how I could get it work without a state description [%.0f W]?
I changed the item type to Number:Power, but without [%.0f W] I don’t get the state description. I think the channel must support that, too?
Perhaps you have a tip for me, how to get that also working, so I could change my documentation.

You should be by default. But it depends where you are talking about it’s a complex question.
You can edit item metadata in UI (pattern field, same format ie [%.0f W])

fixed the Units of measurement stuff and also added somatic model tags to the items file. Update is pushed to GitHub and also documentation is updated.

Thanks again @mstormi for your feedback.

Thank you for the documentation.
I got this to work with my SMA SunnyBoy 2.5 on OH3
Looks like everything is working, except that the numbers don’t get divided.
Like for the “grid voltage phase L1” is displays 23123.00V instead of 231.23V
It looks like the smalimit100.js file is not used.
Could you help me with this?

Where did you put it?
Have you installed the JS transformation add-on?

That’s it, forgot those add-ons.
Now it works fine.
Thank you for the fast response.

Excellent work @alaub81 !

I have the same issue, and migrated to openhab3. The modbus is working but the values are off.
Does some one have this working with the modbus binding?

Yes I’m even selling an Energy Management System to use it.
You can download the demo and extract the config.

Thank you for the response, can you point me to the correct folder? I did download the demo but was unable to find the openhab folder.

Thanks!

Click System, Photovoltaik to select your inverter and the things/items will be created and appear in Main UI.

Thanks for all the input and the good documentation of the things and items.
But I’ve got one more question.
What about the decimal places? You use a int32 type. For things like daily total production there would be nice to see 10,252 kWh instead of 10kwh.

Is it possible to change it?! Any ideas or solutions?

Thanks

Hi Andreas,
thanks for your work.
I followed your documentation to communicate with my Sunny Tripower 6.0.
But unfortunately all things except the “SMA Inverter 1 Bridge” show : ERROR: Bridge
They seem to be on the wrong bridge. Do you know where this problem could come from?

Greetings Johannes