From 8bb098beaa566aa66eaa03dc09faccb21eeac817 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 10 Dec 2016 11:00:03 +0100 Subject: [PATCH 01/22] adjusted to Device changes --- src/lib/ebus/test/test_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ebus/test/test_device.cpp b/src/lib/ebus/test/test_device.cpp index e9c3260d..a2faf7ad 100644 --- a/src/lib/ebus/test/test_device.cpp +++ b/src/lib/ebus/test/test_device.cpp @@ -24,7 +24,7 @@ using namespace std; int main () { - Device* device = Device::create("/dev/ttyUSB20", true, false, NULL); + Device* device = Device::create("/dev/ttyUSB20", true, false); if (device == NULL) { cout << "unable to create device" << endl; return -1; From 27438c26513e12f617f3c3e4b7e17f2fdcefae53 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 10 Dec 2016 11:00:32 +0100 Subject: [PATCH 02/22] adjusted to Device changes --- src/lib/ebus/test/test_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ebus/test/test_device.cpp b/src/lib/ebus/test/test_device.cpp index a2faf7ad..b06ab253 100644 --- a/src/lib/ebus/test/test_device.cpp +++ b/src/lib/ebus/test/test_device.cpp @@ -24,7 +24,7 @@ using namespace std; int main () { - Device* device = Device::create("/dev/ttyUSB20", true, false); + Device* device = Device::create("/dev/ttyUSB20", true, false, false); if (device == NULL) { cout << "unable to create device" << endl; return -1; From e2d70582baac15ceeb708ae873ee3349f3e01606 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 10 Dec 2016 10:12:49 +0000 Subject: [PATCH 03/22] updated md5sums --- contrib/archlinux/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/archlinux/PKGBUILD b/contrib/archlinux/PKGBUILD index a83a8137..5c6fcce5 100644 --- a/contrib/archlinux/PKGBUILD +++ b/contrib/archlinux/PKGBUILD @@ -37,4 +37,4 @@ package() { install -m 0644 contrib/archlinux/conf.d/ebusd "${pkgdir}/etc/conf.d/ebusd" } # update md5sums: updpkgsums -md5sums=('94997edc61f02fc939743ff04c4e505a') +md5sums=('eaa61b16da89a23049e73dfddfc0f78d') From b2290fbed9062ee3f203aab1fce5d1917a9f0951 Mon Sep 17 00:00:00 2001 From: john30 Date: Mon, 26 Jan 2015 22:42:00 +0100 Subject: [PATCH 04/22] Initial commit --- contrib/munin/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 contrib/munin/README.md diff --git a/contrib/munin/README.md b/contrib/munin/README.md new file mode 100644 index 00000000..d4a9b795 --- /dev/null +++ b/contrib/munin/README.md @@ -0,0 +1,2 @@ +# ebusd-munin +Collection of munin plugins related to ebusd. From 0bb4e91ae9709a90b47179092f8ac3a5f5d04e56 Mon Sep 17 00:00:00 2001 From: john30 Date: Mon, 26 Jan 2015 22:49:45 +0100 Subject: [PATCH 05/22] Update README.md --- contrib/munin/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/contrib/munin/README.md b/contrib/munin/README.md index d4a9b795..6bade59e 100644 --- a/contrib/munin/README.md +++ b/contrib/munin/README.md @@ -1,2 +1,15 @@ # ebusd-munin Collection of munin plugins related to ebusd. +These plugins can easily be used to feeda munin node with data from a local ebusd instance. +Personally, I use them for checking mainly temperatures, pressures and earned energy of my heatpump. Looking at the graphs produced by munin I find it rather easy to know what's going on in the heatpump. + +# Installation: +- prerequisite is of course a running munin installation on the local host +- to install the plugins: + - git checkout https://github.com/john30/ebusd-munin.git + - chmod a+x ebusd-munin/plugins/* + - sudo cp ebusd-munin/plugins/* /etc/munin/plugins + - sudo munin-node-configure --shell + - run all "ln -s" commands printed by munin-node-configure + - sudo service munin-node reload + - that's it From b4b41afdcff4434a9df9178a5413a2c5e45dd776 Mon Sep 17 00:00:00 2001 From: john30 Date: Mon, 26 Jan 2015 22:52:19 +0100 Subject: [PATCH 06/22] Update README.md --- contrib/munin/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/munin/README.md b/contrib/munin/README.md index 6bade59e..f874bb31 100644 --- a/contrib/munin/README.md +++ b/contrib/munin/README.md @@ -1,6 +1,7 @@ # ebusd-munin -Collection of munin plugins related to ebusd. -These plugins can easily be used to feeda munin node with data from a local ebusd instance. +Collection of munin plugins (see http://munin-monitoring.org/) related to ebusd (see http://github.com/john30/ebusd/). + +These plugins can easily be used to feed a munin node with data from a local ebusd instance. Personally, I use them for checking mainly temperatures, pressures and earned energy of my heatpump. Looking at the graphs produced by munin I find it rather easy to know what's going on in the heatpump. # Installation: From ccb9d45a3ce32449901d0325ee460f9db2ef8778 Mon Sep 17 00:00:00 2001 From: john30 Date: Mon, 26 Jan 2015 23:31:52 +0100 Subject: [PATCH 07/22] first version with combined plugin for pressure, temperature, and power --- contrib/munin/README.md | 8 +++---- contrib/munin/plugins/ebusd_ | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100755 contrib/munin/plugins/ebusd_ diff --git a/contrib/munin/README.md b/contrib/munin/README.md index f874bb31..d8bfc65f 100644 --- a/contrib/munin/README.md +++ b/contrib/munin/README.md @@ -8,9 +8,9 @@ Personally, I use them for checking mainly temperatures, pressures and earned en - prerequisite is of course a running munin installation on the local host - to install the plugins: - git checkout https://github.com/john30/ebusd-munin.git - - chmod a+x ebusd-munin/plugins/* - - sudo cp ebusd-munin/plugins/* /etc/munin/plugins + - sudo cp ebusd-munin/plugins/* /usr/share/munin/plugins/ - sudo munin-node-configure --shell - - run all "ln -s" commands printed by munin-node-configure + - run all "ln -s" commands printed by munin-node-configure and containing "ebusd_" - sudo service munin-node reload - - that's it + +that's it. diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ new file mode 100755 index 00000000..49634882 --- /dev/null +++ b/contrib/munin/plugins/ebusd_ @@ -0,0 +1,46 @@ +#!/bin/bash +#%# family=auto +#%# capabilities=autoconf +#%# capabilities=suggest +. $MUNIN_LIBDIR/plugins/plugin.sh +if [ "$1" = "autoconf" ]; then + echo "yes" + exit 0 +fi +if [ "$1" = "suggest" ]; then + echo "temp" + echo "press" + echo "power" + exit 0 +fi +prefix=`basename "$0"` +if [ "$prefix" = "ebusd_temp" ]; then + sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp" +elif [ "$prefix" = "ebusd_press" ]; then + sensors="BrinePress HeatSystemPress VaporPressHigh VaporPressLow" +else + sensors="ActualEnvironmentPower" +fi +if [ "$1" = "config" ]; then + if [ "$prefix" = "ebusd_temp" ]; then + echo "graph_title ebusd Temperaturen" + echo "graph_vlabel Grad" + elif [ "$prefix" = "ebusd_press" ]; then + echo "graph_title ebusd Drucksensoren" + echo "graph_vlabel Bar" + else + echo "graph_title ebusd Ertrag" + echo "graph_vlabel kW" + fi + echo 'graph_category Heizung' + for sensor in $sensors; do + echo ${prefix}_${sensor}.label $sensor + print_warning ${prefix}_$sensor + print_critical ${prefix}_$sensor + done + exit 0 +fi +for sensor in $sensors; do + RESULT=`echo "r $sensor"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` + echo ${prefix}_${sensor}.value $RESULT +done From 5c31dc60ec0ab63d8d2adfbcc9d20c8e7165f55e Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 21 Feb 2015 13:01:34 +0100 Subject: [PATCH 08/22] add room temperature --- contrib/munin/plugins/ebusd_ | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 49634882..659a49c8 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -15,7 +15,7 @@ if [ "$1" = "suggest" ]; then fi prefix=`basename "$0"` if [ "$prefix" = "ebusd_temp" ]; then - sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp" + sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp RoomTemp rc4:RoomTemp" elif [ "$prefix" = "ebusd_press" ]; then sensors="BrinePress HeatSystemPress VaporPressHigh VaporPressLow" else @@ -34,13 +34,17 @@ if [ "$1" = "config" ]; then fi echo 'graph_category Heizung' for sensor in $sensors; do - echo ${prefix}_${sensor}.label $sensor - print_warning ${prefix}_$sensor - print_critical ${prefix}_$sensor + echo ${prefix}_${sensor/:/_}.label $sensor + print_warning ${prefix}_${sensor/:/_} + print_critical ${prefix}_${sensor/:/_} done exit 0 fi for sensor in $sensors; do - RESULT=`echo "r $sensor"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` - echo ${prefix}_${sensor}.value $RESULT + if [ "${sensor/:/_}" = "$sensor" ]; then + RESULT=`echo "r $sensor"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` + else + RESULT=`echo "r -c ${sensor/:/ }"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` + fi + echo ${prefix}_${sensor/:/_}.value $RESULT done From 17e4fd08c804b2a32b392bf88bcd83752c509cb6 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 22 Feb 2015 14:02:47 +0100 Subject: [PATCH 09/22] added YieldEnvironmentEnergy to new energy diagram --- contrib/munin/plugins/ebusd_ | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 659a49c8..0c9e3831 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -11,6 +11,7 @@ if [ "$1" = "suggest" ]; then echo "temp" echo "press" echo "power" + echo "energy" exit 0 fi prefix=`basename "$0"` @@ -18,8 +19,10 @@ if [ "$prefix" = "ebusd_temp" ]; then sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp RoomTemp rc4:RoomTemp" elif [ "$prefix" = "ebusd_press" ]; then sensors="BrinePress HeatSystemPress VaporPressHigh VaporPressLow" -else +elif [ "$prefix" = "ebusd_power" ]; then sensors="ActualEnvironmentPower" +else + sensors="YieldEnvironmentEnergy" fi if [ "$1" = "config" ]; then if [ "$prefix" = "ebusd_temp" ]; then @@ -28,13 +31,19 @@ if [ "$1" = "config" ]; then elif [ "$prefix" = "ebusd_press" ]; then echo "graph_title ebusd Drucksensoren" echo "graph_vlabel Bar" + elif [ "$prefix" = "ebusd_power" ]; then + echo "graph_title ebusd Leistung" + echo "graph_vlabel kW" else echo "graph_title ebusd Ertrag" - echo "graph_vlabel kW" + echo "graph_vlabel kWh" fi echo 'graph_category Heizung' for sensor in $sensors; do echo ${prefix}_${sensor/:/_}.label $sensor + if [ "$prefix" = "ebusd_energy" ]; then + echo ${prefix}_${sensor/:/_}.type COUNTER + fi print_warning ${prefix}_${sensor/:/_} print_critical ${prefix}_${sensor/:/_} done From c3336cf7a5c75e54abefca382e7702e306d2a07e Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 22 Feb 2015 18:26:49 +0100 Subject: [PATCH 10/22] combine power and energy diff in one graph and fix graph period for kWh data type --- contrib/munin/plugins/ebusd_ | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 0c9e3831..4d067be2 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -11,7 +11,6 @@ if [ "$1" = "suggest" ]; then echo "temp" echo "press" echo "power" - echo "energy" exit 0 fi prefix=`basename "$0"` @@ -19,10 +18,8 @@ if [ "$prefix" = "ebusd_temp" ]; then sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp RoomTemp rc4:RoomTemp" elif [ "$prefix" = "ebusd_press" ]; then sensors="BrinePress HeatSystemPress VaporPressHigh VaporPressLow" -elif [ "$prefix" = "ebusd_power" ]; then - sensors="ActualEnvironmentPower" else - sensors="YieldEnvironmentEnergy" + sensors="YieldEnvironmentEnergy ActualEnvironmentPower" fi if [ "$1" = "config" ]; then if [ "$prefix" = "ebusd_temp" ]; then @@ -31,18 +28,19 @@ if [ "$1" = "config" ]; then elif [ "$prefix" = "ebusd_press" ]; then echo "graph_title ebusd Drucksensoren" echo "graph_vlabel Bar" - elif [ "$prefix" = "ebusd_power" ]; then - echo "graph_title ebusd Leistung" - echo "graph_vlabel kW" else - echo "graph_title ebusd Ertrag" - echo "graph_vlabel kWh" + echo "graph_title ebusd Leistung/Ertrag" + echo "graph_vlabel kW" + echo "graph_period hour" fi echo 'graph_category Heizung' for sensor in $sensors; do - echo ${prefix}_${sensor/:/_}.label $sensor - if [ "$prefix" = "ebusd_energy" ]; then + if [ ! "${sensor/nergy/}" = "$sensor" ]; then + echo ${prefix}_${sensor/:/_}.label "$sensor [diff]" echo ${prefix}_${sensor/:/_}.type COUNTER + echo ${prefix}_${sensor/:/_}.draw AREA + else + echo ${prefix}_${sensor/:/_}.label $sensor fi print_warning ${prefix}_${sensor/:/_} print_critical ${prefix}_${sensor/:/_} From ce12c93066245c9bedad3954642e1ada6ce16865 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 28 Mar 2015 08:44:14 +0100 Subject: [PATCH 11/22] autoconf by using find command --- contrib/munin/plugins/ebusd_ | 56 +++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 4d067be2..1847c9b9 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -1,4 +1,5 @@ #!/bin/bash +# Munn plugin for ebusd. #%# family=auto #%# capabilities=autoconf #%# capabilities=suggest @@ -14,44 +15,59 @@ if [ "$1" = "suggest" ]; then exit 0 fi prefix=`basename "$0"` -if [ "$prefix" = "ebusd_temp" ]; then - sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp RoomTemp rc4:RoomTemp" -elif [ "$prefix" = "ebusd_press" ]; then - sensors="BrinePress HeatSystemPress VaporPressHigh VaporPressLow" +type=${prefix##ebusd_} +skip= +if [ "$type" = "temp" ]; then + match="Temp(Input|Output|Bottom|Top)?\$|outsidetemp" + skip="Bivalent|Max|Min|Outside|mc5:" +elif [ "$type" = "press" ]; then + match="Press(High|Low)?\$" + skip="KeyPress" else - sensors="YieldEnvironmentEnergy ActualEnvironmentPower" + match="Environment(Energy|Power)\$" +fi +result=`echo "find"|nc localhost 8888 2>/dev/null` +if [ -z "$result" -o "x${result##ERR:*}" = "x" ]; then + echo "error: $result" + exit 1 +fi +sensors=`echo "$result"|sed -e 's# =.*$##' -e 's# #:#'|egrep "$match"` +if [ -n "$skip" ]; then + sensors=`echo "$sensors"|egrep -v "$skip"` fi if [ "$1" = "config" ]; then - if [ "$prefix" = "ebusd_temp" ]; then - echo "graph_title ebusd Temperaturen" + if [ "$type" = "temp" ]; then + echo "graph_title ebus Temperaturen" echo "graph_vlabel Grad" - elif [ "$prefix" = "ebusd_press" ]; then - echo "graph_title ebusd Drucksensoren" + elif [ "$type" = "press" ]; then + echo "graph_title ebus Drucksensoren" echo "graph_vlabel Bar" else - echo "graph_title ebusd Leistung/Ertrag" + echo "graph_title ebus Leistung/Ertrag" echo "graph_vlabel kW" echo "graph_period hour" fi echo 'graph_category Heizung' for sensor in $sensors; do - if [ ! "${sensor/nergy/}" = "$sensor" ]; then - echo ${prefix}_${sensor/:/_}.label "$sensor [diff]" + result=`echo "read -c ${sensor/:/ }"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` + if [ "x$result" = "x-" -o "x${result##ERR:*}" = "x" ]; then + continue + fi + if [ ! "${sensor%%Energy}" = "$sensor" ]; then + echo ${prefix}_${sensor/:/_}.label ${sensor/:/ } "[diff]" echo ${prefix}_${sensor/:/_}.type COUNTER echo ${prefix}_${sensor/:/_}.draw AREA else - echo ${prefix}_${sensor/:/_}.label $sensor + echo ${prefix}_${sensor/:/_}.label ${sensor/:/ } fi - print_warning ${prefix}_${sensor/:/_} - print_critical ${prefix}_${sensor/:/_} +# print_warning ${prefix}_${sensor/:/_} +# print_critical ${prefix}_${sensor/:/_} done exit 0 fi for sensor in $sensors; do - if [ "${sensor/:/_}" = "$sensor" ]; then - RESULT=`echo "r $sensor"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` - else - RESULT=`echo "r -c ${sensor/:/ }"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` + result=`echo "read -c ${sensor/:/ }"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` + if [ ! "x$result" = "x-" ]; then + echo ${prefix}_${sensor/:/_}.value $result fi - echo ${prefix}_${sensor/:/_}.value $RESULT done From 4738b620913eb29eebf817c417e50db0f95cb536 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 26 Apr 2015 12:34:57 +0200 Subject: [PATCH 12/22] removed empty/duplicate temperatures --- contrib/munin/plugins/ebusd_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 1847c9b9..065495dd 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -19,7 +19,7 @@ type=${prefix##ebusd_} skip= if [ "$type" = "temp" ]; then match="Temp(Input|Output|Bottom|Top)?\$|outsidetemp" - skip="Bivalent|Max|Min|Outside|mc5:" + skip="Bivalent|Max|Min|Outside|mc5:|rcc.*:Flow|^ui" elif [ "$type" = "press" ]; then match="Press(High|Low)?\$" skip="KeyPress" From 1f30d82ef36229b1a8b2b55d8f82751061cb1e6c Mon Sep 17 00:00:00 2001 From: john30 Date: Tue, 29 Dec 2015 08:12:08 +0100 Subject: [PATCH 13/22] support dots in name --- contrib/munin/plugins/ebusd_ | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 065495dd..46df47b2 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -53,12 +53,14 @@ if [ "$1" = "config" ]; then if [ "x$result" = "x-" -o "x${result##ERR:*}" = "x" ]; then continue fi + name=${sensor/:/_} + name=${name/./_} if [ ! "${sensor%%Energy}" = "$sensor" ]; then - echo ${prefix}_${sensor/:/_}.label ${sensor/:/ } "[diff]" - echo ${prefix}_${sensor/:/_}.type COUNTER - echo ${prefix}_${sensor/:/_}.draw AREA + echo ${prefix}_${name}.label ${sensor/:/ } "[diff]" + echo ${prefix}_${name}.type COUNTER + echo ${prefix}_${name}.draw AREA else - echo ${prefix}_${sensor/:/_}.label ${sensor/:/ } + echo ${prefix}_${name}.label ${sensor/:/ } fi # print_warning ${prefix}_${sensor/:/_} # print_critical ${prefix}_${sensor/:/_} @@ -68,6 +70,8 @@ fi for sensor in $sensors; do result=`echo "read -c ${sensor/:/ }"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` if [ ! "x$result" = "x-" ]; then - echo ${prefix}_${sensor/:/_}.value $result + name=${sensor/:/_} + name=${name/./_} + echo ${prefix}_${name}.value $result fi done From 8c57b1f629974c8c92c55fe8c1b1e5de5ca30ff2 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 10 Jan 2016 12:14:00 +0100 Subject: [PATCH 14/22] added chart for hours, avoid duplicate sensor definition and reading --- contrib/munin/plugins/ebusd_ | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 46df47b2..fbb6c70a 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -12,21 +12,27 @@ if [ "$1" = "suggest" ]; then echo "temp" echo "press" echo "power" + echo "hours" exit 0 fi prefix=`basename "$0"` type=${prefix##ebusd_} +find=$type skip= if [ "$type" = "temp" ]; then match="Temp(Input|Output|Bottom|Top)?\$|outsidetemp" - skip="Bivalent|Max|Min|Outside|mc5:|rcc.*:Flow|^ui" + skip="Bivalent|Max|Min|Outside|mc.5:|rcc.*:Flow|^ui" elif [ "$type" = "press" ]; then match="Press(High|Low)?\$" skip="KeyPress" -else +elif [ "$type" = "power" ]; then + find="Environment" match="Environment(Energy|Power)\$" +else + find="hours" + skip="mc.4:|mc.5:" fi -result=`echo "find"|nc localhost 8888 2>/dev/null` +result=`echo "find $find"|nc localhost 8888 2>/dev/null` if [ -z "$result" -o "x${result##ERR:*}" = "x" ]; then echo "error: $result" exit 1 @@ -35,6 +41,7 @@ sensors=`echo "$result"|sed -e 's# =.*$##' -e 's# #:#'|egrep "$match"` if [ -n "$skip" ]; then sensors=`echo "$sensors"|egrep -v "$skip"` fi +sensors=`echo "$sensors"|sort -u` if [ "$1" = "config" ]; then if [ "$type" = "temp" ]; then echo "graph_title ebus Temperaturen" @@ -42,10 +49,14 @@ if [ "$1" = "config" ]; then elif [ "$type" = "press" ]; then echo "graph_title ebus Drucksensoren" echo "graph_vlabel Bar" - else + elif [ "$type" = "power" ]; then echo "graph_title ebus Leistung/Ertrag" echo "graph_vlabel kW" echo "graph_period hour" + else + echo "graph_title ebus Betriebsstunden" + echo "graph_vlabel h" + echo "graph_period hour" fi echo 'graph_category Heizung' for sensor in $sensors; do @@ -55,12 +66,12 @@ if [ "$1" = "config" ]; then fi name=${sensor/:/_} name=${name/./_} - if [ ! "${sensor%%Energy}" = "$sensor" ]; then + if [ "${sensor%%Energy}" = "$sensor" -a ! "$type" = "hours" ]; then + echo ${prefix}_${name}.label ${sensor/:/ } + else echo ${prefix}_${name}.label ${sensor/:/ } "[diff]" echo ${prefix}_${name}.type COUNTER echo ${prefix}_${name}.draw AREA - else - echo ${prefix}_${name}.label ${sensor/:/ } fi # print_warning ${prefix}_${sensor/:/_} # print_critical ${prefix}_${sensor/:/_} From 7eea80002eb249f0b0e88322083a5ebafcaaa25b Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 16 Oct 2016 15:59:18 +0200 Subject: [PATCH 15/22] added second optional find, added total yield --- contrib/munin/plugins/ebusd_ | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index fbb6c70a..9e80acbf 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -27,7 +27,8 @@ elif [ "$type" = "press" ]; then skip="KeyPress" elif [ "$type" = "power" ]; then find="Environment" - match="Environment(Energy|Power)\$" + find2="Yield" + match="Environment(Energy|Power)\$|YieldTotal\$" else find="hours" skip="mc.4:|mc.5:" @@ -37,6 +38,14 @@ if [ -z "$result" -o "x${result##ERR:*}" = "x" ]; then echo "error: $result" exit 1 fi +if [ -n "$find2" ]; then + result2=`echo "find $find2"|nc localhost 8888 2>/dev/null` + if [ -z "$result2" -o "x${result2##ERR:*}" = "x" ]; then + echo "error: $result2" + exit 1 + fi + result="$result\n$result2" +fi sensors=`echo "$result"|sed -e 's# =.*$##' -e 's# #:#'|egrep "$match"` if [ -n "$skip" ]; then sensors=`echo "$sensors"|egrep -v "$skip"` From 42c3d558c04e20f9b474ca0c93512475818e0c99 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 16 Oct 2016 16:02:56 +0200 Subject: [PATCH 16/22] use diff for YieldTotal --- contrib/munin/plugins/ebusd_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 9e80acbf..bc649984 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -75,7 +75,7 @@ if [ "$1" = "config" ]; then fi name=${sensor/:/_} name=${name/./_} - if [ "${sensor%%Energy}" = "$sensor" -a ! "$type" = "hours" ]; then + if [ "${sensor%%Total}" = "$sensor" -a ! "$type" = "hours" ]; then echo ${prefix}_${name}.label ${sensor/:/ } else echo ${prefix}_${name}.label ${sensor/:/ } "[diff]" From b1a08ee10a4e0a6cdc78f6ed9e8674b5659d1396 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 23 Oct 2016 13:46:25 +0200 Subject: [PATCH 17/22] added support for english --- contrib/munin/plugins/ebusd_ | 47 ++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index bc649984..94c437e2 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -52,22 +52,49 @@ if [ -n "$skip" ]; then fi sensors=`echo "$sensors"|sort -u` if [ "$1" = "config" ]; then + if [ -r /etc/default/locale ]; then + . /etc/default/locale + fi + lang="${LANG:0:2}" + if [ "$lang" = "de" ]; then + lang_temp='Temperaturen' + lang_degrees='Grad' + lang_press='Drucksensoren' + lang_bar='Bar' + lang_power_yield='Leistung/Ertrag' + lang_kw='kW' + lang_optime='Operating Time' + lang_hours='h' + lang_catheat='Heizung' + lang_diff='Diff.' + else + lang_temp='Temperatures' + lang_degrees='degrees' + lang_press='Pressure Sensors' + lang_bar='bar' + lang_power_yield='Power/Yield' + lang_kw='kW' + lang_optime='Betriebsstunden' + lang_hours='h' + lang_catheat='Heating' + lang_diff='diff.' + fi if [ "$type" = "temp" ]; then - echo "graph_title ebus Temperaturen" - echo "graph_vlabel Grad" + echo "graph_title ebus $lang_temp" + echo "graph_vlabel $lang_degrees" elif [ "$type" = "press" ]; then - echo "graph_title ebus Drucksensoren" - echo "graph_vlabel Bar" + echo "graph_title ebus $lang_press" + echo "graph_vlabel $lang_bar" elif [ "$type" = "power" ]; then - echo "graph_title ebus Leistung/Ertrag" - echo "graph_vlabel kW" + echo "graph_title ebus $lang_power_yield" + echo "graph_vlabel $lang_kw" echo "graph_period hour" else - echo "graph_title ebus Betriebsstunden" - echo "graph_vlabel h" + echo "graph_title ebus $lang_optime" + echo "graph_vlabel $lang_hours" echo "graph_period hour" fi - echo 'graph_category Heizung' + echo "graph_category $lang_catheat" for sensor in $sensors; do result=`echo "read -c ${sensor/:/ }"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'` if [ "x$result" = "x-" -o "x${result##ERR:*}" = "x" ]; then @@ -78,7 +105,7 @@ if [ "$1" = "config" ]; then if [ "${sensor%%Total}" = "$sensor" -a ! "$type" = "hours" ]; then echo ${prefix}_${name}.label ${sensor/:/ } else - echo ${prefix}_${name}.label ${sensor/:/ } "[diff]" + echo ${prefix}_${name}.label ${sensor/:/ } "[$lang_diff]" echo ${prefix}_${name}.type COUNTER echo ${prefix}_${name}.draw AREA fi From b2e490f5a5cc1e5696320b4fbfc9c3043467109f Mon Sep 17 00:00:00 2001 From: tikismoke Date: Tue, 25 Oct 2016 21:56:15 +0200 Subject: [PATCH 18/22] Update ebusd_ --- contrib/munin/plugins/ebusd_ | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index 94c437e2..c842cc99 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -67,6 +67,17 @@ if [ "$1" = "config" ]; then lang_hours='h' lang_catheat='Heizung' lang_diff='Diff.' + if [ "$lang" = "fr" ]; then + lang_temp='Température' + lang_degrees='Degrées' + lang_press='Capteur de pression' + lang_bar='Bar' + lang_power_yield='Puissance/Rendement' + lang_kw='kW' + lang_optime='Durée de fonctionnement' + lang_hours='h' + lang_catheat='Chauffage' + lang_diff='Diff.' else lang_temp='Temperatures' lang_degrees='degrees' From 2e8ef3d7d44db25e277e8ecea4901d0544477f1a Mon Sep 17 00:00:00 2001 From: john30 Date: Wed, 2 Nov 2016 08:57:02 +0100 Subject: [PATCH 19/22] fixed pull request for french language support --- contrib/munin/plugins/ebusd_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/plugins/ebusd_ index c842cc99..a9bbaf8a 100755 --- a/contrib/munin/plugins/ebusd_ +++ b/contrib/munin/plugins/ebusd_ @@ -67,7 +67,7 @@ if [ "$1" = "config" ]; then lang_hours='h' lang_catheat='Heizung' lang_diff='Diff.' - if [ "$lang" = "fr" ]; then + elif [ "$lang" = "fr" ]; then lang_temp='Température' lang_degrees='Degrées' lang_press='Capteur de pression' From 8331b4587af9b40916a690d92d571cc86705fe0d Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 10 Dec 2016 16:56:11 +0100 Subject: [PATCH 20/22] moved --- contrib/munin/README.md | 2 +- contrib/munin/{plugins => }/ebusd_ | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename contrib/munin/{plugins => }/ebusd_ (100%) diff --git a/contrib/munin/README.md b/contrib/munin/README.md index d8bfc65f..4e171026 100644 --- a/contrib/munin/README.md +++ b/contrib/munin/README.md @@ -8,7 +8,7 @@ Personally, I use them for checking mainly temperatures, pressures and earned en - prerequisite is of course a running munin installation on the local host - to install the plugins: - git checkout https://github.com/john30/ebusd-munin.git - - sudo cp ebusd-munin/plugins/* /usr/share/munin/plugins/ + - sudo cp ebusd-munin/ebusd_ /usr/share/munin/plugins/ - sudo munin-node-configure --shell - run all "ln -s" commands printed by munin-node-configure and containing "ebusd_" - sudo service munin-node reload diff --git a/contrib/munin/plugins/ebusd_ b/contrib/munin/ebusd_ similarity index 100% rename from contrib/munin/plugins/ebusd_ rename to contrib/munin/ebusd_ From 27fcad22f08ea93974b1b1dca3a36ed717e7f376 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 10 Dec 2016 17:03:40 +0100 Subject: [PATCH 21/22] updated to new location --- contrib/munin/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/munin/README.md b/contrib/munin/README.md index 4e171026..0942c861 100644 --- a/contrib/munin/README.md +++ b/contrib/munin/README.md @@ -1,5 +1,5 @@ -# ebusd-munin -Collection of munin plugins (see http://munin-monitoring.org/) related to ebusd (see http://github.com/john30/ebusd/). +# Munin plugins +This is a collection of munin plugins (see http://munin-monitoring.org/) related to ebusd. These plugins can easily be used to feed a munin node with data from a local ebusd instance. Personally, I use them for checking mainly temperatures, pressures and earned energy of my heatpump. Looking at the graphs produced by munin I find it rather easy to know what's going on in the heatpump. @@ -7,10 +7,9 @@ Personally, I use them for checking mainly temperatures, pressures and earned en # Installation: - prerequisite is of course a running munin installation on the local host - to install the plugins: - - git checkout https://github.com/john30/ebusd-munin.git - - sudo cp ebusd-munin/ebusd_ /usr/share/munin/plugins/ + - sudo cp ./ebusd_ /usr/share/munin/plugins/ - sudo munin-node-configure --shell - run all "ln -s" commands printed by munin-node-configure and containing "ebusd_" - sudo service munin-node reload -that's it. + From a995d2c9823a2d71ff511a1240b19e97e6b71473 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 10 Dec 2016 17:13:15 +0100 Subject: [PATCH 22/22] updated --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 265364b1..6d171bee 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,16 @@ The main features of the daemon are: * actively send messages to and receive answers from the eBUS * passively listen to messages sent on the eBUS * regularly poll for messages - * cache all data + * cache all messages * scan for bus participants * parse messages to human readable values by using CSV message configuration files * automatically pick CSV message configuration files by scan result - * grab unknown messages + * grab all messages on the eBUS * log messages and problems to a log file - * dump sent/received bytes to a log file + * capture sent/received bytes to a log file as text * dump received bytes to binary files for later playback/analysis * listen for client connections on a dedicated TCP port (command line style and/or HTTP) - + * optionally format messages and data in JSON on dedicated HTTP port Installation ------------