Plugin: Solar Meter, universal Solar Production meter

[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]
Hi,

What values are you looking for? When not directly reported by the system you can better use DataMine2 to log what gets returned and make stats using that.

Cheers Rene

[quote=“reneboer, post:20, topic:198939”][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[/quote]

Ok, these values are fine for me. So that also works as expected.

There is no additional information in v1.4. I have added the two variables in the debug code.

2018-04-18 12:23:25.190 luup.variable_set:: 47.urn:rboer-com:serviceId:SolarMeter1.AppMemoryUsed was: 13317 now: 9440 #hooks:0 2018-04-18 12:23:25.191 luup_log:47: Solar Meter_debug: Is Day use Day delay Interval SolarMeter_Retrieve --> 30 2018-04-18 12:23:25.191 luup_log:47: Solar Meter_debug: PV Output URL https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=58416 2018-04-18 12:23:25.466 openLuup.server:: WGET status: closed, request: https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=58416 2018-04-18 12:23:25.466 luup_log:47: Solar Meter_debug: retCode is closed 2018-04-18 12:23:25.466 luup_log:47: Solar Meter_debug: Http Code is closed 2018-04-18 12:23:25.466 luup_log:47: Solar Meter: Refresh failed HTTP Get to https://pvoutput.org/service/r2/getstatus.jsp?key=lkj 2018-04-18 12:23:25.466 luup_log:47: Solar Meter_debug: HTTP Get to https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=58416 failed. 2018-04-18 12:23:25.972 openLuup.server:: request completed (8535 bytes, 1 chunks, 6327 ms) tcp{client}: 0x20ff388 2018-04-18 12:23:25.973 openLuup.server:: socket closed: closed tcp{client}: 0x20ff388 2018-04-18 12:23:26.117 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x2c35628 2018-04-18 12:23:26.117 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=35538553&Timeout=60&MinimumDelay=1500&_=1524046988513 HTTP/1.1 tcp{client}: 0x2c35628 2018-04-18 12:23:28.532 openLuup.server:: new client connection from 192.168.1.100: tcp{client}: 0x2c376d8 2018-04-18 12:23:28.533 openLuup.server:: GET /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%20500%20%2Fhome%2Ftest%2Fvera%2Fcmh-ludl%2Flogs%2FLuaUPnP.log&_=1524046988514 HTTP/1.1 tcp{client}: 0x2c376d8 2018-04-18 12:23:28.533 luup_log:3: ALTUI: debug: myALTUI_Handler: request is: ALTUI_Handler

Hi RHCPNG,

I truly do not understand why it returns closed. Maybe it is a timeout issue? In the ATLUI Lua test window can you try:
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”))

and
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”),20)

to see if there is a difference?

Cheers Rene

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

I truly do not understand why it returns closed. Maybe it is a timeout issue? In the ATLUI Lua test window can you try:
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”))

and
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”),20)

to see if there is a difference?

Cheers Rene[/quote]

The first URL gives me:
Return result: Nil
Console output: Closed Closed

The second URL:
Return result: Nil
Console output: Closed 20

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

I truly do not understand why it returns closed. Maybe it is a timeout issue? In the ATLUI Lua test window can you try:
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”))

and
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”),20)

to see if there is a difference?

Cheers Rene[/quote]

The first URL gives me:
Return result: Nil
Console output: Closed Closed

The second URL:
Return result: Nil
Console output: Closed 20[/quote]

I am truly at a loss here. What system do you use for openLuup? I have a PI running the latest Jessy and I must say I have LUA Sec version 0.7 for some other application. Standard Pi has LUA Sec 0.4 or 0.5 I think.

Maybe you can try to use http instead of https?

Cheers Rene

Is that comma where you want it to test for the timeout? Don’t you want to test this?

print(luup.inet.wget("https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=58416",20))

[quote=“reneboer, post:25, topic:198939”][quote=“RHCPNG, post:24, topic:198939”][quote=“reneboer, post:23, topic:198939”]Hi RHCPNG,

I truly do not understand why it returns closed. Maybe it is a timeout issue? In the ATLUI Lua test window can you try:
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”))

