add docs about nwpm codes
[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 =head1 DEPENDENCIES
19
20  curl
21
22 =head1 AUTHOR
23
24  Christian Weiske <cweiske@cweiske.de>
25
26 =head1 LICENSE
27
28  AGPL
29  http://www.gnu.org/licenses/agpl.html
30
31 =head1 MAGIC MARKERS
32
33  #%# family=manual
34
35 =cut
36
37 . ${MUNIN_LIBDIR:=/usr/share/munin}/plugins/plugin.sh
38
39 host=`echo ${0##*/}|sed 's/^.*_//g'`
40
41
42 if [ "$1" = "config" ]; then
43     #Outdoor temperature
44     echo 'multigraph heatpump_dimplex_wpm_outtemp'
45     echo 'graph_title Außentemperatur'
46     echo 'graph_args --base 1000'
47     echo 'graph_vlabel °C'
48     echo 'graph_info Zeigt die gemessene Außentemperatur an'
49     echo 'graph_scale no'
50     echo 'graph_category sensors'
51
52     echo 'outtemp.label Außentemperatur'
53
54     #Heating temperatures
55     echo 'multigraph heatpump_dimplex_wpm_heating'
56     echo 'graph_title Heizungstemperaturen'
57     echo 'graph_args --base 1000'
58     echo 'graph_vlabel °C'
59     echo 'graph_info Zeigt Heizungstemperatur-Betriebsdaten an'
60     echo 'graph_scale no'
61     echo 'graph_category sensors'
62
63     echo 'returntargettemp.label Rücklaufsolltemperatur'
64     echo 'returntemp.label Rücklauftemperatur'
65     echo 'influxtemp.label Vorlauftemperatur'
66
67     #Water temperature
68     echo 'multigraph heatpump_dimplex_wpm_water'
69     echo 'graph_title Warmwasser'
70     echo 'graph_args --base 1000'
71     echo 'graph_vlabel °C'
72     echo 'graph_info Zeigt Warmwasser-Betriebsdaten an'
73     echo 'graph_scale no'
74     echo 'graph_category sensors'
75
76     echo 'watertargettemp.label Solltemperatur'
77     echo 'watertemp.label Warmwassertemperatur'
78
79
80     #On/off states
81     echo 'multigraph heatpump_dimplex_wpm_states'
82     echo 'graph_title Stati'
83     echo 'graph_args --base 1000'
84     echo 'graph_vlabel An/Aus'
85     echo 'graph_info Zeigt binäre Daten an'
86     echo 'graph_scale no'
87     echo 'graph_category sensors'
88
89     echo 'reqheating.label Anforderung Heizung'
90     echo 'reqwater.label Anforderung Warmwasser'
91
92     exit 0
93 fi
94
95 data=`curl -s "http://$host/usr-cgi/xml.cgi?A|1|125|D|1|150|I|1|100" | xsltproc paths.xsl -`
96
97 #Outdoor temperature
98 echo 'multigraph heatpump_dimplex_wpm_outtemp'
99 echo outtemp.value `echo "$data" | grep ANALOG/27 | cut -d" " -f2`
100
101 #Heating temperatures
102 echo 'multigraph heatpump_dimplex_wpm_heating'
103 echo returntargettemp.value `echo "$data" | grep ANALOG/28 | cut -d" " -f2`
104 echo returntemp.value `echo "$data" | grep ANALOG/29 | cut -d" " -f2`
105 echo influxtemp.value `echo "$data" | grep ANALOG/31 | cut -d" " -f2`
106
107 #Water temperatures
108 echo 'multigraph heatpump_dimplex_wpm_water'
109 echo watertargettemp.value `echo "$data" | grep ANALOG/40 | cut -d" " -f2`
110 echo watertemp.value `echo "$data" | grep ANALOG/30 | cut -d" " -f2`
111
112 #On/off states
113 echo 'multigraph heatpump_dimplex_wpm_states'
114 echo reqheating.value `echo "$data" | grep DIGITAL/136 | cut -d" " -f2`
115 water=`echo "$data" | grep DIGITAL/140 | cut -d" " -f2`
116 echo reqwater.value `echo $(($water * 2))`