From d295cc8af753ec0139d8575f4b4b5e162a51bf99 Mon Sep 17 00:00:00 2001 From: mrtg Date: Sat, 13 May 2023 19:59:02 +0200 Subject: [PATCH] add tasmota power monitoring --- config/tasmota.cfg | 31 ++++++++++++++++---------- htdocs/crypto.html | 2 +- htdocs/index.html | 2 +- htdocs/lxc.html | 2 +- htdocs/power.html | 39 +++++++++++++++++++++++++++++++++ scripts/lxc_index.sh | 2 +- tmpl/tasmota-trockner.tmpl | 16 ++++++++++++++ tmpl/tasmota-tv.tmpl | 16 ++++++++++++++ tmpl/tasmota-waschmaschine.tmpl | 16 ++++++++++++++ 9 files changed, 110 insertions(+), 16 deletions(-) create mode 100644 htdocs/power.html create mode 100644 tmpl/tasmota-trockner.tmpl create mode 100644 tmpl/tasmota-tv.tmpl create mode 100644 tmpl/tasmota-waschmaschine.tmpl diff --git a/config/tasmota.cfg b/config/tasmota.cfg index 77be7ee..b81698b 100644 --- a/config/tasmota.cfg +++ b/config/tasmota.cfg @@ -1,24 +1,31 @@ -Target[Wohnzimmer-Couchlicht.power]: `curl -s "http://192.168.178.38/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` -Title[Wohnzimmer-Couchlicht.power]: [Power] Wohnzimmer-Couchlicht -MaxBytes[Wohnzimmer-Couchlicht.power]: 42949672950000000 +LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt +WorkDir: /var/www/mrtg/rrd +LogFormat: rrdtool -Target[Wohnzimmer-Pflanze.power]: `curl -s "http://192.168.178.30/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` -Title[Wohnzimmer-Pflanze.power]: [Power] Wohnzimmer-Pflanze -MaxBytes[Wohnzimmer-Pflanze.power]: 42949672950000000 +#Target[Wohnzimmer-Couchlicht.power]: `curl -s "http://192.168.178.38/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` +#Title[Wohnzimmer-Couchlicht.power]: [Power] Wohnzimmer-Couchlicht +#MaxBytes[Wohnzimmer-Couchlicht.power]: 42949672950000000 -Target[Wohnzimmer-Tischlampe.power]: `curl -s "http://192.168.178.78/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` -Title[Wohnzimmer-Tischlampe.power]: [Power] Wohnzimmer-Tischlampe -MaxBytes[Wohnzimmer-Tischlampe.power]: 42949672950000000 +#Target[Wohnzimmer-Pflanze.power]: `curl -s "http://192.168.178.30/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` +#Title[Wohnzimmer-Pflanze.power]: [Power] Wohnzimmer-Pflanze +#MaxBytes[Wohnzimmer-Pflanze.power]: 42949672950000000 -Target[Wohnzimmer-TV.power]: `curl -s "http://192.168.178.91/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` -Title[Wohnzimmer-TV.power]: [Power] Wohnzimmer-TV -MaxBytes[Wohnzimmer-TV.power]: 42949672950000000 +#Target[Wohnzimmer-Tischlampe.power]: `curl -s "http://192.168.178.78/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` +#Title[Wohnzimmer-Tischlampe.power]: [Power] Wohnzimmer-Tischlampe +#MaxBytes[Wohnzimmer-Tischlampe.power]: 42949672950000000 Target[Keller-Waschmaschine.power]: `curl -s "http://192.168.178.89/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` Title[Keller-Waschmaschine.power]: [Power] Keller-Waschmaschine MaxBytes[Keller-Waschmaschine.power]: 42949672950000000 +Options[Keller-Waschmaschine.power]: growright,nopercent, nobanner, noinfo, gauge + +Target[Wohnzimmer-TV.power]: `curl -s "http://192.168.178.91/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` +Title[Wohnzimmer-TV.power]: [Power] Wohnzimmer-TV +MaxBytes[Wohnzimmer-TV.power]: 42949672950000000 +Options[Wohnzimmer-TV.power]: growright,nopercent, nobanner, noinfo, gauge Target[Keller-Trockner.power]: `curl -s "http://192.168.178.90/cm?cmnd=STATUS+8" | jq '.StatusSNS.ENERGY | "\(.Voltage) \(.Current)"' | sed 's/"//g; s/ /\n/g'` Title[Keller-Trockner.power]: [Power] Keller-Trockner MaxBytes[Keller-Trockner.power]: 42949672950000000 +Options[Keller-Trockner.power]: growright,nopercent, nobanner, noinfo, gauge diff --git a/htdocs/crypto.html b/htdocs/crypto.html index 77a0d6d..3afcebf 100644 --- a/htdocs/crypto.html +++ b/htdocs/crypto.html @@ -11,7 +11,7 @@ -

home lxc crypto Crypto - Monitoring

