Skip to content

WisBlock application to read production data from a SMA Sunnyboy Solar Inverter

License

Notifications You must be signed in to change notification settings

beegee-tokyo/RAK11200-SMA-Sunnyboy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WisBlock RAK11200 - RAK13300 SMA Sunnyboy to IoT

RAKstar RAKWireless WisBlock BeeGee

As my solar panels were installed by PHilERGY, the engineers explained to me how to connect the SMA SunnyBoy inverter to my local WiFi network. This enables the inverter to send its production data and status over the internet to SMA's servers.
Of course this is very comfortable, but for me as an IoT engineer, I wanted to have direct access to the inverter and collect the data by myself. Luckily, SMA has included a web interface in the Sunnyboy and released an API to request data from the inverter directly. After some research I found the SMA SunnyBoy Reader, which is an easy to use interface to talk directly to the SMA SunnyBoy inverter.

This application reads solar production and total harvested energy from the SMA Sunnyboy Inverter to show the status of the solar panel energy production. It shares the information over LoRaWAN for cloud based data processing and visualization.

This project is an update to the original MHC-Sunnyboy-RAK13300.

Differences:

The UDP broadcast of the original application was removed as the new local visualization option doesn't require it.

The monthly and yearly production values are stored locally in the FRAM module to make it easier for the visualization platform.

The RTC was added to have the proper times to update and save the daily, monthly and yearly production values.

The original visualization on a Datacake Dashboard Around my House was replaced with a local Grafana and InfluxDB installation on a Raspberry Pi4. Datacake is still my prefered platform, but without a paid plan the data retention time is limited and makes it impossible to get a bigger overview of the solar production over months (or even years).

Grafana current and daily values Grafana current and daily values

Grafana monthly values Grafana monthly values

REMARK This project is made with PlatformIO!


Hardware

The system is build with modules from the RAKwireless WisBlock product line.

For the enclosure I designed one for 3D printing that is just large enough for the WisBlock and display.

Device

The 3D files for this enclosure are in the enclosure folder of this repo.


Software

The software on the RAK11200 handles the communication over WiFi to read data from the SMA Sunnyboy inverter and sends the data to a LoRaWAN server using the RAK13300 LoRa module. It summarizes the daily production to monthly and the monthly production to yearly and stores them in the FRAM RAK15005. At the end of each month the values of the monthly and yearly production are sent one time. The RTC RAK12002 is used to get the correct time and date to send the data once a day and once a month.

IDE, BSP's and libraries:

The libraries are installed automatically by PlatformIO.


Setting up WiFi credentials

The application uses MultiWiFi class to search for up to two WiFi networks and connect to the one with the better signal quality. The two WiFi networks can be hard-coded in src/prefs.cpp. But the suggested solution is to setup the WiFi credentials with the WisBlock Toolbox over BLE


Setting up LoRaWAN credentials

The LoRaWAN credentials are hard-coded in src/main.h. But it is suggested to use other methods to change the LoRaWAN credentials. The firmware offers two options, BLE or AT commands over the USB port:

1) Setup over BLE

Using the WisBlock Toolbox you can connect to the WisBlock over BLE and setup all LoRaWAN parameters like

  • Region
  • OTAA/ABP
  • Confirmed/Unconfirmed message
  • ...

More details can be found in the WisBlock Toolbox

2) Setup over USB port

Using the AT command interface the WisBlock can be setup over the USB port.

A detailed manual for the AT commands are in AT-Commands.md


Setting up SMA Sunnyboy IP address and connection credentials

The IP address of the SMA Sunnyboy converter can be set and read with AT command.

Query SMA IP address

AT+SMA=?

Set SMA IP address

AT+SMA=192.168.64.64

Checking the saved monthly and yearly production

The saved monthly and daily production values can be read or pre-set with AT command.

Query monthly production

AT+SMON=?

Set monthly production in Wh (only integer values possible)

AT+SMON=60402

Query yearly production

AT+SYEAR=?

Set yearly production in Wh (only integer values possible)

AT+SYEAR=240000

Setting the RTC time and date

The RTC should be setup to the correct date and time to make sure the daily, monthly and yearly production values are calculated correct.

Query RTC date and time

AT+RTC=?

Set RTC date and time (single digit, no leading zeros)
Format year month date hour (24h format) minute

AT+RTC=2023:10:8:14:23

Special thanks

Special thanks to @h2zero for his outstanding work on the NimBLE-Arduino for the ESP32, that uses only a fraction of memory compared with the BLE library coming with ESP32 Arduino BSP.

Special thanks to @pkoerber for his SMA SunnyBoy Reader that made it so simple to communicate with the SMA Sunnyboy Inverters.

About

WisBlock application to read production data from a SMA Sunnyboy Solar Inverter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published