Plugin: Solar Meter, universal Solar Production meter

Hi Octo,
Hope you got your panels secured OK, very windy here, i have 20 panels on a chicken house frame so hopefully mine will be ok too!
Thanks for the work, very pleased to have the SOC value the only other value which might be useful is the power being drawn from the batteries.
Its a shame that the solarman updates are only every 5 minutes but nothing we can do about that.
I’ve extracted the SOC value and have it displayed as a power meter in ImperiHome saves having to log on to solarman to see whats happening on solar now.
Cheers

Hi, Well the panels are still there, but this morning the Vera box was dead. I have restarted it and fixed a missing double space in “Battery^^Charge”, so that is now read correctly. Seems to be working okay, so I will post latest here - I have not looked at the URL config issue yet, but using ALTUI or editing directly in Variables seems to work.
Power from the batteries is stored in the ToBatt variable, it goes negative for power being taken.

SolarMeter Solarman 0.6.zip (15.0 KB)

Dashboard

Hi Octo,

Brilliant all working here now - thank you very much and well done!
Nice dashboard, is that something you have done yourself?
How have you done your immersion ? I’ve set mine to switch the immersion on when solar goes over 3.2kW.
Thanks

I created the dashboard, it is straight forward by dragging and dropping gauges etc. in an ALTUI panel.
I also use an ALTUI workflow to control the immersion heater, I have dropped the power to 750W by running it through a 240:110v transformer , as I dont get over 3KW very often.
I control it with a set of rules: basically it is on when over 750W to the grid (implies batteries are charged), and off when drawing from the battery. I also have a manual mode, where I turn it on, and it stays on until draining 400W from the battery. I use a switch with power monitoring, so can detect when the heater power cuts off, ie tank is fully heated. I have just added an Offline check and a corresponding status in the SolarMeter code. In the case there is no Solarman update for 30min, then I turn off the heater. (After yesterday afternoon when I was searching for"Battery^Charge" with one instead of two spaces and so the heater stayed on, draining the battery).
I have also added the ToBattery power figure to the device screen…will test and upload tomorrow

image

Hi reneboer! thanks for great app. Im using it with solaredge and its working great. One questions, i would like to use in with scenes, for example if solar production is running i would to control some fans.

Hi @chrisx04,

That is suppose to be possible using scenes, but I see it is not working. I’ll add that to the to do list.

Cheers Rene

Hi,
I am about to buy a solar inverter. The two options I have are SMA and Fronius.
I have a Vera lite with UI5.
Do you have any advice on which one will be easier to integrate with my Vera (UI5)?
Thanks!
BR/ Juan

Hi essjmcb,

For both there are plugins. This universal one supports Fronius, but I have not tested it on UI5. The SMA one you have to search this forum for as it is not in the app store.

Cheers Rene

Many thanks Rene!
Has anyone tested the universal plugin with UI5?
Thanks in advance!
Cheers / Juan

Hi Rene, Since the latest update to your app V1.11, I seem to get an error message “failed to download all plugins”

I uninstalled the app, and reinstalled it, but still get the same message. I had the previous version installed and it worked great with Fronius solar inverter. But the last few days since the update, I haven’t had a reading received from my solar system. Do you know of any issues with the latest update that may be stopping it from working or downloading the needed files?

Cheers Ash

Hi reneboer,
I have a LuxPowerTek inverter. They are a popular brand too. Have you looked at all at integrating those at all? I know they do have an API (NDA needed) and their support is also very responsive/helpful.
They have both an app and web frontend.
I can give more info if needed.
Darryl.

Hi Ash,

Welcome to the community. It is a minor mistake caused by me and the daft app portal. I removed the image file from the app repository in a previous release as it now comes from a github repository so it saves the hassle from only showing local etc. But if you update the release the file got automatically included again it the list, but it is not on the portal. Hence your Vera keeps trying to download a file that no longer exits. Just reloading your browser will get you a working plugin, but won’t clear the failed to download message. I will update the plugin files on the app portal again.
Also found an other issue caused by merging a wrong version in GitHub.

The update is in the app store, but waiting Vera’s approval. This they normally do on Mondays only. You can install it by loading this in your browser on your local network:
http://[your vera IP]/port_3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=9076&Version=39416

Cheers rene

Hi Rene, thanks for your help, I’ve got the up to date plugin v1.12 from the link you sent, Vera has stopped trying to download a failed file now, and the error messages have gone, but something else seems astray now. It’s not showing any data, Gridin, Gridout and solar meter all show 0, but on the Fronius website it shows my system creating power. I’ve checked the IP address and Fronius device ID are all correct, so it’s just not sending data. Have you heard of this issue? Or maybe Fronius have changed something on their end. Either way, thanks for your assistance, when it worked it was awesome. Cheers Ash

