Example on how to access data of a Sunny Boy SMA solar inverter

I’m also trying to get a connection to my SMA inverter running with the help ob Modbus, but still having no look :frowning:

I was not yet able to get it to run…

Modbus example:

All done in Paper UI
create MODBUS TCP Slave Thing. = modbus bridge
IP ADRESS
Port: 502
ID:3
time between transactions 60

next Thing: SMA current Power
Modbus Binding - > Regular Poll
bridge = the one we created.
Poll interval : 500 ms
Lengt: 2
Maximum tries 3
Start: 30775
Type: Input register

next thing: Modbus binding , modbus Data

bridge = modbus poll we just created.
read adress: 30775
read value type: 32bit signed integer (int32)
read transform: default
write transform : default

This things has 11 channels, the channel : Value as number is the one i use to read out the current power production in W from my sma invertor.

1 Like

Hi Tom,

I tried to follow your example, but where do I fill in the read value type ?
In Paper UI, I only these see four options:

I also see no input fields for read transform and write transform.

Kind regards,
Pieter

Hi Tom,

Forget my previous post. In the meantime I figured it out a bit more.
Only thing is that my Modbus data stays offline. Modbus TCP Slave and Regular Poll are online.

Pieter

I suspect you use modbus2 binding?
I use modbus2 for another device (I do have an SMA solar inverter as well, but it´s not connected through modbus yet). I went for manual modbus config files, as it´s alot easier to handle. You can find my setup in this thread.

Basicly it should be the same connecting anything else using modbus2 binding, as long as you´ve got the modbus data for your inverter.
(When I get the time, I´ll try to figure how to add my SMA TPL6000 inverter through modbus as well, but I´m in no hurry, as I´ve got the SMA Energy Meter connected insted, which gives me the same detail the inverter can give me).

Hi Kim,

Thanks for your reply. I will look into the information you provided.
I use the Modbus Binding, version 2.4.0

For now I created 3 things in my configuration.

Modbus TCP slave SMA, IP-address, Id=2 (bridge)
Regular Poll wich uses the Modbus slave bridge, start address 30775, type-input register, length=2
Modbus data where the bridge selection = Regular poll and Read Address = 30775

Kind regards,
Pieter

I receive data from the Modbus now. Only thing is that it’s probably not in correct format.
Address 30775 (32bit signed integer) receives every ten seconds a permanent number: 2147483648.

Do I need some kind of conversion in the field ‘Read transform’ ?

i know it’s old discussion, but if you have BT, there is no problem to get data from SMA then
take a look here:

and here:

i like your icons, can you share where you got them ? :slight_smile:
thanks

1 Like

Hmm my SMA SunnyBoy Storage 2.5 got BT… But it´s connected via speedwire (LAN)…
My problem is, I simply cant understand this SBFspot thing, and how to get from there to openhab.
Atm I´m using the SMA Energy Meter (connected via LAN) and the openhab binding. But it really lack information and options, which is in the Energy Meter. I have tried rise an request, but I dont think there is anymore support or development for the binding anymore.

sbfspot is quite simple, you either choose storage of data in csv or database and then it’s up to you what you’ll do with all the date you have.

I personally did some changes into the sbfspot code so besides all the data are stored in mysql running on my nas server for later use, it’s as well storing choosen data into the memory of RPi which reads them by BT and then I have MQTT script which is monitoring those memory data and propagate them to the mqtt by usual way in homie 4 convention.

it’s very efficient system and not that hard to setup

For someone like me knowing nothing about SBFspot and mqtt, there is no thing such as “usual way” :smiley:

there is tons of guides how to work with mqtt and openhab in this forum :wink:

I find mqtt one of the most usable and most non-harsh technologies in terms of automation ever. It simply just works :wink:

  1. setup mqtt server (usually installing one package)
  2. setup mqtt client
  3. connect openhab to specified topic
  4. profit

I know, I have been reading some of them. But they´re all filled with anything else making it very confusing.
However, I just ordered a few Sonoff devices. So I guess I just have to make it happen some way or another.

if you need, I can do very simple how-to do clean mqtt setup guide for you :wink:

(and if you’ll share your network or infrastructure you running, I can tailor it for you :stuck_out_tongue: )

I would need one for sure, when the devices arrive, (hopefully in a few days).
I have ordered the Sonoff 433mhz bridge. I hope to get my doorbell (433mhz pushbutton) to work with openhab through the Sonoff 433mhz bridge.
And then I have ordered a Sonoff POWR2, just for fun I guess :slight_smile:

I´m not really sure what info you need on the network infrastructure.
I run an Ubiquity UniFi network with a USG gateway, three Access Points (two light and one proff).
Then I have 2 UniFi switches, one with POE, beside af few other brand switches with/without POE.
The controller runs on a UniFi CloudKey.

I guess thats basicly it, or?

actually not, what I need to know basically is where and how you are running OH (rpi? nas? server?) and if you have some kind of nas or something 24/7 which holds your data and can have database and if something is in range of your SMA with BT eg. RPi 3+ (i do not recommend RPi 3 build in BT as it suxx (or use BT dongle))

at the end of the day, it can be RPi running OH itself to suit as data/bridge for your SMA even as mqtt server if you like

and that would be enough to write up something :wink:

Ahh, damn… I did write all that part as well, but dumped it cause you said you needed to know the network infrastructure… Now I see, how come I didn´t quite understand that request :smiley:

Anyway…
I have three Rpi3B´s and a Odroid C2. Then i have an old Windows 2008 server and a VERY old QNAP NAS (TS-110).

One Rpi3 runing my main opehab setup. Another Rpi running an utility to IHC (IHC Captain), and the third Rpi runs a linux for browsing habpanel (my monitoring floorplan) only.
The Odriod C2 is running openhab as well. It´s a new setup (2.5M1) to test some Velbus devices I playing with.
My windows server is actually a WHS2011, but I only use it for mail server, (Hmailserver) and then I have Grafafa running for rendering charts for my main openhab server. My QNAP NAS is hardly ever used. It´s mainly file storage.

Regarding the BT… I´m not sure I have an BT dongle. I kinda hoped I could use the Rpi for this. It´s place right next to the SMA inverter anyway, (aprox 50cm). I can buy a BT dongle if it´s needed.

thanks

maybe you will have some luck, but all rpi3 I’ve tried had frozing bluetooth after like 6-10 requests. rpi3+ does not have those issues at all.
you can definitely try to run sbfspot with built-in bt and if it will work for whole day, you’ll have quite big chance it will run reliably since then, if not … well disable onboard BT and go dongle :wink:

are you running somewhere some sql database for something? as sbfspot is way easier to use that way.
if not, it’s not end of the world.

My Rpi´s are all 3B models, one is actually 3B+ (the one running my main openhab server).

Hmailserver (my mail server) uses Microsoft SQL server compact 3.5 ENU. But I have no idea how to add databases to it. It was all done by Hmailserver installer.