Plugin: Solar Meter, universal Solar Production meter

This is a plugin to read the production data from your solar system that stared with just Enphase Envoy support. This new version supports different vendors solar systems.

Version 1.5 supports; Enphase Envoy, Enphase Cloud API, Fronius JSON API V1, Solar Edge Cloud API, SUNGROW Cloud API and PV output. With the last you have a way to get solar data for systems the plugin does not (yet) support.

With version 1.5 the plugin will calculate the WeeklyKWH and MonthlyKWH for converters that do not supply these values in their interface. For WeeklyKWH to be correct the plugin needs to run for seven days, for MonthlyKWH it needs a new month.

If you have a solar system you would like me to add, let me know and we can work to have it added.

More information on GitHub here https://github.com/reneboer/vera-SolarMeter.

The plugin is available on the MOIS App market and ALTUI ALTUI App Store.

Cheers Rene

As soon as I get mine up and running, I’ll check out the plugin for the SMA inverters and get back to you. I’m hoping it does what I want it to do…

Hi Mike,

It does not support the MODBUS devices like SMA at the moment. I know a-lurker has made one that works with SMA (https://github.com/a-lurker). I will reach out to him to see if it is ok to use some of his code. It looks like a great basis for many other brands as well.

Cheers Rene

I have his plugin installed now. Waiting for the system to come online so I can see what it does.

Is it maybe possible to add Ginlong/Solis to this plugin? Else I will need to add an extra component to my setup and that?s not ideal.

This link is probably helpful:
https://www.domoticz.com/forum/viewtopic.php?t=7941

Hi

For me a very intersting plugin! Nice work!

I have been elaborated with script files that have been working quit good over time. However since recent changes in the UI7 FW (something about syntax in the LUA editor in the browser) i cannot longer get everything to work so this plugin is for me very welcomed!

In addition to the panels and the Fronius inverter I also have installed their electrical meter (Fronius Smart Meter) so that the electrical consumption path could be measured and analyzed easily thorugh the inverter.

If possible I would be very happy if also this measurement functionality could be included in the plugin. The information is accessible through the standard API, however, it is a different call request, “http://IP/solar_api/v1/GetMeterRealtimeData.cgi?Scope=System” with the most interesting result from “PowerReal_P_Sum”.

One again thanks for the plugin!

Sorry about my bad English!
I could not add the fronius in this plugin. I put Ip and number, but vera Can’t Detect Device!
The only field with blank value is the Syslog server IP Address:Port.
Please let me know about something .
And thank you!!! Nice Work !!! Amazing!!!

settings…

IP_FRONIUS/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData

“Body” : {
“Data” : {
“DAY_ENERGY” : {
“Unit” : “Wh”,
“Value” : 31221
},
“DeviceStatus” : {
“ErrorCode” : 0,
“LEDColor” : 2,
“LEDState” : 0,
“MgmtTimerRemainingTime” : -1,
“StateToReset” : false,
“StatusCode” : 7
},
“FAC” : {
“Unit” : “Hz”,
“Value” : 60.009999999999998
},
“IAC” : {
“Unit” : “A”,
“Value” : 0.56000000000000005
},
“IDC” : {
“Unit” : “A”,
“Value” : 0.40000000000000002
},
“PAC” : {
“Unit” : “W”,
“Value” : 129
},
“TOTAL_ENERGY” : {
“Unit” : “Wh”,
“Value” : 318161
},
“UAC” : {
“Unit” : “V”,
“Value” : 232.80000000000001
},
“UDC” : {
“Unit” : “V”,
“Value” : 405.69999999999999
},
“YEAR_ENERGY” : {
“Unit” : “Wh”,
“Value” : 318161.5
}
}
},
“Head” : {
“RequestArguments” : {
“DataCollection” : “CommonInverterData”,
“DeviceClass” : “Inverter”,
“DeviceId” : “1”,
“Scope” : “Device”
},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2018-04-12T16:59:02-04:00”
}
}

Hi Rene,

I’ve managed to upload my data to pvoutput, but the solar plugin is not displaying the data in AltUI.

Can you take a look at this please? I see in the logging that the refresh operations fails, because the URL is wrong.

2018-04-16 11:24:57.725 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x2fbdd78 2018-04-16 11:24:57.725 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=870652697&Timeout=60&MinimumDelay=1500&_=1523869333333 HTTP/1.1 tcp{client}: 0x2fbdd78 2018-04-16 11:24:59.238 luup.variable_set:: 47.urn:rboer-com:serviceId:SolarMeter1.AppMemoryUsed was: 8730 now: 19223 #hooks:0 2018-04-16 11:24:59.239 luup_log:47: Solar Meter_debug: Is Day use Day delay Interval SolarMeter_Retrieve --> 30 2018-04-16 11:24:59.239 luup_log:47: Solar Meter_debug: PV Output URL https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=<ID> 2018-04-16 11:24:59.532 openLuup.server:: WGET status: closed, request: https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=<ID> 2018-04-16 11:24:59.532 luup_log:47: Solar Meter: Refresh failed HTTP Get to https://pvoutput.org/service/r2/getstatus.jsp?key=lkj 2018-04-16 11:25:00.038 openLuup.server:: request completed (8338 bytes, 1 chunks, 2312 ms) tcp{client}: 0x2fbdd78 2018-04-16 11:25:00.042 openLuup.server:: request completed (8338 bytes, 1 chunks, 2326 ms) tcp{client}: 0x30dfce8 2018-04-16 11:25:00.042 openLuup.server:: socket closed: closed tcp{client}: 0x2fbdd78 2018-04-16 11:25:00.043 openLuup.server:: socket closed: closed tcp{client}: 0x30dfce8 2018-04-16 11:25:00.263 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x2ae6998 2018-04-16 11:25:00.264 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=870652698&Timeout=60&MinimumDelay=1500&_=1523869038793 HTTP/1.1 tcp{client}: 0x2ae6998

I’ve masked the key and id in the logging. I have not edited the key in the line of the refresh. The first three letters of the key are correct, but it seems that the URL is cut off. The operations before the refresh seem to work OK.

Hi givapva,

I see that I made a misinterpretation of the documentation from Fronius. I will post an updated version later today.

RHCPNG, The latest 1.2 version on GitHub should display correctly on ALTUI. Can you try to put the URL in your web browser and see what comes back? You should see a line with comma separated values.

Cheers Rene

[quote=“reneboer, post:11, topic:198939”]Hi givapva,

I see that I made a misinterpretation of the documentation from Fronius. I will post an updated version later today.

RHCPNG, The latest 1.2 version on GitHub should display correctly on ALTUI. Can you try to put the URL in your web browser and see what comes back? You should see a line with comma separated values.

Cheers Rene[/quote]

I have version 1.2, it says in the variables. Like I said, the operations before the refresh work ok. These are the URL’s that work in the browser. Accept the line with refresh in it, that URL is cut off in the log. Thanks for the support!

Hi,
Attached is V1.3 that should work with Fronius. Please let me know if it does.

RHCPNG, the log function I use truncates the normal log lines at 80 characters, only the debug lines are full length. Hence that is as expected. I am interested in what you do get back if you enter that PVOut URL in your browser though. For me it still works.

Cheers Rene

[quote=“reneboer, post:13, topic:198939”]RHCPNG, the log function I use truncates the normal log lines at 80 characters, only the debug lines are full length. Hence that is as expected. I am interested in what you do get back if you enter that PVOut URL in your browser though. For me it still works.

Cheers Rene[/quote]

The browser gives me the following output:

20180417,09:00,900,1155,NaN,NaN,0.311,33.3,402.7

That seems to be OK. I have the log level of the plugin set to debug btw. So it shouldn’t be cut off then, right? And it says that the refresh fails.

Hi RHCPNG,

That response looks as expected yes. In the attached version I added some more details on possible errors. Can you try that?

Cheers Rene

Note: attachment removed. New version on app market.

[quote=“reneboer, post:15, topic:198939”]Hi RHCPNG,

That response looks as expected yes. In the attached version I added some more details on possible errors. Can you try that?

Cheers Rene[/quote]

This is the log I get now:

