Giter Club home page Giter Club logo

sunpower-pvs-exporter's Introduction

About

Build Status codecov

A Prometheus exporter for the SunPower ProVision monitoring system:

  • SunPower PVS 5x
  • SunPower PVS 6

Requirements

  • Python 2.7+
  • Prometheus Client

Installation

From pip:

pip install sunpower_pvs_exporter

From github:

# pip install [email protected]:ginoledesma/sunpower-pvs-exporter.git
pip install sunpower_pvs_exporter

Usage

Help

$ sunpower-pvs-exporter -h 
usage: sunpower-pvs-exporter [-h] [--hostname HOSTNAME] [--port PORT]
                             [--use-tls] [--listen-on LISTEN_ON]
                             [--log-file LOG_FILE]
                             [--log-level {ERROR,WARNING,INFO,DEBUG}]
                             [--timeout TIMEOUT] [--use-device-data-timestamp]

optional arguments:
  -h, --help            show this help message and exit
  --hostname HOSTNAME   SunPower PV Supervisor hostname
  --port PORT           SunPower PV Supervisor port
  --use-tls             Use SSL/TLS when communicating with SunPower PV
                        Supervisor
  --listen-on LISTEN_ON
                        Listen on the specified port
  --log-file LOG_FILE   Output logfile
  --log-level {ERROR,WARNING,INFO,DEBUG}
                        Log level
  --timeout TIMEOUT     Connection timeout value (in seconds)
  --use-device-data-timestamp
                        Use the data timestamp from the PVS device

Runtime

$ sunpower-pvs-exporter
2019-05-13 20:13:48,701 Listening on port 9110...