Hi Ash,

I do not have Fronius my self so I cannot check if they changed something. Maybe I changed something that broke it. Can you set the Logging to Debug in the plugin Settings and see what you can find it the Vera Log file?

You can see the log file using http://[your vera ip]/cgi-bin/cmh/log.sh?Device=LuaUPnP

Cheers Rene

Hi Rene - +1 for the Fronius not reading power with your updated plugin.

I commented out line 736 in L_SolarMeter1.lua and the plugin is returning values. 2 problems with the line. One is the spelling of Inverters (was Invertors in your code)

Second is I appear to have no SOC value under the Inverters data structure, so once you fix the spelling mistake it still throws a wobbly - might need to check if it exists or has a value.

Debug logging:

50	12/18/19 7:45:17.379	luup_log:2278: Solar Meter_debug: Fronius Power URL http://192.168.0.28//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x6ec1b520>
50	12/18/19 7:45:17.487	luup_log:2278: Solar Meter_debug: Retrieve HTTP Get Power Complete... <0x6ec1b520>
50	12/18/19 7:45:17.488	luup_log:2278: Solar Meter_debug: {
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 122,
               "E_Day" : 2801,
               "E_Total" : 5345430,
               "E_Year" : 5345436,
               "P" : 2262
            }
         },
         "Site" : {
            "E_Day" : 2801,
            "E_Total" : 5345430,
            "E_Year" : 5345436,
            "Meter_Location" : "unknown",
            "Mode" : "produce-only",
            "P_Akku" : null,
            "P_Grid" : null,
            "P_Load" : null,
            "P_PV" : 2262,
            "rel_Autonomy" : null,
            "rel_SelfConsumption" : null
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2019-12-18T07:45:13+08:00"
   }
}
 <0x6ec1b520>
50	12/18/19 7:45:17.494	luup_log:2278: Solar Meter: Refresh pcall error [string "--[==[..."]:736: attempt to index field 'Invertors' (a nil value) <0x6ec1b520>
50	12/18/19 7:45:17.494	luup_log:2278: Solar Meter_debug: It's Daytime or Solarman: use modified Day delay Interval SolarMeter_Refresh --> -131014 <0x6ec1b520>
50	12/18/19 7:45:17.495	luup_log:2278: Solar Meter_debug: Update was late, try again in 60 <0x6ec1b520>
50	12/18/19 7:45:17.497	luup_log:2278: Solar Meter_debug: Interval to SolarMeter_Refresh --> 60 <0x6ec1b520>
50	12/18/19 7:45:17.497	luup_log:2278: Solar Meter_debug: Last Refresh was : Mon Dec 16 19:20:13 2019 <0x6ec1b520>
50	12/18/19 7:45:17.498	luup_log:2278: Solar Meter_debug: Next poll is at : Wed Dec 18 07:46:17 2019 <0x6ec1b520>

Thanks, I’ll make the update and let you know when ready to test.

Cheers Rene

I’m not really sure what I’m looking at, but this is part of what I found when following your instructions if its any help to you.Cheers Ash