and
print(luup.inet.wget(“https://pvoutput.org/service/r2/getstatus.jsp?key=&sid=58416”),20)

to see if there is a difference?

Cheers Rene[/quote]

The first URL gives me:
Return result: Nil
Console output: Closed Closed

The second URL:
Return result: Nil
Console output: Closed 20[/quote]

I am truly at a loss here. What system do you use for openLuup? I have a PI running the latest Jessy and I must say I have LUA Sec version 0.7 for some other application. Standard Pi has LUA Sec 0.4 or 0.5 I think.

Maybe you can try to use http instead of https?

Cheers Rene[/quote]

I don’t run it on Pi, but have the Vbox VM running.

I’ve run the HTTP URL instead of HTTPS and then the result looks promising:

Return result: Nil
Console output: 0 20180424,12:10,3100,1073,NaN,NaN,0.289,40.2,397.1 200

Is this what you expect? Any idea why the HTTPS wouldn’t work? I haven’t got a clue.

Is that comma where you want it to test for the timeout? Don’t you want to test this?

print(luup.inet.wget("https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=58416",20))

Oops, you are completely right. :-[

Is that comma where you want it to test for the timeout? Don’t you want to test this?

print(luup.inet.wget("https://pvoutput.org/service/r2/getstatus.jsp?key=<key>&sid=58416",20))

Oops, you are completely right. :-[[/quote]

This doesn’t make difference, the HTTP in stead of HTTPS does!

Hi RHCPNG,

No idea why your LUA implementation does not support https. Are you running any other plugins using https?

I made a patch to the version below that uses http for PV out by default. That should then work in your case.

Cheers Rene

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

No idea why your LUA implementation does not support https. Are you running any other plugins using https?

I made a patch to the version below that uses http for PV out by default. That should then work in your case.

Cheers Rene[/quote]

Thanks, Rene! This will get me going.

I am using the Darksky plugin, this uses https. That plugin works fine.

Renee,
Have you considered adding solar thermal controllers to you plug in. Heliodyne has one that is accessible via internet and tracks 7 different temperatures, 2 flows (if you install guages) and controls up to 3 motors. I would be great to get connected to this with Vera. Are there any zwave compatible solar thermal controllers?
Thanks

[quote=“aecchalet, post:32, topic:198939”]Renee,
Have you considered adding solar thermal controllers to you plug in. Heliodyne has one that is accessible via internet and tracks 7 different temperatures, 2 flows (if you install guages) and controls up to 3 motors. I would be great to get connected to this with Vera. Are there any zwave compatible solar thermal controllers?
Thanks[/quote]
Hi,

Nope, this plugin is for Solar panels to report their production figures. The thermal controllers sounds like a totally different application, but I must say I have zero knowledge on them.

Cheers Rene

Hi Rene, I was pumped when I found your Solar Meter Plugin with PVO support and I’ve configured it with my PVO details* … but it doesnt seem to do anything?

I suspect it is only looking for Solar generation and I haven’t installed Solar yet (August hopefully) - however I’ve been uploading my usage data for a few years (CurrentCost EnviR left over from my previous house which did have solar) and I’d really like to have our Consumption data pulled back from PVO too please?

*[sub]Except: Syslog server IP Address:Port (there’s no explanation as to what this is for)[/sub]

Hi dJos,

The plugin is indeed just for Solar production data. Adding the fields is relatively simple so you get them in a variable. If you add the below to SS_PVOutput_Refresh just under the line retData = nil you will get that data too.

			if #d_t > 4 then var.Set("PV_EnergyConsumption", d_t[5]) end
			if #d_t > 5 then var.Set("PV_PowerConsumption", d_t[6]) end
			if #d_t > 6 then var.Set("PV_NormalisedOutput", d_t[7]) end
			if #d_t > 7 then var.Set("PV_Temperature", d_t[8]) end
			if #d_t > 8 then var.Set("PV_Voltage", d_t[9]) end

It is in the lua code attached, but untested.

Cheers Rene

Thanks Rene, that’s fantastic! The lua code looks great and I can see it in TextWrangler … Only issue is I’m a complete n00b to Vera and Im not sure how to use lua code yet, is there an idiots guide you can point me to?

[quote=“reneboer, post:35, topic:198939”]Hi dJos,

The plugin is indeed just for Solar production data. Adding the fields is relatively simple so you get them in a variable. If you add the below to SS_PVOutput_Refresh just under the line retData = nil you will get that data too.

			if #d_t > 4 then var.Set("PV_EnergyConsumption", d_t[5]) end
			if #d_t > 5 then var.Set("PV_PowerConsumption", d_t[6]) end
			if #d_t > 6 then var.Set("PV_NormalisedOutput", d_t[7]) end
			if #d_t > 7 then var.Set("PV_Temperature", d_t[8]) end
			if #d_t > 8 then var.Set("PV_Voltage", d_t[9]) end

It is in the lua code attached, but untested.

Cheers Rene[/quote]

So I figured out how to upload the lua files and I can see see that it has replaced the 1.4.1 code with 1.4.3 … however I’m not sure what to do next for the update to take effect?

Just for kicks I created a new device and then deleted the old one (from within the “installed apps”) and reconfigured it, still not seeing any data come through though. clearly I have no idea what im doing. :stuck_out_tongue:

Renee, Thanks for your work on this plug in, any word if Sunpower will be added / looked at as a supported vendor ?
Thank you

Rene?

Best Home Automation shopping experience. Shop at getvera!

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