1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-08-07 06:33:15 +00:00

Deye/Solarman (#1359)

* deye: fix production calculation

* solarman: add new plugins

* fix labels

* move api check

* Typo

* deye: quoting

* unfiy labels

* Typo

* Test, set Value to zero if api does not find device

* dont show errors

* Revert "dont show errors"

This reverts commit dc71783f93.

* Revert "Test, set Value to zero if api does not find device"

This reverts commit fa1853955c.

* dependency check

* remove exports

* send 0 instead of U

* dependency check

* remove exports

* check dependency removed

* send U when API isnt reachable

* add AC graphs

* Typo

* Typo

* Get all Panels

* remove var

* Typo

* Typo

* Typo

* packe Logik in Funktionen; Frage Daten im Fehlerfall mehrfach ab

* Zähler umgebaut

* Remove Panel Plugin

* deactivate panel 3+4

* api reachable check

* unknown limits

* warnings

* area

* deye: printf http://munin-monitoring.org/faq#q-why-does-my-users-plugin-report-floating-point-numbers

* deaktiviere graph scaling

* setze base

* schreibe retries

* graph opts

* statefile

* deye statefile

* x

* Info
This commit is contained in:
Michael Grote 2023-03-16 17:17:53 +01:00 committed by GitHub
parent 2815f944a3
commit f140a08c16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 320 additions and 40 deletions

View file

@ -15,6 +15,7 @@ Dependencies:
- wget
- awk
- sed
- bc
plugin config:
@ -22,6 +23,8 @@ plugin config:
env.user <User>
env.password <SECRET_PASS>
env.ip <ip/fqdn>
env.serial_number 2XXXXXXXXX6-1
=head1 AUTHOR
@ -57,77 +60,88 @@ EOF
# check if inverter is reachable
# inverter is off when there is not enough light to power it
# so it is safe to assume that current power etc. are zero
if ping "${ip}" -c1 -W 3 2>&1 > /dev/null ; then
current_power=$(wget --quiet --user "${user}" --password "${password}" -O - "${ip}"/status.html | grep "var webdata_now_p" | awk 'BEGIN {FS="="}{print $2}' | sed 's/[^0-9]*//g')
daily_yield=$(wget --quiet --user "${user}" --password "${password}" -O - "${ip}"/status.html | grep "var webdata_today_e" | awk 'BEGIN {FS="="}{print $2}' | sed 's/[^0-9]*//g')
total_yield=$(wget --quiet --user "${user}" --password "${password}" -O - "${ip}"/status.html | grep "var webdata_total_e" | awk 'BEGIN {FS="="}{print $2}' | sed 's/[^0-9]*//g')
# get data
data=$(wget --quiet --user "${user}" --password "${password}" -O - "${ip}"/status.html)
truncate -s 0 "$MUNIN_STATEFILE"
current_power=$(echo "$data" | grep "var webdata_now_p" | awk 'BEGIN {FS="="}{print $2}' | sed 's/[^0-9]*//g' )
daily_yield=$(echo "$data" | grep "var webdata_today_e" | awk 'BEGIN {FS="="}{print $2}' | sed 's/[^0-9\.]*//g')
total_yield=$(echo "$data" | grep "var webdata_total_e" | awk 'BEGIN {FS="="}{print $2}' | sed 's/[^0-9\.]*//g')
reachable="1"
echo "$daily_yield" >> "$MUNIN_STATEFILE"
echo "$total_yield" >> "$MUNIN_STATEFILE"
else
current_power="0"
daily_yield=U
total_yield=U
reachable="0"
daily_yield=$(cat $MUNIN_STATEFILE | head -n1)
total_yield=$(cat $MUNIN_STATEFILE | tail -n1)
fi
# wenn parameter = ...
if [ "$1" = "autoconf" ]; then
echo yes
if [ ! -x "$(command -v wget)" ]; then
echo "no (wget not found)"
elif [ ! -x "$(command -v awk)" ]; then
echo "no (awk not found)"
elif [ ! -x "$(command -v sed)" ]; then
echo "no (sed not found)"
elif [ ! -x "$(command -v bc)" ]; then
echo "no (bc not found)"
fi
exit 0
fi
if [ "$1" = "config" ]; then
# setze optionen
echo multigraph current_power
echo graph_title Deye current Power
echo 'graph_vlabel watt'
echo 'graph_category sensors'
echo 'graph_args -l 0'
echo "multigraph current_power"
echo "graph_title Current Power - Local - SN: ${serial_number}"
echo "graph_vlabel watt"
echo "graph_category sensors"
echo "graph_args -l 0"
echo "graph_info Current generated power in Watt."
echo current_power.label watt
echo "current_power.label watt"
echo multigraph daily_yield
echo graph_title Deye daily Yield
echo 'graph_vlabel kWh'
echo 'graph_category sensors'
echo 'graph_args -l 0'
echo "multigraph daily_yield"
echo "graph_title Daily Yield - Local - SN: ${serial_number}"
echo "graph_vlabel kWh"
echo "graph_category sensors"
echo "graph_args -l 0"
echo "graph_info Power generated today."
echo daily_yield.label kWh
echo daily_yield.draw AREA
echo "daily_yield.label kWh"
echo "daily_yield.draw AREA"
echo multigraph total_yield
echo graph_title Deye Total Yield
echo 'graph_vlabel kWh'
echo 'graph_category sensors'
echo 'graph_args -l 0'
echo "multigraph total_yield"
echo "graph_title Total Yield - Local - SN: ${serial_number}"
echo "graph_vlabel kWh"
echo "graph_category sensors"
echo "graph_args -l 0"
echo "graph_info Total generated power."
echo total_yield.label kWh
echo total_yield.draw AREA
echo "total_yield.label kWh"
echo "total_yield.draw AREA"
echo multigraph reachable
echo graph_title Deye inverter reachable
echo 'graph_vlabel on/off'
echo 'graph_category sensors'
echo 'graph_args -l 0'
echo "multigraph reachable"
echo "graph_printf %6.0lf"
echo "graph_title Inverter reachable - Local - SN: ${serial_number}"
echo "graph_vlabel on/off"
echo "graph_category sensors"
echo "graph_args -l 0"
echo "graph_info Is the Inverter is reachable? 1 is On, 0 is Off"
echo reachable.label on/off
echo reachable.draw AREA
echo "reachable.label on/off"
echo "reachable.draw AREA"
exit 0
fi
echo multigraph current_power
echo "multigraph current_power"
echo "current_power.value $current_power"
echo multigraph daily_yield
echo "multigraph daily_yield"
echo "daily_yield.value $daily_yield"
echo multigraph total_yield
echo "multigraph total_yield"
echo "total_yield.value $total_yield"
echo multigraph reachable
echo "multigraph reachable"
echo "reachable.value $reachable"
exit 0