50 12/18/19 20:10:15.421 luup_log:153: Solar Meter_debug: Retrieve HTTP Get Complete… <0x73b47520>
50 12/18/19 20:10:15.421 luup_log:153: Solar Meter_debug: {
“Body” : {
“Data” : {
“DAY_ENERGY” : {
“Unit” : “Wh”,
“Value” : 28419
},
“DeviceStatus” : {
“ErrorCode” : 307,
“LEDColor” : 1,
“LEDState” : 0,
“MgmtTimerRemainingTime” : 28,
“StateToReset” : false,
“StatusCode” : 3
},
“TOTAL_ENERGY” : {
“Unit” : “Wh”,
“Value” : 5427330
},
“YEAR_ENERGY” : {
“Unit” : “Wh”,
“Value” : 5427333.5
}
}
},
“Head” : {
“RequestArguments” : {
“DataCollection” : “CommonInverterData”,
“DeviceClass” : “Inverter”,
“DeviceId” : “1”,
“Scope” : “Device”
},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2019-12-18T20:10:13+10:00”
}
}
<0x73b47520>
50 12/18/19 20:10:15.427 luup_log:153: Solar Meter: Refresh pcall error [string “–[==[…”]:660: attempt to index field ‘PAC’ (a nil value) <0x73b47520>
50 12/18/19 20:10:15.428 luup_log:153: Solar Meter_debug: Is Night, restart polling just after sunrise in 33101 seconds. <0x73b47520>
50 12/18/19 20:10:15.428 luup_log:153: Solar Meter_debug: Sun set is at : Thu Dec 19 18:44:04 2019 <0x73b47520>
50 12/18/19 20:10:15.429 luup_log:153: Solar Meter_debug: Sun rise is at : Thu Dec 19 05:21:46 2019 <0x73b47520>
50 12/18/19 20:10:15.430 luup_log:153: Solar Meter_debug: Interval to SolarMeter_Refresh --> 33101 <0x73b47520>
10 12/18/19 20:10:15.430 AlarmManager::AddRelativeAlarm current time 1576663815 delay 33101 type 7 <0x73b47520>
10 12/18/19 20:10:15.431 AlarmManager::AddAbsoluteAlarm alarm 0x18cbd30 entry 0x1efdca8 id 1 type 7 param=0x1d278b8 entry->when: 1576696916 time: 1576663815 bCancelFirst 0=0 <0x73b47520>
50 12/18/19 20:10:15.431 luup_log:153: Solar Meter_debug: Last Refresh was : Thu Jan 1 10:00:00 1970 <0x73b47520>
50 12/18/19 20:10:15.432 luup_log:153: Solar Meter_debug: Next poll is at : Thu Dec 19 05:21:56 2019 <0x73b47520>

Hi Ash,

This one i find odd as your out put does not show a current Watts value. Was it night time?

Cheers Rene

Yeah it is, I just got home from work. and I just read that it will start polling after sunrise. I’ll try and do the same thing in the morning before I go to work and hopefully will be able to help you. but thanks for what you’ve done so far. Cheers Ash

Hi Rene,
This is what I could find this morning, the solar web website says my system is producing approx 100w as its just after sunrise here. Hopefully this helps in some way
Cheers Ash

10 12/19/19 5:52:20.508 FileUtils::ReadURL resp:200 size 1476 http://192.168.0.16/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData <0x73ac9520>
50 12/19/19 5:52:20.509 luup_log:153: Solar Meter_debug: Retrieve HTTP Get Complete… <0x73ac9520>
50 12/19/19 5:52:20.510 luup_log:153: Solar Meter_debug: {
“Body” : {
“Data” : {
“DAY_ENERGY” : {
“Unit” : “Wh”,
“Value” : 15.5
},
“DeviceStatus” : {
“ErrorCode” : 0,
“LEDColor” : 2,
“LEDState” : 0,
“MgmtTimerRemainingTime” : -1,
“StateToReset” : false,
“StatusCode” : 7
},
“FAC” : {
“Unit” : “Hz”,
“Value” : 49.950000000000003
},
“IAC” : {
“Unit” : “A”,
“Value” : 0.5
},
“IDC” : {
“Unit” : “A”,
“Value” : 0.71999999999999997
},
“PAC” : {
“Unit” : “W”,
“Value” : 118
},
“TOTAL_ENERGY” : {
“Unit” : “Wh”,
“Value” : 5427340
},
“UAC” : {
“Unit” : “V”,
“Value” : 238.90000000000001
},
“UDC” : {
“Unit” : “V”,
“Value” : 280.69999999999999
},
“YEAR_ENERGY” : {
“Unit” : “Wh”,
“Value” : 5427347.5
}
}
},
“Head” : {
“RequestArguments” : {
“DataCollection” : “CommonInverterData”,
“DeviceClass” : “Inverter”,
“DeviceId” : “1”,
“Scope” : “Device”
},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2019-12-19T05:52:18+10:00”
}
}
<0x73ac9520>
06 12/19/19 5:52:20.515 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: WeeklyDaily was: 0,0,0,28.419,0.0135,0,0 now: 0,0,0,28.419,0.0155,0,0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.515 UserData::m_iDataVersion_Variables_incr WeeklyDaily user data 698450014 variables 698450845 <0x73ac9520>
10 12/19/19 5:52:20.515 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450845 <0x73ac9520>
06 12/19/19 5:52:20.516 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,0.0135,0,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,0.0155,0,0,0,0,0,0,0,0,0,0,0,0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.516 UserData::m_iDataVersion_Variables_incr MonthlyDaily user data 698450014 variables 698450846 <0x73ac9520>
10 12/19/19 5:52:20.517 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450846 <0x73ac9520>
06 12/19/19 5:52:20.517 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_IAC was: 0.46 now: 0.5 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.517 UserData::m_iDataVersion_Variables_incr Fronius_IAC user data 698450014 variables 698450847 <0x73ac9520>
10 12/19/19 5:52:20.517 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450847 <0x73ac9520>
06 12/19/19 5:52:20.518 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_IDC was: 0.68 now: 0.72 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.518 UserData::m_iDataVersion_Variables_incr Fronius_IDC user data 698450014 variables 698450848 <0x73ac9520>
10 12/19/19 5:52:20.518 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450848 <0x73ac9520>
06 12/19/19 5:52:20.519 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_UAC was: 239 now: 238.9 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.519 UserData::m_iDataVersion_Variables_incr Fronius_UAC user data 698450014 variables 698450849 <0x73ac9520>
10 12/19/19 5:52:20.519 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450849 <0x73ac9520>
06 12/19/19 5:52:20.520 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: Fronius_UDC was: 280.3 now: 280.7 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.520 UserData::m_iDataVersion_Variables_incr Fronius_UDC user data 698450014 variables 698450850 <0x73ac9520>
10 12/19/19 5:52:20.520 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450850 <0x73ac9520>
50 12/19/19 5:52:20.520 luup_log:153: Solar Meter_debug: Fronius Power URL http://192.168.0.16//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x73ac9520>
10 12/19/19 5:52:20.521 FileUtils::ReadURL starting user: pass: http://192.168.0.16//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x73ac9520>
10 12/19/19 5:52:20.699 FileUtils::ReadURL resp:200 size 927 http://192.168.0.16//solar_api/v1/GetPowerFlowRealtimeData.fcgi <0x73ac9520>
50 12/19/19 5:52:20.700 luup_log:153: Solar Meter_debug: Retrieve HTTP Get Power Complete… <0x73ac9520>
50 12/19/19 5:52:20.701 luup_log:153: Solar Meter_debug: {
“Body” : {
“Data” : {
“Inverters” : {
“1” : {
“DT” : 76,
“E_Day” : 15.5,
“E_Total” : 5427340,
“E_Year” : 5427347.5,
“P” : 118
}
},
“Site” : {
“E_Day” : 15.5,
“E_Total” : 5427340,
“E_Year” : 5427347.5,
“Meter_Location” : “grid”,
“Mode” : “meter”,
“P_Akku” : null,
“P_Grid” : 371.20999999999998,
“P_Load” : -489.20999999999998,
“P_PV” : 118,
“rel_Autonomy” : 24.120520839721184,
“rel_SelfConsumption” : 100
},
“Version” : “12”
}
},
“Head” : {
“RequestArguments” : {},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2019-12-19T05:52:18+10:00”
}
}
<0x73ac9520>
06 12/19/19 5:52:20.704 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: GridWatts was: 402.92 now: 371.21 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.704 UserData::m_iDataVersion_Variables_incr GridWatts user data 698450014 variables 698450851 <0x73ac9520>
10 12/19/19 5:52:20.705 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450851 <0x73ac9520>
06 12/19/19 5:52:20.705 Device_Variable::m_szValue_set device: 153 service: urn:rboer-com:serviceId:SolarMeter1 variable: HouseWatts was: 511.92 now: 489.21 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x73ac9520>
10 12/19/19 5:52:20.705 UserData::m_iDataVersion_Variables_incr HouseWatts user data 698450014 variables 698450852 <0x73ac9520>
10 12/19/19 5:52:20.706 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 698450014 variables 698450852 <0x73ac9520>
50 12/19/19 5:52:20.706 luup_log:153: Solar Meter: Refresh pcall error [string “–[==[…”]:736: attempt to index field ‘Invertors’ (a nil value) <0x73ac9520>
50 12/19/19 5:52:20.706 luup_log:153: Solar Meter_debug: It’s Daytime or Solarman: use modified Day delay Interval SolarMeter_Refresh --> -1576698700 <0x73ac9520>
50 12/19/19 5:52:20.707 luup_log:153: Solar Meter_debug: Update was late, try again in 60 <0x73ac9520>
50 12/19/19 5:52:20.707 luup_log:153: Solar Meter_debug: Interval to SolarMeter_Refresh --> 60 <0x73ac9520>
10 12/19/19 5:52:20.707 AlarmManager::AddRelativeAlarm current time 1576698740 delay 60 type 7 <0x73ac9520>
10 12/19/19 5:52:20.707 AlarmManager::AddAbsoluteAlarm alarm 0x17da120 entry 0x1b88a20 id 5 type 7 param=0x1037e90 entry->when: 1576698800 time: 1576698740 bCancelFirst 0=0 <0x73ac9520>
50 12/19/19 5:52:20.708 luup_log:153: Solar Meter_debug: Last Refresh was : Thu Jan 1 10:00:00 1970 <0x73ac9520>
50 12/19/19 5:52:20.708 luup_log:153: Solar Meter_debug: Next poll is at : Thu Dec 19 05:53:20 2019 <0x73ac9520>

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules