Plugin: Solar Meter, universal Solar Production meter

Hi,
I have a new version for Fronius to test. I hope it runs solid now.
L_SolarMeter1.zip (11.0 KB)
Unzip and upload via the Apps, Develop Apps, Luup Files panel.

Octo, I did include the Solarman batterty temp, but not the icons. That requires a bit more time to make an install package.

Cheers Rene

@reneboer - tested the latest version, it’s still producing an error related to that non-existent value and the Wattage value is not getting updated.

50	12/19/19 6:05:03.317	luup_log:2278: Solar Meter_debug: Fronius Power URL http://192.168.0.28//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x6f771520>
50	12/19/19 6:05:03.455	luup_log:2278: Solar Meter_debug: Retrieve HTTP Get Power Complete... <0x6f771520>
50	12/19/19 6:05:03.456	luup_log:2278: Solar Meter_debug: {
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 122,
               "E_Day" : 121.70000457763672,
               "E_Total" : 5383550,
               "E_Year" : 5383557,
               "P" : 176
            }
         },
         "Site" : {
            "E_Day" : 121.70000457763672,
            "E_Total" : 5383550,
            "E_Year" : 5383557,
            "Meter_Location" : "unknown",
            "Mode" : "produce-only",
            "P_Akku" : null,
            "P_Grid" : null,
            "P_Load" : null,
            "P_PV" : 176,
            "rel_Autonomy" : null,
            "rel_SelfConsumption" : null
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2019-12-19T06:05:00+08:00"
   }
}
 <0x6f771520>
50	12/19/19 6:05:03.462	luup_log:2278: Solar Meter: Refresh pcall error [string "--[==[..."]:745: attempt to index field '?' (a nil value) <0x6f771520>
50	12/19/19 6:05:03.463	luup_log:2278: Solar Meter_debug: It's Daytime or ContinousPoll: use modified Day delay Interval SolarMeter_Refresh --> -611 <0x6f771520>
50	12/19/19 6:05:03.463	luup_log:2278: Solar Meter_debug: Update was late, try again in 60 <0x6f771520>
50	12/19/19 6:05:03.463	luup_log:2278: Solar Meter_debug: Interval to SolarMeter_Refresh --> 60 <0x6f771520>
50	12/19/19 6:05:03.464	luup_log:2278: Solar Meter_debug: Last Refresh was : Thu Dec 19 05:52:22 2019 <0x6f771520>
50	12/19/19 6:05:03.465	luup_log:2278: Solar Meter_debug: Next poll is at : Thu Dec 19 06:06:03 2019 <0x6f771520>

I’ve just uploaded that new file, but its night again here, I’ll check in the morning and see how it goes
Cheers Ash

Hi Rene,

I’m also still getting 0 for my solar meter. Here is some of the code I found so hopefully might help. This is the version in your last comment with the zip file. Cheers Ash

