Skip to content

Commit

Permalink
Initial commit to add the se2influx.py utility. (jbuehl#171)
Browse files Browse the repository at this point in the history
The se2influx.py utility will accept semonitor.py input from stdin (allowing
you to use to pipe semonitor.py output into it) and write it to an influxdb instance.

Inverters and optimizers will be written to seperate measurements, with their
unique serial numbers acting as tags, and the rest of the semonitor fields will
be sent verbatim to your influxdb as native fields.

Lastly, se2influx (optionally) allows for writing of ingested semonitor data to
a log file on disk, with built-in log file rotation and compression.  This
allows you to eliminate any uses of "tee" in your piped commands, and permits
you to replay any data that was failed to be sent to your influxdb host (due to
host downtime, etc) at a later date by simplying cat-ing the relevant log
file(s) into the se2influx.py script.

pps.  We also include a "se2influx" script as an example of how you might
want to execute it in conjunction with semonitor.py

Co-authored-by: root <[email protected]>
  • Loading branch information
eschwim and root authored Oct 13, 2022
1 parent ad11571 commit f097b3b
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/se2influx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -

set -eu -o pipefail

INVERTERS=012345AB
USB_DEVICE=/dev/ttyUSB0
INFLUX_HOST=influxdb
INFLUX_USER=semonitor
INFLUX_PASS=XXXXXXXXX
SEMONITOR_LOG=/var/log/semonitor/semonitor.log

/usr/local/bin/solaredge/semonitor.py -m -t 4 -s $INVERTERS $USB_DEVICE | \
/usr/local/bin/solaredge/utilities/se2influx.py \
--host $INFLUX_HOST \
--username $INFLUX_USER \
--password $INFLUX_PASS \
--stat_timer_secs 300 \
--log_path $SEMONITOR_LOG
Loading

0 comments on commit f097b3b

Please sign in to comment.