Modbus binding with Sunny Boy SMA inverter


What’s the price of the LG resu 10 KvA battery ?

Is it profitable compared to its price?

This is going to be a long (and off-topic) message…

The price in 2017 when I bought it was aprox 52.000 Dkkr.
In a principal matter, every battery is profitable, if you can charge fully it and fully consume it, specially in Denmark with it´s stupid prices and taxes on power. And if you´re in Group 5 (which I am), you´ll get nothing for power you over-produce. So you´ll either have to serve the Grid for free, or try saving the power somehow.
If you´re in Group 6, you´ll have to do a very advance calculation.

Beeing in group 5, I used a very simple calculation:
I´d calculate from the battery cost, and how much power our household consume, after the sun has gone down. The Resu 10 is suppose to live for 20 years (noone really knows for sure, but I´m counting on it). It´ll loose aprox 20% of its capacity in that period.
If your household doesnt consume much power after sunset, the benefit will be less, and problably not worth it at all.

Our household consume aprox 13kWh from sunset till sunrise. Taken from the aprox price in kWh, it´s aprox (13 * 2.26 dkkr = 29,30 Dkkr a day).
20 years have 7.300 days. The price I would have paid in 20 years (wihtout battery) is 213.890,- Dkkr.

Since the Resu 10 is only 9.8kWh I calculated that savings also which is 9.8 * 2.26 = 22,15 Dkkr a day. And in the periode of 20 years, it´s 161.680,- Dkkr.
This is what the optimal battery of the resu 10 would have saved in 20 years. But you´ll have to consider the 20% loss, as well as the battery wont fully charge every day in the 20 year. Both are consider very difficult to calculate, cause it also means you´ll have to calculate from your solar power production as well.
In an optimal day, it takes aprox 4 hours for the solar system (my system) to fully charge the battery, cause my battery charger can only charge with max 2500 watt.
Since we get at least 4 hours of sun every day, every day is, (in theory) possible to charge the battery fully. Except, if it wasn´t for the clouds ofcouse. So you´ll have to calculate the sun-hours the same way your solar setup was calculated.

I estimated that the battery will be fully charged aprox 1/2 the year, which means it will save us aprox 81.000 Dkkr after 20 years. (4 hours of sun (no clouds) aprox 128 days a year).

All the above is just plain theory, cause it all depends on the weather ofcouse… But I can give you a real statistic from year 2018.
The battery discharged 1762kWh. Its 3982,- Dkkr. In 20 years it´s aprox 80.000,- Dkkr. Then you´ll need to calculate the loss of effectiveness as well. (20%). It all sums up with aprox 64.000,- Dkkr in the battery lifetime.

Will it be profitable? Well - Its not producing gold, thats for sure. But in all, I´ll say it´s close enough to status quo with a small saving.
If our gouverment change the price of power negative, it will mean less savings and therefore very bad. But if the price rise, (which I believe it will), the savings will be higher, unless the weather change to less sun-hours (more clouds). Statistics says it wont… Noone knows.

In short - It´s very difficult to answer your question. There are several things to keep in mind when doing the calculation. It´s not easy at all.
But first of all, keep focus on how much power your household consume from sunset untill sunrise. Thats probably the most important factor. After that, the size and cost of the battery. The rest is not really anything you have influence on, (ie. weather as well as the national power price).

If you´re in Group 6, it´s probably not worth it, cause you´ll sell your production of power to the Grid insted. You´ll then have to calculate if that price is better worth, rather than spending the power yourself (the battery).
Small note - If you get or already have a electrical car - It´s consider as a battery pack as well, Meaning, in a principal matter, there is no difference in a Resu/battery pack or an electrical car. They´re both battery packs. The problem with electrical cars is, often they´re not at home and charging, while the sun is shining. The Resu 10 go nowhere, when it´s installed :smiley:

1 Like

Thanks for your brief calculation.

My household consume approx 40 kwh pr day, so I need the Resu 10, nothing less would give any meaning.

I believe I’ve seen the Resu at approx 40.000 DKK.

I’ll have to dig into it :blush:

40kWh a day thats a huge consumption :open_mouth:

Before you buy anything…
Make sure your installation has a summ-measurement meter (in danish - summations måler). If not, the Electrical-compay will not be able to calculate the power produced correcly, and you´ll loose a huge part of the savings when adding a battery pack.
Thats an issue I´m (and DENFO) working on atm… (search DENFO to get more info on this highly serious matter).