$ curl http://localhost:9110/
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="2",minor="7",patchlevel="10",version="2.7.10"} 1.0
# HELP sunpower_pvs_communication_interface_info Communications Interface Information
# TYPE sunpower_pvs_communication_interface_info gauge
sunpower_pvs_communication_interface_info{interface="wan",internet="up",sms="reachable"} 1.0
sunpower_pvs_communication_interface_info{interface="plc",internet="down",sms="unreachable"} 1.0
sunpower_pvs_communication_interface_info{interface="sta0",internet="down",sms="unreachable"} 1.0
sunpower_pvs_communication_interface_info{interface="cell",internet="down",sms="unreachable"} 1.0
# HELP sunpower_pvs_grid_profile_info Grid Profile
# TYPE sunpower_pvs_grid_profile_info gauge
sunpower_pvs_grid_profile_info{id="aabbccddeeffaabbccddeeffaabbccddeeffaabbccd",name="IEEE-1547",percent="100",status="success"} 1.0
# HELP sunpower_pvs_supervisor_communication_errors_total Total number of communication errors
# TYPE sunpower_pvs_supervisor_communication_errors_total counter
sunpower_pvs_supervisor_communication_errors_total{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 283.0
# HELP sunpower_pvs_supervisor_cpu_loadavg CPU Load Average
# TYPE sunpower_pvs_supervisor_cpu_loadavg gauge
sunpower_pvs_supervisor_cpu_loadavg{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 0.2
# HELP sunpower_pvs_supervisor_errors_total Total number of errors
# TYPE sunpower_pvs_supervisor_errors_total counter
sunpower_pvs_supervisor_errors_total{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 0.0
# HELP sunpower_pvs_supervisor_flash_storage_available_bytes Storage available space (bytes)
# TYPE sunpower_pvs_supervisor_flash_storage_available_bytes gauge
sunpower_pvs_supervisor_flash_storage_available_bytes{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 7.8512128e+07
# HELP sunpower_pvs_supervisor_mem_used_bytes Memory used (bytes)
# TYPE sunpower_pvs_supervisor_mem_used_bytes gauge
sunpower_pvs_supervisor_mem_used_bytes{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 3.9350272e+07
# HELP sunpower_pvs_supervisor_scan_time_seconds Scan time
# TYPE sunpower_pvs_supervisor_scan_time_seconds gauge
sunpower_pvs_supervisor_scan_time_seconds{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 0.0
# HELP sunpower_pvs_supervisor_skipped_scans_total Skipped scans
# TYPE sunpower_pvs_supervisor_skipped_scans_total counter
sunpower_pvs_supervisor_skipped_scans_total{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 0.0
# HELP sunpower_pvs_supervisor_untransmitted_events_total Untransmitted events
# TYPE sunpower_pvs_supervisor_untransmitted_events_total counter
sunpower_pvs_supervisor_untransmitted_events_total{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 9510.0
# HELP sunpower_pvs_supervisor_uptime_seconds_total Uptime (seconds)
# TYPE sunpower_pvs_supervisor_uptime_seconds_total counter
sunpower_pvs_supervisor_uptime_seconds_total{device_id="ZT01234567890123456",model="PV Supervisor PVS6",software_version="2019.5, Build 4150"} 10494.0
# HELP sunpower_pvs_power_meter_ct_rated_current_amperes CT Rated Current
# TYPE sunpower_pvs_power_meter_ct_rated_current_amperes gauge
sunpower_pvs_power_meter_ct_rated_current_amperes{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 50.0
sunpower_pvs_power_meter_ct_rated_current_amperes{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} 100.0
# HELP sunpower_pvs_power_meter_ac_frequency_hertz AC Frequency
# TYPE sunpower_pvs_power_meter_ac_frequency_hertz gauge
sunpower_pvs_power_meter_ac_frequency_hertz{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 60.0
sunpower_pvs_power_meter_ac_frequency_hertz{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} 60.0
# HELP sunpower_pvs_power_meter_net_energy_watt_hours Total Net Energy
# TYPE sunpower_pvs_power_meter_net_energy_watt_hours gauge
sunpower_pvs_power_meter_net_energy_watt_hours{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 294370.0
sunpower_pvs_power_meter_net_energy_watt_hours{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} -103980.0
# HELP sunpower_pvs_power_meter_average_real_power_watts Average real power
# TYPE sunpower_pvs_power_meter_average_real_power_watts gauge
sunpower_pvs_power_meter_average_real_power_watts{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 9.0
sunpower_pvs_power_meter_average_real_power_watts{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} 464.1
# HELP sunpower_pvs_power_meter_average_reactive_power_volt_amperes_reactive Average reactive power
# TYPE sunpower_pvs_power_meter_average_reactive_power_volt_amperes_reactive gauge
sunpower_pvs_power_meter_average_reactive_power_volt_amperes_reactive{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 328.0
sunpower_pvs_power_meter_average_reactive_power_volt_amperes_reactive{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} -915.6
# HELP sunpower_pvs_power_meter_average_apparent_power_volt_amperes_reactive Average reactive power
# TYPE sunpower_pvs_power_meter_average_apparent_power_volt_amperes_reactive gauge
sunpower_pvs_power_meter_average_apparent_power_volt_amperes_reactive{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 329.40000000000003
sunpower_pvs_power_meter_average_apparent_power_volt_amperes_reactive{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} 1077.3999999999999
# HELP sunpower_pvs_power_meter_power_factor_real_power_per_apparent_power Power Factor (Real Power / Apparent Power) ratio
# TYPE sunpower_pvs_power_meter_power_factor_real_power_per_apparent_power gauge
sunpower_pvs_power_meter_power_factor_real_power_per_apparent_power{ct_rated_current="50",description="Power Meter PVS6M01234567p",device_id="PVS6M01234567p",mode="production",model="PVS6M0001p",port="",software_version="3000",type="PVS5-METER-P"} 0.0241
sunpower_pvs_power_meter_power_factor_real_power_per_apparent_power{ct_rated_current="100",description="Power Meter PVS6M01234567c",device_id="PVS6M01234567c",mode="consumption",model="PVS6M0001c",port="",software_version="3000",type="PVS5-METER-C"} 0.4302
# HELP sunpower_pvs_inverter_ac_current_amperes AC Current
# TYPE sunpower_pvs_inverter_ac_current_amperes gauge
sunpower_pvs_inverter_ac_current_amperes{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 0.0
sunpower_pvs_inverter_ac_current_amperes{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 0.0
sunpower_pvs_inverter_ac_current_amperes{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 0.0
# HELP sunpower_pvs_inverter_ac_power_watts AC Power
# TYPE sunpower_pvs_inverter_ac_power_watts gauge
sunpower_pvs_inverter_ac_power_watts{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 0.1
sunpower_pvs_inverter_ac_power_watts{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 0.4
sunpower_pvs_inverter_ac_power_watts{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 0.0
# HELP sunpower_pvs_inverter_ac_voltage_volts AC Voltage
# TYPE sunpower_pvs_inverter_ac_voltage_volts gauge
sunpower_pvs_inverter_ac_voltage_volts{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 250.48
sunpower_pvs_inverter_ac_voltage_volts{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 249.98
sunpower_pvs_inverter_ac_voltage_volts{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 250.16
# HELP sunpower_pvs_inverter_dc_current_amperes DC Current
# TYPE sunpower_pvs_inverter_dc_current_amperes gauge
sunpower_pvs_inverter_dc_current_amperes{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 0.01
sunpower_pvs_inverter_dc_current_amperes{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 0.03
sunpower_pvs_inverter_dc_current_amperes{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 0.03
# HELP sunpower_pvs_inverter_dc_power_watts DC Power
# TYPE sunpower_pvs_inverter_dc_power_watts gauge
sunpower_pvs_inverter_dc_power_watts{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 0.1
sunpower_pvs_inverter_dc_power_watts{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 0.6
sunpower_pvs_inverter_dc_power_watts{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 0.8
# HELP sunpower_pvs_inverter_dc_voltage_volts DC Voltage
# TYPE sunpower_pvs_inverter_dc_voltage_volts gauge
sunpower_pvs_inverter_dc_voltage_volts{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 10.12
sunpower_pvs_inverter_dc_voltage_volts{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 21.99
sunpower_pvs_inverter_dc_voltage_volts{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 21.99
# HELP sunpower_pvs_inverter_operating_frequency_hertz Operating Frequency (hertz)
# TYPE sunpower_pvs_inverter_operating_frequency_hertz gauge
sunpower_pvs_inverter_operating_frequency_hertz{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 60.19
sunpower_pvs_inverter_operating_frequency_hertz{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 59.98
sunpower_pvs_inverter_operating_frequency_hertz{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 59.98
# HELP sunpower_pvs_inverter_energy_total_watt_hours Total Energy
# TYPE sunpower_pvs_inverter_energy_total_watt_hours gauge
sunpower_pvs_inverter_energy_total_watt_hours{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 19249.9
sunpower_pvs_inverter_energy_total_watt_hours{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 19313.7
sunpower_pvs_inverter_energy_total_watt_hours{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 18932.5
# HELP sunpower_pvs_inverter_heatsink_temperature_celcius Heatsink Temperature
# TYPE sunpower_pvs_inverter_heatsink_temperature_celcius gauge
sunpower_pvs_inverter_heatsink_temperature_celcius{description="Inverter E00000000000001",device_id="E00000000000001",model="AC_Module_Type_E",module_id="P07M20205372",port="",software_version="118079776",type="SOLARBRIDGE"} 22.0
sunpower_pvs_inverter_heatsink_temperature_celcius{description="Inverter E00000000000002",device_id="E00000000000002",model="AC_Module_Type_E",module_id="P07M20205351",port="",software_version="118079776",type="SOLARBRIDGE"} 22.0
sunpower_pvs_inverter_heatsink_temperature_celcius{description="Inverter E00000000000003",device_id="E00000000000003",model="AC_Module_Type_E",module_id="P07M20205226",port="",software_version="118079776",type="SOLARBRIDGE"} 21.0
# HELP sunpower_pvs_device_state Device (Component/Module) State
# TYPE sunpower_pvs_device_state gauge
sunpower_pvs_device_state{device_id="ZT01234567890123456",device_type="PVS",model="PV Supervisor PVS6",software_version="2019.5, Build 4150",state="working",type=""} 1.0
sunpower_pvs_device_state{device_id="PVS6M01234567p",device_type="Power Meter",model="PVS6M0001p",software_version="3000",state="working",type="PVS5-METER-P"} 1.0
sunpower_pvs_device_state{device_id="PVS6M01234567c",device_type="Power Meter",model="PVS6M0001c",software_version="3000",state="working",type="PVS5-METER-C"} 1.0
sunpower_pvs_device_state{device_id="E00000000000001",device_type="Inverter",model="AC_Module_Type_E",software_version="118079776",state="working",type="SOLARBRIDGE"} 1.0
sunpower_pvs_device_state{device_id="E00000000000002",device_type="Inverter",model="AC_Module_Type_E",software_version="118079776",state="working",type="SOLARBRIDGE"} 1.0
sunpower_pvs_device_state{device_id="E00000000000003",device_type="Inverter",model="AC_Module_Type_E",software_version="118079776",state="working",type="SOLARBRIDGE"} 1.0

The --use-device-data-timestamp flag causes the exporter to use the timestamp emitted from the PVS device. This is disabled by default for a few reasons:

  • Setting the timestamp explicitly (instead of having Prometheus do it) is best suited for the Push Gateway

  • Depending on the component, the timestamp value may be too "out-of-date" (for example, the Supervisor component refreshes once every 5 minutes only)

  • The timestamp field may not be available when the device is in an error state

References

See the Notes section for more information.

Example Grafana Dashboards

Summary Dashboard - Panel Config Inverter Dashboard - Panel Config PVS Supervisor Dashboard - Panel Config

sunpower-pvs-exporter's People

Contributors

deekue avatar ginoledesma avatar johnmu avatar pgenera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sunpower-pvs-exporter's Issues

Grafana configs

I'm trying to duplicate your Grafana pages from the JSON templates provided. Apparently there have been enough changes in Grafana since these were created that I can't make much work correctly.

I'm getting all the data into InfluxDB and to Grafana OK but things just don't match up very well when I compare my JSON to yours that was imported. I assume that is due to updates to Grafana.

Do you have updated templates for the three example Grafana screen shots that you could post to update to a more current version of Grafana? I'm on Version 6.7.4 (NA) on Fedora.

I am using a PVS5 but I don't know that there are any differences in the data you are scraping with this app compared to your PVS6. I really like the Grafana dashboards you have created.

Kevin

Thanks for this.

I just got my panels turned on today. I currently have a rasberry pi running influxdb and grafana getting data from my hubitat. I would love to get this going to and gatter data directly from the PVS. Any way to contact you if I get stuck?

Not finding IP4 address with Sunpower DNS.

My PSV5 failed and was replaced with a PSV6 without the ethernet ports. It is running on two dongles, one to my pi and one to the internet switch. My pi no longer receives an IP4 address from SunPower. Could this be a result of changing from RJ45 to USB then to ethernet through a dongle? The previous hard coded 172.27.153.1 address no longer works.

Not sure how to troubleshoot it.

sunpowerconsole.com timing out

I can access the console using 172.27.153.1 so I know it's working. I tried hard coding that into exporter.py but it won't take for some reason. I did setup.py build and setup.py install but sunpowerconsole.com still keeps coming up in a journalctl error as below.

Is the Sunpower PSV5 dhcp server sending a bad hostname somehow? The hardcoded address comes up in the sunpower-pvs-exporter .egg file in dist-packages. Stumped.

requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='sunpowerconsole.com', port=80): Max retries exceeded with url: /cgi-bin/dl_cgi?Command=Start (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x757aba50>, 'Connection to sunpowerconsole.com timed out. (connect timeout=30)'))

curl http://sunpower.console.com/cgi-bin/dl_cgi?Command=Start

<title>404 Not Found</title>

Not Found

The requested URL /cgi-bin/dl_cgi was not found on this server.

curl http://172.27.153.1/cgi-bin/dl_cgi?Command=Start
{
"result": "succeed",
"supervisor": {
"SWVER": "2022.3, Build 5206",
"SERIAL": "ZT182985000441D1548",
"MODEL": "PVS5",
"FWVER": "0.0.0"
}
}

Docker support

Anyone been able to get this working with Docker? I made a simple Dockerfile with python:3 as a base image and the pip installing this package, seems to run fine and I can see the metrics streaming from the PVS in the logs, but when I curl http://localhost:9110/ I just get a message A server error occurred. Please contact the administrator.

I tried setting --log-level to DEBUG but I'm not seeing any useful error messages there.

Can't connect Grafana/Prometus and sun app

I think I have everything configured correctly.

I have Prometheus and Grafana set to start on boot. Running curl http://localhost:9110/ returns the data as expected. When to into the new install of Grafana and I add Prometheus as a data source I click test and get no errors. When I look into the query and run it I can see that it returns the same results as curl under cli.

The data, however, still remain to have zero data and under the inspect I get e.data.data is undefined under the error tab.

What am I missing?

Update pypi?

I just got bit by a fresh install having celsius misspelled, would it be possible to push a newer revision to pypi?

Field missing `p_mpptsum_kw` (2021.11 Build 60203)

I'm running:
"SWVER": "2021.11, Build 60203"

Here is the fields:

{
      "ISDETAIL": true,
      "SERIAL": "E00122116029005",
      "TYPE": "SOLARBRIDGE",
      "STATE": "working",
      "STATEDESCR": "Working",
      "MODEL": "AC_Module_Type_G",
      "DESCR": "Inverter E00122116029005",
      "DEVICE_TYPE": "Inverter",
      "hw_version": "4400",
      "interface": "mime",
      "module_serial": "",
      "PANEL": "SPR-A415-G-AC",
      "slave": 0,
      "SWVER": "4.21.3",
      "PORT": "",
      "MOD_SN": "",
      "NMPLT_SKU": "",
      "DATATIME": "2022,01,24,21,08,06",
      "ltea_3phsum_kwh": "96.0818",
      "p_3phsum_kw": "0.2435",
      "vln_3phavg_v": "247.76",
      "i_3phsum_a": "0.98",
      "p_mppt1_kw": "0.2485",
      "v_mppt1_v": "39.92",
      "i_mppt1_a": "6.22",
      "t_htsnk_degc": "26",
      "freq_hz": "60.02",
      "stat_ind": "0",
      "origin": "data_logger",
      "OPERATION": "noop",
      "CURTIME": "2022,01,24,21,08,11"
    },

I don't see the p_mpptsum_kw field. Wondering if anybody else is seeing something similar :)

I get only: "result": "no command"

When I connect my computer to the internal/inverter interface, I receive the expected DHCP address and can talk to the http server on port 80 just fine, but when I sent a command of "DeviceList", I got back only:
"result": "no command"
I then figured maybe I needed to send "Start" first, but that seemed to result in the same response.
Maybe my device isn't at the same revision level as what is expected by your code?
Do you have any input which may help narrow this down?
Any help would be greatly appreciated!

Exceptions When Running sunpower-pvs-exporter (but I can still get stats from curl localhost:9110)

2020-09-18 15:18:51,857 Listening on port 9110...
Traceback (most recent call last):
File "/usr/lib/python3.7/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/lib/python3.7/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 332, in send_headers
self.send_preamble()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
File "/usr/lib/python3.7/wsgiref/handlers.py", line 453, in _write
result = self.stdout.write(data)
File "/usr/lib/python3.7/socketserver.py", line 799, in write
self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

Exception happened during processing of request from ('127.0.0.1', 36896)
Traceback (most recent call last):
File "/usr/lib/python3.7/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/lib/python3.7/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 332, in send_headers
self.send_preamble()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
File "/usr/lib/python3.7/wsgiref/handlers.py", line 453, in _write
result = self.stdout.write(data)
File "/usr/lib/python3.7/socketserver.py", line 799, in write
self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.7/wsgiref/handlers.py", line 141, in run
self.handle_error()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 368, in handle_error
self.finish_response()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/lib/python3.7/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/usr/lib/python3.7/wsgiref/handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "/usr/lib/python3.7/wsgiref/handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.7/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.7/wsgiref/simple_server.py", line 133, in handle
handler.run(self.server.get_app())
File "/usr/lib/python3.7/wsgiref/handlers.py", line 144, in run
self.close()
File "/usr/lib/python3.7/wsgiref/simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'

Triggering CPU/session/memory leak on recent PVS6 firmware releases

This probably isn't a bug with the exporter itself, but late last year my PVS6 unit (2021.11, Build 60203 when I was diagnosing this) started getting unstable when monitored using the exporter, turning its status LED to fault-orange after about a day of uptime, with metrics collection first becoming unstable and then failing entirely. Attaching an issue here since it's where users of the exporter are probably going to look, and because this is where it'll have to be worked around if Sunpower doesn't fix it (which they have little incentive to do).

What appears to be happening is that the PVS6 starts to respond more slowly to the exporter's commands, until it eventually reaches the request timeout and appears to go dead. The sunpower_pvs_supervisor_cpu_loadavg metric rises on a roughly-exponential curve until that point:

pvs6-leak

sunpower_pvs_supervisor_cpu_loadavg comes from the supervisor device's dl_cpu_load value, and although that leaves some ambiguity in whether it's CPU utilization or loadavg, I suspect the exporter's interpretation is correct, especially because a memory leak in the supervisor causing a gradual increase in demand paging is a much likelier bug than a CPU leak, e.g. if the supervisor is doing some sort of inefficient traversal over an increasingly large internal data structure or something.

This doesn't happen if the exporter isn't collecting, so I'm currently doing some testing with reduced scrape intervals to see if the time to failure is proportional to scrape rate.

This doesn't affect Sunpower's first-party monitoring consoles because the data feed to them is a periodic batch push rather than collection, where a thrash in the PVS6's virtual memory will typically only cause delays, not dropouts.

DC Power reported as NaN from Inverters

When running the exporter against my sw, I get NaN from the Inverters for DC Power:

# HELP sunpower_pvs_inverter_dc_power_watts DC Power
# TYPE sunpower_pvs_inverter_dc_power_watts gauge
sunpower_pvs_inverter_dc_power_watts{description="Inverter E00122143041619",device_id="E00122143041619",model="AC_Module_Type_E",module_id="",port="",software_version="4.21.3",type="SOLARBRIDGE"} NaN
sunpower_pvs_inverter_dc_power_watts{description="Inverter E00122143041624",device_id="E00122143041624",model="AC_Module_Type_E",module_id="",port="",software_version="4.21.3",type="SOLARBRIDGE"} NaN

Tracked it down to this field:
p_mpptsum_kw
changing to:
p_mppt1_kw

Software version:
"SWVER": "2022.10, Build 61120"

After I changed that locally in exporter.py, the values are reported correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.