From leader21
Within this Howto I want to explain how you are getting values from your SMA solar inverter via ethernet. I am using a 3 phase inverter SMA STP 12000TL. This should work with all three phasis inverters from SMA. If you are having a single phase inverter, could be that you will have to adapt the match.
First of all you need to install the tool SBFSpot from here https://sbfspot.codeplex.com/
After you have installed it, create a cronjob with the command sudo crontab -e
as follows :
*/5 * * * * /usr/local/bin/sbfspot.3/SBFspot -v -nocsv -nosql -finq | cut --complement -s -f79 > /home/pi/sbfspot.log
This will create a logfile every 5 minutes with the following output :
DC Spot Data:
String 1 Pdc: 6.315kW - Udc: 520.76V - Idc: 12.127A
String 2 Pdc: 2.818kW - Udc: 465.10V - Idc: 6.059A
SUSyID: 128 - SN: 2110XXXXXX
AC Spot Data:
Phase 1 Pac : 2.964kW - Uac: 228.81V - Iac: 13.273A
Phase 2 Pac : 2.951kW - Uac: 228.24V - Iac: 13.242A
Phase 3 Pac : 2.955kW - Uac: 228.30V - Iac: 13.259A
Total Pac : 8.870kW
Now create a logreader device :
{
"id": "pvlog",
"name": "Photovolatik Energiemonitor",
"class": "LogWatcher",
"file": "/home/pi/sbfspot.log",
"attributes": [
{
"name": "acout",
"type": "number",
"unit": "kW"
},
{
"name": "actoday",
"type": "number",
"unit": "kWh"
},
{
"name": "actotal",
"type": "number",
"unit": "kWh"
},
],
"lines": [
{
"match": "\\s*Total Pac\\s*:\\s*([0-9]+\\.[0-9]+)kW",
"acout": "$1"
},
{
"match": "\\s*EToday\\s*:\\s*([0-9]+\\.[0-9]+)kWh",
"actoday": "$1"
},
{
"match": "\\s*ETotal\\s*:\\s*([0-9]+\\.[0-9]+)kWh",
"actotal": "$1"
}
]
},
If everything is set up correctly, you should now get a device looking similar than this :
I also used the pimatic-ping plugin to visualize the presence of the solar inverter (device to the right) as follows :
{
"id": "smawechselrichter",
"name": "SMA Wechselrichter",
"class": "PingPresence",
"host": "192.168.178.29",
"interval": 600000
}
If you are having the pushover plugin installed you can now send a message if your inverter is going offline for example.
Well, then have fun with it