Compare commits

..

No commits in common. "71c62845d88d619c76b660bbc5d202b6113a2749" and "a80481879261814a76e826e93f5bbd2315aefad2" have entirely different histories.

3 changed files with 12 additions and 36 deletions

View File

@ -1,29 +1,10 @@
# SolarEdge Inverter Exporter
# SolarEdge Cloud API Exporter
## Local Modbus/TCP Exporter
## Configuration
Usage:
```
solaredge_modbus.py [-d] [-l LISTEN] [-p PORT] HOST [PORT]
Prometheus exporter for SolarEdge inverters
positional arguments:
HOST Inverter Network Address
PORT Inverter Modbus/TCP port (default: 1502)
options:
-h, --help show this help message and exit
-d, --debug Enable debug info in HTTP answers (default: False)
-l LISTEN, --listen LISTEN
Address to bind for the HTTP server (default: localhost)
-p PORT, --listen-port PORT
Port of the HTTP server (default: 9150)
```
## Cloud API Exporter
Edit the `solaredge_api` script and put your API key, site id and inverter serial number
Edit the script and put your API key, site id and inverter serial number
Edit the listening host and port if needed
## Usage
Run the script as a service, add the URL to prometheus.

View File

@ -12,9 +12,6 @@ site_id = 4143190
inverter = '7B0E5700-E0'
listen = 'localhost'
port = 9150
endpoint = "https://monitoringapi.solaredge.com/"
query_delta = datetime.timedelta(minutes=20)
@ -175,7 +172,7 @@ def metrics():
return format_metrics(collect())
def main():
bottle.run(host=listen, port=port)
bottle.run(host='localhost', port=9150)
if __name__ == '__main__':

View File

@ -59,14 +59,12 @@ def export(d, m):
def main():
parser = argparse.ArgumentParser(prog='solaredge_modbus.py',
description='Prometheus exporter for SolarEdge inverters',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-d', '--debug', action='store_true', help="Enable debug info in HTTP answers")
parser.add_argument('-l', '--listen', default='localhost', help="Address to bind for the HTTP server")
parser.add_argument('-p', '--listen-port', default='9150', help="Port of the HTTP server")
parser.add_argument('host', help="Network address of the inverter to monitor")
parser.add_argument('port', nargs='?', default=1502, help="Inverter Modbus/TCP port")
parser = argparse.ArgumentParser(prog='solaredge_modbus.py', description='SolarEdge Modbus Exporter')
parser.add_argument('-d', '--debug', action='store_true')
parser.add_argument('-b', '--bind', default='localhost')
parser.add_argument('-p', '--bind-port', default='9150')
parser.add_argument('host')
parser.add_argument('port', nargs='?', default=1502)
args = parser.parse_args()