Ich frage hier bei Änderungen die Temperaturen ab und lege die in Flow-Variablen ab, das Display wird immer nur dann (mit den aktuellen Temperaturen) aktualisiert, wenn das kritische Dachfenster geöffnet oder geschlossen wird - das spart Batteriestrom.
Mit dieser Lösung zeige ich am Ausgang an, dass noch ein Fenster offen ist, weil das schon oft vergessen wurde. Das Display sollte damit 5-6 Jahre durchhalten, dann gibt´s schickere Lösungen.
Nachdem nun die größte Hürde genommen ist, mache ich mich an Displays mit Raumbelegung/Kalender, anstehende ical-Termine (Mülltermine - Tonnen rausstellen), Auslastungs-/Umsatzzahlen, Diensteinteilungen…Möglichkeiten ohne Ende - und keine Stromversorgung nötig freu
! ````
[
{
"id": "b859cbc9.b0f1e8",
"type": "function",
"z": "6355756.629658c",
"name": "27_4 xml bauen",
"func": "var tempkueche = flow.get("tempkueche");\nvar temptoilet = flow.get("temptoilet");\nvar tempchef = flow.get("tempchef");\nvar templager = flow.get("templager");\nvar fenster = flow.get("fenster");\n\nvar newMsg = {payload: "<taskorder title="Refresh B302D29E"><templatetask labelid="B302D29E" externalid="40" template="2h_foyer.xsl"></templatetask></taskorder>"};\nreturn newMsg;",
"outputs": 1,
"noerr": 0,
"x": 460,
"y": 860,
"wires": [
[
"5d131aad.853774",
"ddbeea82.b7adf8"
]
]
},
{
"id": "481d1366.247e4c",
"type": "exec",
"z": "6355756.629658c",
"command": "curl -X POST -d @/volume1/iobroker/iobroker-data/files/vis.0/daten/27_4.xml "http://192.168.100.5:8001/service/task" --header "Content-Type:application/xml"",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "2",
"name": "Output",
"x": 790,
"y": 900,
"wires": [
[],
[],
[]
]
},
{
"id": "5d131aad.853774",
"type": "file",
"z": "6355756.629658c",
"name": "27_4 xml write",
"filename": "/volume1/iobroker/iobroker-data/files/vis.0/daten/27_4.xml",
"appendNewline": false,
"createDir": false,
"overwriteFile": "true",
"x": 660,
"y": 860,
"wires": []
},
{
"id": "ddbeea82.b7adf8",
"type": "delay",
"z": "6355756.629658c",
"name": "2sec-del",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 660,
"y": 900,
"wires": [
[
"481d1366.247e4c"
]
]
},
{
"id": "8d4efc4b.600eb",
"type": "ioBroker in",
"z": "6355756.629658c",
"name": "temptoilet",
"topic": "hm-rpc.0.KEQ0578061.4.ACTUAL_TEMPERATURE",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 120,
"y": 860,
"wires": [
[
"f043e1c1.cc97c"
]
]
},
{
"id": "744b6ade.5d1e54",
"type": "ioBroker in",
"z": "6355756.629658c",
"name": "fenster",
"topic": "hm-rpc.0.LEQ1470154.1.STATE",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 450,
"y": 980,
"wires": [
[
"2acef966.8e4b96"
]
]
},
{
"id": "f043e1c1.cc97c",
"type": "function",
"z": "6355756.629658c",
"name": "temptoilet",
"func": "var glob = (msg.payload);\nflow.set("temptoilet",glob);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 260,
"y": 860,
"wires": [
[]
]
},
{
"id": "d549b0c0.662e2",
"type": "function",
"z": "6355756.629658c",
"name": "fenster",
"func": "var glob = (msg.payload);\nflow.set("fenster",glob);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 450,
"y": 900,
"wires": [
[
"b859cbc9.b0f1e8"
]
]
},
{
"id": "2acef966.8e4b96",
"type": "change",
"z": "6355756.629658c",
"name": "change",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "true",
"fromt": "bool",
"to": "FENSTER OFFEN",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "false",
"fromt": "bool",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 460,
"y": 940,
"wires": [
[
"d549b0c0.662e2"
]
]
},
{
"id": "e9e11b8d.1bca98",
"type": "ioBroker in",
"z": "6355756.629658c",
"name": "tempkueche",
"topic": "hm-rpc.0.JEQ0211467.1.TEMPERATURE",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 130,
"y": 920,
"wires": [
[
"df4c5cdb.c9af2"
]
]
},
{
"id": "df4c5cdb.c9af2",
"type": "function",
"z": "6355756.629658c",
"name": "tempkueche",
"func": "var glob = (msg.payload);\nflow.set("tempkueche",glob);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 290,
"y": 920,
"wires": [
[]
]
},
{
"id": "5ffa7c8c.d79f14",
"type": "ioBroker in",
"z": "6355756.629658c",
"name": "tempchef",
"topic": "hm-rpc.2.000313C99069FE.1.ACTUAL_TEMPERATURE",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 120,
"y": 980,
"wires": [
[
"e2fb6395.08434"
]
]
},
{
"id": "e2fb6395.08434",
"type": "function",
"z": "6355756.629658c",
"name": "tempchef",
"func": "var glob = (msg.payload);\nflow.set("tempchef",glob);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 260,
"y": 980,
"wires": [
[]
]
},
{
"id": "7712d5cf.1f7dcc",
"type": "ioBroker in",
"z": "6355756.629658c",
"name": "templager",
"topic": "hm-rpc.0.JEQ0012416.1.TEMPERATURE",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 120,
"y": 1040,
"wires": [
[
"11958bef.65c544"
]
]
},
{
"id": "11958bef.65c544",
"type": "function",
"z": "6355756.629658c",
"name": "templager",
"func": "var glob = (msg.payload);\nflow.set("templager",glob);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 280,
"y": 1040,
"wires": [
[]
]
}
]
Hier noch das zugehörige XSL-Template (aus der Dokumentation abgewandeltes .xls):
>! ````
>! <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:template match="Record"><xsl:variable name="bgcolor"><xsl:choose><xsl:when test="room/field[@key='invert']/@value = '1'">black</xsl:when>
<xsl:otherwise>white</xsl:otherwise></xsl:choose></xsl:variable>
>! <xsl:variable name="fgcolor"><xsl:choose><xsl:when test="room/field[@key='invert']/@value = '1'">white</xsl:when>
<xsl:otherwise>black</xsl:otherwise></xsl:choose></xsl:variable>
>!
>!
<field height="80" width="176" x="0" y="0"><xsl:attribute name="background-color"><xsl:value-of select="$bgcolor"></xsl:value-of></xsl:attribute>
<text align="center" font-size="34" font-weight="bold"><xsl:attribute name="color"><xsl:value-of select="$fgcolor"></xsl:value-of></xsl:attribute>
<xsl:value-of select="room/field[@key='Zeile1']/@value"></xsl:value-of></text></field>
>!
<field height="22" width="176" x="0" y="81"><xsl:attribute name="background-color"><xsl:value-of select="$bgcolor"></xsl:value-of></xsl:attribute>
<text align="left" font-size="18" font-weight="bold"><xsl:attribute name="color"><xsl:value-of select="$fgcolor"></xsl:value-of></xsl:attribute>
<xsl:value-of select="room/field[@key='Zeile2']/@value"></xsl:value-of></text></field>
>!
<field height="22" width="176" x="0" y="104"><xsl:attribute name="background-color"><xsl:value-of select="$bgcolor"></xsl:value-of></xsl:attribute>
<text align="left" font-size="18" font-weight="bold"><xsl:attribute name="color"><xsl:value-of select="$fgcolor"></xsl:value-of></xsl:attribute>
<xsl:value-of select="room/field[@key='Zeile3']/@value"></xsl:value-of></text></field>
>!
<field height="22" width="176" x="0" y="127"><xsl:attribute name="background-color"><xsl:value-of select="$bgcolor"></xsl:value-of></xsl:attribute>
<text align="left" font-size="18" font-weight="bold"><xsl:attribute name="color"><xsl:value-of select="$fgcolor"></xsl:value-of></xsl:attribute>
<xsl:value-of select="room/field[@key='Zeile4']/@value"></xsl:value-of></text></field>
>!
<field height="22" width="176" x="0" y="150"><xsl:attribute name="background-color"><xsl:value-of select="$bgcolor"></xsl:value-of></xsl:attribute>
<text align="left" font-size="18" font-weight="bold"><xsl:attribute name="color"><xsl:value-of select="$fgcolor"></xsl:value-of></xsl:attribute>
<xsl:value-of select="room/field[@key='Zeile5']/@value"></xsl:value-of></text></field>
<field align="left" height="35" width="100" x="40" y="220"></field></xsl:template></xsl:stylesheet>