+

home lxc crypto power Monitoring

diff --git a/htdocs/index.html b/htdocs/index.html index b9f4463..0b18a77 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -12,7 +12,7 @@ -

home lxc crypto Monitoring

+

home lxc crypto power Monitoring

br0tkasten.de

diff --git a/htdocs/lxc.html b/htdocs/lxc.html index 6e2a046..f4ce4cd 100644 --- a/htdocs/lxc.html +++ b/htdocs/lxc.html @@ -11,7 +11,7 @@ -

home lxc crypto LXC - Monitoring

+

home lxc crypto power LXC - Monitoring

diff --git a/htdocs/power.html b/htdocs/power.html new file mode 100644 index 0000000..94b387b --- /dev/null +++ b/htdocs/power.html @@ -0,0 +1,39 @@ + + + + MRTG Index Page + + + + + + + + + + +

home lxc crypto power Monitoring

+ +

Power Usage

+ +
+

Wohnzimmer

+
+ [Power] Wohnzimmer - TV
+ Power Usage TV +
+
+ +
+

Keller

+
+ [Power] Keller - Waschmaschine
+ Power Usage Waschmaschine +
+
+ [Power] Keller - Trockner
+ Power Usage Trockner +
+
+ + diff --git a/scripts/lxc_index.sh b/scripts/lxc_index.sh index b722a32..414c44c 100755 --- a/scripts/lxc_index.sh +++ b/scripts/lxc_index.sh @@ -13,7 +13,7 @@ echo ' -

home lxc crypto LXC - Monitoring

+

home lxc crypto power LXC - Monitoring

' curl -s http://10.3.0.1 | sort | while read c; diff --git a/tmpl/tasmota-trockner.tmpl b/tmpl/tasmota-trockner.tmpl new file mode 100644 index 0000000..f4a9163 --- /dev/null +++ b/tmpl/tasmota-trockner.tmpl @@ -0,0 +1,16 @@ +-v power usage +-t [Power] Trockner +--full-size-mode +--color=BACK#343637 +--color=CANVAS#F0F0F0 +--color=FONT#F0F0F0 +--font=TITLE:12:DejaVu Bold +DEF:U=/var/www/mrtg/rrd/keller-trockner.power.rrd:ds0:AVERAGE +DEF:I=/var/www/mrtg/rrd/keller-trockner.power.rrd:ds1:AVERAGE +CDEF:P=U,I,* +COMMENT: max. avg. min. cur.\n +AREA:P#F5790060:Power +GPRINT:P:MAX:%6.2lf %sW +GPRINT:P:AVERAGE:%6.2lf %sW +GPRINT:P:MIN:%6.2lf %sW +GPRINT:P:LAST:%6.2lf %sW\n diff --git a/tmpl/tasmota-tv.tmpl b/tmpl/tasmota-tv.tmpl new file mode 100644 index 0000000..8e21ab6 --- /dev/null +++ b/tmpl/tasmota-tv.tmpl @@ -0,0 +1,16 @@ +-v power usage +-t [Power] TV +--full-size-mode +--color=BACK#343637 +--color=CANVAS#F0F0F0 +--color=FONT#F0F0F0 +--font=TITLE:12:DejaVu Bold +DEF:U=/var/www/mrtg/rrd/wohnzimmer-tv.power.rrd:ds0:AVERAGE +DEF:I=/var/www/mrtg/rrd/wohnzimmer-tv.power.rrd:ds1:AVERAGE +CDEF:P=U,I,* +COMMENT: max. avg. min. cur.\n +AREA:P#F5790060:Power +GPRINT:P:MAX:%6.2lf %sW +GPRINT:P:AVERAGE:%6.2lf %sW +GPRINT:P:MIN:%6.2lf %sW +GPRINT:P:LAST:%6.2lf %sW\n diff --git a/tmpl/tasmota-waschmaschine.tmpl b/tmpl/tasmota-waschmaschine.tmpl new file mode 100644 index 0000000..509e52e --- /dev/null +++ b/tmpl/tasmota-waschmaschine.tmpl @@ -0,0 +1,16 @@ +-v power usage +-t [Power] Waschmaschine +--full-size-mode +--color=BACK#343637 +--color=CANVAS#F0F0F0 +--color=FONT#F0F0F0 +--font=TITLE:12:DejaVu Bold +DEF:U=/var/www/mrtg/rrd/keller-waschmaschine.power.rrd:ds0:AVERAGE +DEF:I=/var/www/mrtg/rrd/keller-waschmaschine.power.rrd:ds1:AVERAGE +CDEF:P=U,I,* +COMMENT: max. avg. min. cur.\n +AREA:P#F5790060:Power +GPRINT:P:MAX:%6.2lf %sW +GPRINT:P:AVERAGE:%6.2lf %sW +GPRINT:P:MIN:%6.2lf %sW +GPRINT:P:LAST:%6.2lf %sW\n