10 12/20/19 5:48:59.370 FileUtils::ReadURL resp:200 size 1490 http://192.168.0.16/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData <0x73d25520>
50 12/20/19 5:48:59.372 luup_log:153: Solar Meter_debug: Retrieve HTTP Get Complete… <0x73d25520>
50 12/20/19 5:48:59.372 luup_log:153: Solar Meter_debug: {
“Body” : {
“Data” : {
“DAY_ENERGY” : {
“Unit” : “Wh”,
“Value” : 15.300000000000001
},
“DeviceStatus” : {
“ErrorCode” : 0,
“LEDColor” : 2,
“LEDState” : 0,
“MgmtTimerRemainingTime” : -1,
“StateToReset” : false,
“StatusCode” : 7
},
“FAC” : {
“Unit” : “Hz”,
“Value” : 49.920000000000002
},
“IAC” : {
“Unit” : “A”,
“Value” : 0.32000000000000001
},
“IDC” : {
“Unit” : “A”,
“Value” : 0.46999999999999997
},
“PAC” : {
“Unit” : “W”,
“Value” : 75
},
“TOTAL_ENERGY” : {
“Unit” : “Wh”,
“Value” : 5453820
},
“UAC” : {
“Unit” : “V”,
“Value” : 239.5
},
“UDC” : {
“Unit” : “V”,
“Value” : 260.69999999999999
},
“YEAR_ENERGY” : {
“Unit” : “Wh”,
“Value” : 5453820
}
}
},
“Head” : {
“RequestArguments” : {
“DataCollection” : “CommonInverterData”,
“DeviceClass” : “Inverter”,
“DeviceId” : “1”,
“Scope” : “Device”
},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2019-12-20T05:48:55+10:00”
}
}
<0x73d25520>
06 12/20/19 5:48:59.379 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: WeeklyDaily was: 0,0,0,28.419,26.473,0.014,0 now: 0,0,0,28.419,26.473,0.0153,0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.379 UserData::m_iDataVersion_Variables_incr WeeklyDaily user data 784469006 variables 784469797 <0x73d25520>
10 12/20/19 5:48:59.380 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469797 <0x73d25520>
06 12/20/19 5:48:59.380 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: MonthlyDaily was: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.419,26.473,0.014,0,0,0,0,0,0,0,0,0,0,0 now: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.419,26.473,0.0153,0,0,0,0,0,0,0,0,0,0,0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.381 UserData::m_iDataVersion_Variables_incr MonthlyDaily user data 784469006 variables 784469798 <0x73d25520>
10 12/20/19 5:48:59.381 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469798 <0x73d25520>
06 12/20/19 5:48:59.382 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_IAC was: 0.31 now: 0.32 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.382 UserData::m_iDataVersion_Variables_incr Fronius_IAC user data 784469006 variables 784469799 <0x73d25520>
10 12/20/19 5:48:59.382 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469799 <0x73d25520>
06 12/20/19 5:48:59.383 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_UAC was: 239.7 now: 239.5 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.383 UserData::m_iDataVersion_Variables_incr Fronius_UAC user data 784469006 variables 784469800 <0x73d25520>
10 12/20/19 5:48:59.383 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469800 <0x73d25520>
06 12/20/19 5:48:59.384 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_UDC was: 261.3 now: 260.7 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.384 UserData::m_iDataVersion_Variables_incr Fronius_UDC user data 784469006 variables 784469801 <0x73d25520>
10 12/20/19 5:48:59.385 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469801 <0x73d25520>
50 12/20/19 5:48:59.385 luup_log:153: Solar Meter_debug: Fronius Power URL http://192.168.0.16//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x73d25520>
10 12/20/19 5:48:59.386 FileUtils::ReadURL starting user: pass: http://192.168.0.16//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x73d25520>
10 12/20/19 5:48:59.471 FileUtils::ReadURL resp:200 size 949 http://192.168.0.16//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x73d25520>
50 12/20/19 5:48:59.472 luup_log:153: Solar Meter_debug: Retrieve HTTP Get Power Complete… <0x73d25520>
50 12/20/19 5:48:59.473 luup_log:153: Solar Meter_debug: {
“Body” : {
“Data” : {
“Inverters” : {
“1” : {
“DT” : 76,
“E_Day” : 15.300000190734863,
“E_Total” : 5453820,
“E_Year” : 5453820,
“P” : 75
}
},
“Site” : {
“E_Day” : 15.300000190734863,
“E_Total” : 5453820,
“E_Year” : 5453820,
“Meter_Location” : “grid”,
“Mode” : “meter”,
“P_Akku” : null,
“P_Grid” : 459.47000000000003,
“P_Load” : -534.47000000000003,
“P_PV” : 75,
“rel_Autonomy” : 14.032593036091829,
“rel_SelfConsumption” : 100
},
“Version” : “12”
}
},
“Head” : {
“RequestArguments” : {},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2019-12-20T05:48:55+10:00”
}
}
<0x73d25520>
06 12/20/19 5:48:59.477 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: ToGrid was: -468.5 now: -459.47 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.478 UserData::m_iDataVersion_Variables_incr ToGrid user data 784469006 variables 784469802 <0x73d25520>
10 12/20/19 5:48:59.478 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469802 <0x73d25520>
06 12/20/19 5:48:59.479 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: GridWatts was: 468.5 now: 459.47 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.479 UserData::m_iDataVersion_Variables_incr GridWatts user data 784469006 variables 784469803 <0x73d25520>
10 12/20/19 5:48:59.480 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469803 <0x73d25520>
06 12/20/19 5:48:59.480 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: ToHouse was: 542.5 now: 534.47 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.480 UserData::m_iDataVersion_Variables_incr ToHouse user data 784469006 variables 784469804 <0x73d25520>
10 12/20/19 5:48:59.481 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469804 <0x73d25520>
06 12/20/19 5:48:59.481 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: HouseWatts was: 542.5 now: 534.47 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73d25520>
10 12/20/19 5:48:59.481 UserData::m_iDataVersion_Variables_incr HouseWatts user data 784469006 variables 784469805 <0x73d25520>
10 12/20/19 5:48:59.482 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 784469006 variables 784469805 <0x73d25520>
50 12/20/19 5:48:59.482 luup_log:153: Solar Meter: Refresh pcall error [string “–[==[…”]:745: attempt to index field ‘?’ (a nil value) <0x73d25520>
50 12/20/19 5:48:59.483 luup_log:153: Solar Meter_debug: It’s Daytime or ContinousPoll: use modified Day delay Interval SolarMeter_Refresh → -1576784899 <0x73d25520>
50 12/20/19 5:48:59.483 luup_log:153: Solar Meter_debug: Update was late, try again in 60 <0x73d25520>
50 12/20/19 5:48:59.484 luup_log:153: Solar Meter_debug: Interval to SolarMeter_Refresh → 60 <0x73d25520>

Ok, this should do it. I wrote some test code to parse your outputs so i am hopeful now.
L_SolarMeter1.zip (11.0 KB)

Note that as long as there is a code error (Solar Meter: Refresh pcall error [string “–[==[…”]:…) the values will not update.

Cheers Rene

Success… We have watts. GridIN GridOUT and Solar Meter House are also all reading values!
Thanks for fixing that up Rene

Cheers Ash

Yeah. Thanks for the feedback. I will update the app store and github versions.

Cheers Rene

Hi @abell08

How are you populating the energy meters? I have a Fronius inverter and a smart power meter and wish to see the GridIn and GridOut values too. Solar Meter is working fine for the inverter.
I currently have scenes running to populate with luup script (that Rene provided around 3 years ago) but the have failed to update fully recently - also causing ‘errors in scenes and events’.

Hi @reneboer

Rene,
Love this app!

Is there any config to display the current power generated in the iOS app? It only shows today and last week energy values. The last week values are the same as this week’s - could that space be taken with current solar generation in kWh?

Hi @delbz
When I set up the solar meter app, under settings, select yes for GridIn and GridOut.
To make it easier to read/use this data, I downloaded “Virtual Sensor”, and set this up to create 3 generic virtual sensors. This then just gives a basic “level” reading, which I am using to control other devices.
I’ve put in some screen shots so hopefully makes sense. The first one is the app, the second is the settings in that app, and the third is the devices that app creates, which I then use data from that. But I also use reactor sensors to run my scenes, I find that a lot more flexible to use compared to Vera’s native scene creation.
Hopefully that was the info you’re after?
Cheers Ash

Screen Shot 2019-12-24 at 8.27.04 am

1 Like

Thank you @abell08,
Very helpful. I have set up similarly now. Although my Virtual Sensor screen looks a bit different. I will check if there’s an update.

I’m using version 1.10 of virtual sensor

Oh - right. I was confused when I saw ‘Watts’ thinking you could select W, kW, kWh etc

My variables are all from the one (and only) source (I called Solar Energy). When you say “under settings, select yes for GridIn and GridOut.” I don’t see that as an option anywhere.

I have all I need now using the Fronius, SiteSensor and PVOutput sources - just the formatting of the devices to kWh and better suited icons would be great. Thanks for all your help.


Hi @delbz,
With the 1.13 version and if you have a Fronius or Solarman you can go into the plugin settings tab and select if you want to see the Grid meters as well. This will create two extra devices; Grid in, Grid out and those should show in the Vera phone apps.

Cheers Rene

Thanks Rene, (Merry Christmas from Australia).
I updated from Github and the extra config now appears.
I notice the labels say both Watts and KWH though. Can the power meter .json be amended to remove KWH and replace with Watts after the value?

With the “Last week” value - how is that calculated?

Hi delbz,

Happy holidays from a not as warm Holland.

The KWH value is always shown for power devices. If you modify them you change it for all your power devices, or if you make a specific json, they will not show in the phone apps again. So best to just accept that it is there with no function.

The weekly (and monthly and yearly) is the summed daily values and will not be correct in the first week as it will not have the seven daily values yet. See the wiki for more details on this Home · reneboer/DarkSkyWeather Wiki · GitHub

Cheers Rene

Hi Rene,
Just updated to 1.14, and noticed a bug that the update cycle does not run overnight. The code now checks for Battery Status, and stops if it is static, however just because the battery is not charging/discharging, I think the the monitor should still run, as Solarman reports the house usage as well, which I monitor overnight.
I have changed the code under SolarmanRefresh to:
– Battery data
elseif key == “1ff” then
PlugIn.ContinousPoll = true – Added here
local stat = GetAsNumber(value)
if stat == 0 then
var.Set(“BatteryStatus”,“Static”)
elseif stat == 1 then
–PlugIn.ContinousPoll = true – Not needed
var.Set(“BatteryStatus”,“Charge”)
elseif stat == 2 then
–PlugIn.ContinousPoll = true – Not needed
var.Set(“BatteryStatus”,“Discharge”)
end
and this seems to have fixed it. (Something similar appears on the 1fe parameter, but my system does not return that).
Cheers
Octo.
PS would you be able to upload the icon set to github, I would be happy to reinstate the status checks and test it for pre-release?

Thanks Octo,

Bit busy integrating controlling my Tesla at the moment, but once that stabilizes I’ll have a look at this plugin again.

Cheers Rene

Hello,
I missed your interesting wontek related to the integration of the inverter with the home automation system.

Please let me know if it is possible to add support for my SolaX X3 MIC inverter
I provide a link to https://www.solaxpower.com/downloads/

In addition, I am thinking about additional functionality:
Is it possible to add a device that would indicate whether it is currently a generation or not.
Based on this I could control the devices.

greetings
Marek