2018-04-17 12:43:04.169 openLuup.server:: request completed (16671 bytes, 2 chunks, 10084 ms) tcp{client}: 0x30a6ec8 2018-04-17 12:43:04.170 openLuup.server:: socket closed: closed tcp{client}: 0x30a6ec8 2018-04-17 12:43:04.291 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x2c82798 2018-04-17 12:43:04.291 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=961772878&Timeout=60&MinimumDelay=1500&_=1523961750538 HTTP/1.1 tcp{client}: 0x2c82798 2018-04-17 12:43:10.345 luup.variable_set:: 47.urn:rboer-com:serviceId:SolarMeter1.AppMemoryUsed was: 18379 now: 22648 #hooks:0 2018-04-17 12:43:10.345 luup_log:47: Solar Meter_debug: Is Day use Day delay Interval SolarMeter_Retrieve --> 30 2018-04-17 12:43:10.345 luup_log:47: Solar Meter_debug: PV Output URL https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=<id> 2018-04-17 12:43:10.632 openLuup.server:: WGET status: closed, request: https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=<id> 2018-04-17 12:43:10.633 luup_log:47: Solar Meter: Refresh failed HTTP Get to https://pvoutput.org/service/r2/getstatus.jsp?key=lkj 2018-04-17 12:43:10.633 luup.variable_set:: 47.urn:rboer-com:serviceId:SolarMeter1.HttpCode was: EMPTY now: closed #hooks:0 2018-04-17 12:43:10.633 luup_log:47: Solar Meter_debug: HTTP Get to https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=<id> failed. 2018-04-17 12:43:11.138 openLuup.server:: request completed (8468 bytes, 1 chunks, 6846 ms) tcp{client}: 0x2c82798 2018-04-17 12:43:11.139 openLuup.server:: socket closed: closed tcp{client}: 0x2c82798 2018-04-17 12:43:11.173 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x34e1c48 2018-04-17 12:43:11.174 openLuup.server:: GET /data_request?id=user_data&output_format=json&DataVersion=961763991&_=1523961750539 HTTP/1.1 tcp{client}: 0x34e1c48 2018-04-17 12:43:11.300 openLuup.server:: request completed (962218 bytes, 61 chunks, 126 ms) tcp{client}: 0x34e1c48 2018-04-17 12:43:11.302 openLuup.server:: socket closed: closed tcp{client}: 0x34e1c48 2018-04-17 12:43:13.376 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x3675358

There is nothing in it that’s useful, I think.

What I noticed is that the data fields that are retrieved from the api, do not correspond to the values visible in AlTUI.

So for example, there is no field in the getstatus operation for the “This week kwh” field in the GUI. If you know what I mean. But maybe this is as expected.

how can I create a new device and add the other inverter values?
Creating a new device with the total values

[quote=“givapva, post:17, topic:198939”]how can I create a new device and add the other inverter values?
Creating a new device with the total values[/quote]

I don’t use the plugin in the Vera UI, but can’t you create a new device at Apps > My Apps > Details of Solar plugin?

Hi Rene,

The value in the variable retCode and HttpCode are incorrect. The value is “Closed” and that is not what to expect. I’m not to good with lua so my debugging stops here.

And like I said, the values retrieved by the api do not correspond to the values in the gui.

Fields webservice:
Date
Time
Energy Generation
Power Generation
Energy Consumption
Power Consumption
Normalised Output
Temperature
Voltage

Fields GUI:
Power
Today
This Week
This Month
This Year
Lifetime Energy
Last Update

[quote=“RHCPNG, post:19, topic:198939”]Hi Rene,

The value in the variable retCode and HttpCode are incorrect. The value is “Closed” and that is not what to expect. I’m not to good with lua so my debugging stops here.

And like I said, the values retrieved by the api do not correspond to the values in the gui.[/quote]
Can you post a snippet of the log file again with the 1.4 version as you did before. It may give the reason why the http get command returns Closed. Typically that comes with an incorrect query or authentication problem.

The values are indeed different. The plugin is indented to be a generic one to get the current wattage and Daily KWh value as that gets reported by all system I have seen so far. The Weekly, Monthly, Yearly and Total KWh values are used when available. Other values are not as they vary from system to system.

Cheers Rene