Balcony solar systems are really catching on. They’re dead easy to set up, don’t cost an arm and a leg, and are a cracking way to do your bit for the planet—one sunny kilowatt at a time. Fancy making your own energy? This is a solid first step.
But once the sunshine starts pouring into your flat, you’re probably wondering—how much power am I actually making? That’s where clever tracking comes into the picture.
This post is your no-fuss guide to keeping tabs on your solar output using openHAB, a free bit of smart home software. I’ll walk you through how to measure your kilowatts so you can really see what your setup’s doing—and maybe have a bit of a geek-out while you’re at it.
Here’s how it might look:

Measure the balcony solar system by OpenHAB
Index Of How To Measure the Balcony Solar System by OpenHAB
Background
Here’s what I used for this little project:
- A standard balcony solar system—grab one online, at Amazon or your local DIY store
- A MyStrom smart plug to measure your energy
- An openHAB installation to tie it all together
How To Measure the Balcony Solar System by OpenHAB
Right, so to get this working—and to get some tidy graphs—we’ll set up some items (in an items file), build the sitemap, store data using persistence, and sort out a rule to keep it ticking over. Here we go:
Items file:
Group gSQLBalkonkraftwerk Switch PlugSwitch "Plug" {channel="mystrom:mystromplug:Balkonkraftwerk:switch"} Number:Temperature PlugTemperature "Temperature: [%.1f °C]" {channel="mystrom:mystromplug:Balkonkraftwerk:temperature"} Number:Power PlugPower "Power: [%.1f W]" <solar> (gSQLBalkonkraftwerk) {channel="mystrom:mystromplug:Balkonkraftwerk:power"} Number Statistiken_PlugPower "Chart Auswahl" <solar> (gSQLBalkonkraftwerk) Number:Energy PlugEnergyConsumedSinceLastCall "Ws: [%.1f Ws]" {channel="mystrom:mystromplug:Balkonkraftwerk:energy-consumed-since-last-call"} Number:Energy PlugEnergyConsumedSinceLastCall_Statistiken "Ws: [%.1f Ws]"
Sitemap file:
sitemap default label="Balkonkraftwerk" { Text item=PlugPower icon="solar" { Switch item=Statistiken_PlugPower label="Stromproduktion in Watt Statistiken" mappings=[0="4h",1="12h",2="1 Tag",3="3 Tage",4="1 Woche",5="1 Monat",6="4 Monate",7="1 Jahr"] Chart item=PlugPower label="Stromproduktion in Watt letzte 4 Stunden" refresh=300000 service="jdbc" period=4h visibility=[Statistiken_PlugPower==0] legend=true Chart item=PlugPower label="Stromproduktion in Watt letzte 12 Stunden" refresh=300000 service="jdbc" period=12h visibility=[Statistiken_PlugPower==1] legend=true Chart item=PlugPower label="Stromproduktion in Watt letzte 24 Stunden" refresh=300000 service="jdbc" period=D visibility=[Statistiken_PlugPower==2] legend=true Chart item=PlugPower label="Stromproduktion in Watt letzte 3 Tage" refresh=300000 service="jdbc" period=3D visibility=[Statistiken_PlugPower==3] legend=true Chart item=PlugPower label="Stromproduktion in Watt letzte Woche" refresh=300000 service="jdbc" period=W visibility=[Statistiken_PlugPower==4] legend=true Chart item=PlugPower label="Stromproduktion in Watt letzter Monat" refresh=300000 service="jdbc" period=M visibility=[Statistiken_PlugPower==5] legend=true Chart item=PlugPower label="Stromproduktion in Watt letzte 4 Monate" refresh=300000 service="jdbc" period=4M visibility=[Statistiken_PlugPower==6] legend=true Chart item=PlugPower label="Stromproduktion in Watt letztes Jahr" refresh=300000 service="jdbc" period=Y visibility=[Statistiken_PlugPower==7] legend=true } }
Persistence file (jdbc.persist):
Strategies { everyMinute : "0 * * * * ?" every15min : "0 0/15 * * * ?" everyHour : "0 0 * * * ?" everyDay : "0 0 0 * * ?" default = everyChange } Items { gSQLBalkonkraftwerk* : strategy = everyMinute, every15min Statistiken_PlugPower : strategy = everyChange, restoreOnStartup }
And finally, the rules file:
rule "Set default chart period" when System started then if (Statistiken_PlugPower.state == NULL || Statistiken_PlugPower.state == UNDEF) { Statistiken_PlugPower.sendCommand(0) } end
Note: Feel free to rename the items, groups, or whatever suits you—but do it properly across all files or things might go a bit sideways.
Additional Information
If you haven’t set up openHAB yet, check out this setup guide: Setup a New OpenHAB
Would love it if you gave my myhowto.blog a follow. It’s easy!
- Click to follow me on