Merge branch 'master' of https://github.com/john30/ebusd
This commit is contained in:
@@ -18,16 +18,16 @@ The main features of the daemon are:
|
|||||||
* actively send messages to and receive answers from the eBUS
|
* actively send messages to and receive answers from the eBUS
|
||||||
* passively listen to messages sent on the eBUS
|
* passively listen to messages sent on the eBUS
|
||||||
* regularly poll for messages
|
* regularly poll for messages
|
||||||
* cache all data
|
* cache all messages
|
||||||
* scan for bus participants
|
* scan for bus participants
|
||||||
* parse messages to human readable values by using CSV message configuration files
|
* parse messages to human readable values by using CSV message configuration files
|
||||||
* automatically pick CSV message configuration files by scan result
|
* 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
|
* 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
|
* 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)
|
* 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
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|||||||
@@ -37,4 +37,4 @@ package() {
|
|||||||
install -m 0644 contrib/archlinux/conf.d/ebusd "${pkgdir}/etc/conf.d/ebusd"
|
install -m 0644 contrib/archlinux/conf.d/ebusd "${pkgdir}/etc/conf.d/ebusd"
|
||||||
}
|
}
|
||||||
# update md5sums: updpkgsums
|
# update md5sums: updpkgsums
|
||||||
md5sums=('94997edc61f02fc939743ff04c4e505a')
|
md5sums=('eaa61b16da89a23049e73dfddfc0f78d')
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# Installation:
|
||||||
|
- prerequisite is of course a running munin installation on the local host
|
||||||
|
- to install the 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
|
||||||
|
|
||||||
|
|
||||||
Executable
+135
@@ -0,0 +1,135 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Munn plugin for ebusd.
|
||||||
|
#%# 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"
|
||||||
|
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|mc.5:|rcc.*:Flow|^ui"
|
||||||
|
elif [ "$type" = "press" ]; then
|
||||||
|
match="Press(High|Low)?\$"
|
||||||
|
skip="KeyPress"
|
||||||
|
elif [ "$type" = "power" ]; then
|
||||||
|
find="Environment"
|
||||||
|
find2="Yield"
|
||||||
|
match="Environment(Energy|Power)\$|YieldTotal\$"
|
||||||
|
else
|
||||||
|
find="hours"
|
||||||
|
skip="mc.4:|mc.5:"
|
||||||
|
fi
|
||||||
|
result=`echo "find $find"|nc localhost 8888 2>/dev/null`
|
||||||
|
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"`
|
||||||
|
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.'
|
||||||
|
elif [ "$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'
|
||||||
|
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 $lang_temp"
|
||||||
|
echo "graph_vlabel $lang_degrees"
|
||||||
|
elif [ "$type" = "press" ]; then
|
||||||
|
echo "graph_title ebus $lang_press"
|
||||||
|
echo "graph_vlabel $lang_bar"
|
||||||
|
elif [ "$type" = "power" ]; then
|
||||||
|
echo "graph_title ebus $lang_power_yield"
|
||||||
|
echo "graph_vlabel $lang_kw"
|
||||||
|
echo "graph_period hour"
|
||||||
|
else
|
||||||
|
echo "graph_title ebus $lang_optime"
|
||||||
|
echo "graph_vlabel $lang_hours"
|
||||||
|
echo "graph_period hour"
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
name=${sensor/:/_}
|
||||||
|
name=${name/./_}
|
||||||
|
if [ "${sensor%%Total}" = "$sensor" -a ! "$type" = "hours" ]; then
|
||||||
|
echo ${prefix}_${name}.label ${sensor/:/ }
|
||||||
|
else
|
||||||
|
echo ${prefix}_${name}.label ${sensor/:/ } "[$lang_diff]"
|
||||||
|
echo ${prefix}_${name}.type COUNTER
|
||||||
|
echo ${prefix}_${name}.draw AREA
|
||||||
|
fi
|
||||||
|
# print_warning ${prefix}_${sensor/:/_}
|
||||||
|
# print_critical ${prefix}_${sensor/:/_}
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
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
|
||||||
|
name=${sensor/:/_}
|
||||||
|
name=${name/./_}
|
||||||
|
echo ${prefix}_${name}.value $result
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -24,7 +24,7 @@ using namespace std;
|
|||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
Device* device = Device::create("/dev/ttyUSB20", true, false, NULL);
|
Device* device = Device::create("/dev/ttyUSB20", true, false, false);
|
||||||
if (device == NULL) {
|
if (device == NULL) {
|
||||||
cout << "unable to create device" << endl;
|
cout << "unable to create device" << endl;
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user