Author Topic: Plugin: Solar Meter, universal Solar Production meter  (Read 852 times)

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +70/-30
Plugin: Solar Meter, universal Solar Production meter
« on: April 04, 2018, 12:28:46 pm »
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.2 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.

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
« Last Edit: April 10, 2018, 08:12:59 am by reneboer »
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Mike Yeager

  • Sr. Member
  • ****
  • Posts: 494
  • Karma: +6/-12
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #1 on: April 04, 2018, 07:39:08 pm »
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...

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +70/-30
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #2 on: April 06, 2018, 07:10:46 am »
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
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Mike Yeager

  • Sr. Member
  • ****
  • Posts: 494
  • Karma: +6/-12
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #3 on: April 06, 2018, 08:19:29 pm »
I have his plugin installed now. Waiting for the system to come online so I can see what it does.

Offline RHCPNG

  • Full Member
  • ***
  • Posts: 149
  • Karma: +5/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #4 on: April 12, 2018, 12:02:31 pm »
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

Offline tmorberg

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #5 on: April 12, 2018, 02:31:21 pm »
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!

Offline givapva

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #6 on: April 12, 2018, 04:07:45 pm »
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!!!
« Last Edit: April 12, 2018, 04:27:43 pm by givapva »

Offline givapva

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #7 on: April 12, 2018, 04:19:48 pm »
settings...

Offline givapva

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #8 on: April 12, 2018, 05:08:57 pm »
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"
   }
}

Offline RHCPNG

  • Full Member
  • ***
  • Posts: 149
  • Karma: +5/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #9 on: April 16, 2018, 05:37:09 am »
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.

Code: [Select]
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.

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +70/-30
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #10 on: April 16, 2018, 06:56:02 am »
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
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline RHCPNG

  • Full Member
  • ***
  • Posts: 149
  • Karma: +5/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #11 on: April 16, 2018, 07:34:58 am »
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

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!

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +70/-30
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #12 on: April 16, 2018, 03:12:28 pm »
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
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline RHCPNG

  • Full Member
  • ***
  • Posts: 149
  • Karma: +5/-0
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #13 on: April 17, 2018, 03:07:03 am »
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

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.

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +70/-30
Re: Plugin: Solar Meter, universal Solar Production meter
« Reply #14 on: April 17, 2018, 05:37:56 am »
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
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.