Also remember, you´ll need a battery inverter as well. Your tripower cant charge the battery.

Can you provide the modbus registers for the TRI power inverters or a link? Its gettings nuts trying to find something at SMA homepage.

Sure - later this evening I’ll try to find it.

My installation has “summation måler”, and I’m looking for the SMA battery inverter 3.5 kwh.

Here is the Modbus documentation I used


I tried to read the Modbus data from my Sunny Boy inverter 2.5-1VL40, but untill now I only receive a fixed value of -214748364 on address 30775.

Do I have to transform this value in Paper UI?
When I fill in readTransform=“JS(divide1000.js)” I receive a warning in my logfile.

What am I doing wrong ?

Thats because the value -214748364 cant be translated in the JS script…
I use a modified JS script for my Sunny Boy Storage 2.5 which handle this…
Look in this thread: [SOLVED] Convert an item negative value to 0 (zero)

I tried many things, but get the modbus to start working. Only the actual power and total yield values I already discovered. The usual modbus adresses for the other fields didn’t work for me.
I created a rule to recover the daily yield out of the total yield, by storing the start every day.

First, and very important is the fact that my inverter only gives some good values when the sun is shining. For example, the actual value for the power is always the fixed value 214748364 when it’s dark outside. So when you are trying to get your scripts working, do it during the day when the inverter is active. At least for the actual powers etc…
To recover the actual power when the actual power=0, I used a javascript. When I receive a value too high for my maximum production I set the actual value==0.


Bridge modbus:tcp:inverter [ host="", port=502, id=3 ] {
    Bridge poller sma30529 [ start=30529, length=2, refresh=5000, type="input" ] {
        Thing data Total_Yield [ readStart="30529", readValueType="uint32" ]
    Bridge poller sma30775 [ start=30775, length=2, refresh=5000, type="input" ] {
        Thing data Power [ readStart="30775", readValueType="uint32", readTransform="JS(sunpower.js)"]


Number Power         "Actual Power [%.0f W]"   { channel="modbus:data:inverter:sma30775:Power:number" }
Number Day_Yield     "Day Yield [%.0f Wh]"
Number Total_Yield   "Total Yield [%.0f Wh]"   { channel="modbus:data:inverter:sma30529:Total_Yield:number" }
Number Day_Start     "Day Start [%.0f Wh]"


rule "Reset_Zonnepanelen_Dag"
  Time cron "0 0 0 * * ?" // every day
  var Number Zon=Total_Yield.state as DecimalType

rule "Update Day_Yield"
  Item Total_Yield received update
  var Number Zon_Totaal=Total_Yield.state as DecimalType
  if (Day_Start.state==NULL)      { Day_Start.postUpdate(Zon_Totaal) }

  var Number Zon_Start=Day_Start.state as DecimalType


(function(i) {
   if (power>5000) {power=0;}
   return power;

I found a very interesting xls file with a lot of sma types and modbus adresses:

Click on the second tab (below) and select your sma type.

Regards, Hans

Hi Hans,

Thanks to your example it works a little bit more.
Only the figures are still a constant value. Now divided by 1000.

When I change the ID of the bridge from 2 to 3 nothing changes.
Or do I have to reset ?

Kind regards,

Hey Pieter,

While testing, sometimes it works after changing the scripts.
But it is always safe to do a reboot or
sudo systemctl restart openhab2.service

Your current reading for actual power is 2^31=2147483648 (no power).
Then your script should convert it to 0 (zero).
Regards, Hans

Thanks Hans,

A little bit further. No power reading on address 30775.
It’s quite dark today, but the actual reading according to the SunnyBoy webpage is 69W.

According to the SMA manual ID=2

I will check other addresses tonight

After several attempts, I still don’t receive data from my Sunny Boy Inverter.
The XLS-file shows different addresses like 40200 for actual Power. This address gives a result of -1

Meanwhile, I updated OpenHAB to version 2.5.1

Also tried to read other addresses like 30774 and 30776.

Did you look at SMA´s website?
You´ll need to find the specific list of registers for your device.
The best I could find right now online was this one… It will open a Excel document in where you can pick your device:

EDIT - Try read register 30053. If it read correctly, you should be reading value 9302 which means, its a “Sunny Boy 2.5

1 Like

Thanks Kim,

This worked !!

Great… Now all you need to do, is to put in the registers you want to read :smiley:

I understand. But when I add the register for actual power, an enormous number appears. something like 4 billion …