add host_name configuration
[munin-heatpump.git] / heatpump-dimplex-wpm_
1 #!/bin/sh
2 # -*- sh -*-
3
4 : << =cut
5
6 =head1 NAME
7
8  heatpump-dimplex-wpm - Munin plugin to display Diplex heatpump data
9
10  Tested with Dimplex NWPM, BIOS 4.1, BOOT 4.03, SOFTWARE: WPM_H_H54
11
12 =head1 CONFIGURATION
13
14  You need to configure the hostname in the plugin name.
15
16  Symlink heatpump-dimplex-wpm_ as "heatpump-dimplex-wpm_192.168.20.71".
17
18 =head2 EXAMPLE CONFIGURATION
19
20  [heatpump-dimplex-wpm_*]
21   env.host_name Heating
22
23 =head1 DEPENDENCIES
24
25  curl
26
27 =head1 AUTHOR
28
29  Christian Weiske <cweiske@cweiske.de>
30
31 =head1 LICENSE
32
33  AGPL
34  http://www.gnu.org/licenses/agpl.html
35
36 =head1 MAGIC MARKERS
37
38  #%# family=manual
39
40 =cut
41
42 . ${MUNIN_LIBDIR:=/usr/share/munin}/plugins/plugin.sh
43
44 host=`echo ${0##*/}|sed 's/^.*_//g'`
45
46
47 if [ "$1" = "config" ]; then
48     if [ "$host_name" != "" ]; then
49         echo "host_name $host_name"
50     fi
51
52     #Outdoor temperature
53     echo 'multigraph heatpump_dimplex_wpm_outtemp'
54     echo 'graph_title Außentemperatur'
55     echo 'graph_args --base 1000'
56     echo 'graph_vlabel °C'
57     echo 'graph_info Zeigt die gemessene Außentemperatur an'
58     echo 'graph_scale no'
59     echo 'graph_category sensors'
60
61     echo 'outtemp.label Außentemperatur'
62
63     #Heating temperatures
64     echo 'multigraph heatpump_dimplex_wpm_heating'
65     echo 'graph_title Heizungstemperaturen'
66     echo 'graph_args --base 1000'
67     echo 'graph_vlabel °C'
68     echo 'graph_info Zeigt Heizungstemperatur-Betriebsdaten an'
69     echo 'graph_scale no'
70     echo 'graph_category sensors'
71
72     echo 'returntargettemp.label Rücklaufsolltemperatur'
73     echo 'returntemp.label Rücklauftemperatur'
74     echo 'influxtemp.label Vorlauftemperatur'
75
76     #Water temperature
77     echo 'multigraph heatpump_dimplex_wpm_water'
78     echo 'graph_title Warmwasser'
79     echo 'graph_args --base 1000'
80     echo 'graph_vlabel °C'
81     echo 'graph_info Zeigt Warmwasser-Betriebsdaten an'
82     echo 'graph_scale no'
83     echo 'graph_category sensors'
84
85     echo 'watertargettemp.label Solltemperatur'
86     echo 'watertemp.label Warmwassertemperatur'
87
88
89     #On/off states
90     echo 'multigraph heatpump_dimplex_wpm_states'
91     echo 'graph_title Stati'
92     echo 'graph_args --base 1000'
93     echo 'graph_vlabel An/Aus'
94     echo 'graph_info Zeigt binäre Daten an'
95     echo 'graph_scale no'
96     echo 'graph_category sensors'
97
98     echo 'reqheating.label Anforderung Heizung'
99     echo 'reqwater.label Anforderung Warmwasser'
100
101     exit 0
102 fi
103
104 data=`curl -s "http://$host/usr-cgi/xml.cgi?A|1|125|D|1|150|I|1|100" | xsltproc paths.xsl -`
105
106 #Outdoor temperature
107 echo 'multigraph heatpump_dimplex_wpm_outtemp'
108 echo outtemp.value `echo "$data" | grep ANALOG/27 | cut -d" " -f2`
109
110 #Heating temperatures
111 echo 'multigraph heatpump_dimplex_wpm_heating'
112 echo returntargettemp.value `echo "$data" | grep ANALOG/28 | cut -d" " -f2`
113 echo returntemp.value `echo "$data" | grep ANALOG/29 | cut -d" " -f2`
114 echo influxtemp.value `echo "$data" | grep ANALOG/31 | cut -d" " -f2`
115
116 #Water temperatures
117 echo 'multigraph heatpump_dimplex_wpm_water'
118 echo watertargettemp.value `echo "$data" | grep ANALOG/40 | cut -d" " -f2`
119 echo watertemp.value `echo "$data" | grep ANALOG/30 | cut -d" " -f2`
120
121 #On/off states
122 echo 'multigraph heatpump_dimplex_wpm_states'
123 echo reqheating.value `echo "$data" | grep DIGITAL/136 | cut -d" " -f2`
124 water=`echo "$data" | grep DIGITAL/140 | cut -d" " -f2`
125 echo reqwater.value `echo $(($water * 2))`