aboutsummaryrefslogtreecommitdiff
path: root/pellematic-temp
diff options
context:
space:
mode:
Diffstat (limited to 'pellematic-temp')
-rwxr-xr-xpellematic-temp22
1 files changed, 17 insertions, 5 deletions
diff --git a/pellematic-temp b/pellematic-temp
index 8fe25c5..205fa2b 100755
--- a/pellematic-temp
+++ b/pellematic-temp
@@ -34,10 +34,10 @@ items = [# Outside temperature sensor (X2)
#"CAPPL:FA[0].L_feuerraumtemperatur",
#"CAPPL:FA[0].L_feuerraumtemperatur_soll",
# 1. Buffer
- # TPO (X7)
+ # TPM (X8)
"CAPPL:LOCAL.L_pu[0].ausschaltfuehler_ist",
"CAPPL:LOCAL.L_pu[0].ausschaltfuehler_soll",
- # TPM (X8)
+ # TPO (X7)
"CAPPL:LOCAL.L_pu[0].einschaltfuehler_ist",
"CAPPL:LOCAL.L_pu[0].einschaltfuehler_soll",
# 1. Heating circuit
@@ -45,6 +45,17 @@ items = [# Outside temperature sensor (X2)
"CAPPL:LOCAL.L_hk[0].vorlauftemp_ist",
]
+def fixup(name):
+ # TPM and TPO are swapped in the returned JSON
+ # (compare to /js/config.min.js) so we need
+ # to fix it up:
+ if name.startswith('TPM'):
+ return 'TPO' + name[3:]
+ elif name.startswith('TPO'):
+ return 'TPM' + name[3:]
+ else:
+ return name
+
def canon(name):
return re.sub(r"[^a-zA-Z0-9_]", "_", name)
@@ -57,10 +68,10 @@ graph_info This graph shows different temperture values as displayed by a Pellet
out = fetch_raw(url)
for item in out:
if item['name'] in items:
- name = item['shortText']
+ name = fixup(item['shortText'])
print "%s.label %s" % (canon(name), name)
print "%s.type GAUGE" % canon(name)
- thickness = 1 if item['name'].endswith('soll') else 2
+ thickness = 1 if name.endswith('soll') else 2
print "%s.draw LINE%d" % (canon(name), thickness)
def degree_celsius(val):
@@ -112,7 +123,8 @@ def fetch_values(url):
out = fetch_raw(url)
for item in out:
if item['name'] in items:
- print "%s.value %.2f" % (canon(item['shortText']),
+ name = canon(fixup(item['shortText']))
+ print "%s.value %.2f" % (name,
degree_celsius(item))