HowTo: NodeRed – FritzBox Heizkörperthermostat aus NodeRed steuern

Vor kurzem habe ich aus Neugierde einen der DECT Heizkörperthermostate für die FritzBox bestellt.

Wie bei den Fritz-Produkten gewohnt war die Installation und Inbetriebnahme super einfach. Für Anbau und Einrichtung benötigt man nicht mal zehn Minuten.

In der App und der Oberfläche der FritzBox lassen sich dann auch allerhand Optionen einstellen. Unter anderem feste Zeiten zu denen der Heizkörper eingeschaltet werden soll. Für mich ist diese Option aber leider nicht so praktisch. Womit ich in der Vergangenheit aber immer sehr gut gefahren bin, ist die Heizung einzuschalten, wenn es draußen kalt ist (zum Beispiel kühler als 15°C) und der Fernseher im Wohnzimmer eingeschaltet ist (als eine Art Anwesenheitserkennung).

Dieses „dynamische“ Schaltverhalten wollte ich gerne wieder haben. In der Vergangenheit habe ich das mit ein paar nodes in NodeRed erledigt. Gott sei dank gibt es auch für die Steuerung der Fritz Heizungstermostate eine passende Node. Diese muss man dann nur noch entsprechend konfigurieren.

Einen Beispielflow zur Ansteuerung eines Fritz DECT Heizkörperthermostats findet Ihr in diesem Artikel.


Sicherheitshinweise

Ich weiß die folgenden Hinweise sind immer irgendwie lästig und wirken unnötig. Aber leider haben schon viele Menschen die es "besser" wussten aus Leichtsinnigkeit Augen, Finger oder anderes verloren bzw. sich verletzt. Im Vergleich dazu ist ein Datenverlust fast nicht der Rede Wert, aber auch diese können echt ärgerlich sein. Deswegen nehmt Euch bitte fünf Minuten Zeit um die Sicherheitshinweise zu lesen. Denn auch das coolste Projekt ist keine Verletzung oder anderen Ärger wert.
https://www.nerdiy.de/sicherheitshinweise/


Voraussetzungen

Hilfreiche Artikel:
Damit Ihr neue Nodes installieren könnt sollte NodeRed natürlich schon installiert sein.
Wie ihr einen RaspberryPi dazu vorbereitet und dann NodeRed darauf installiert ist in den folgenden Artikeln beschrieben.

Die folgenden drei Artikel beschreiben was zu tun ist um den RaspberryPi soweit vorzubereiten:
RaspberryPi – Einrichten für Nerdiys!
RaspberryPi – Die Erste Konfiguration!
RaspberryPi – Den RaspberryPi über SSH steuern

NodeRed – Installation von NodeRed auf dem RaspberryPi
NodeRed – Node-Code importieren und exportieren

Benötigtes Werkzeug:
-keins-

Benötigtes Material:

In der folgenden Liste findet Ihr alle Teile die Ihr zur Umsetzung dieses Artikels benötigt.


In die NodeRed Konfigurationsoberfläche einloggen

Bevor Ihr eure NodeRed Konfiguration bearbeiten könnt müsst Ihr Euch - falls aktiviert - zunächst in die NodeRed Konfigurationsoberfläche einloggen.

Ansicht des Loginbildschirms. Hier müsst Ihr die Logindaten eingeben die Ihr während der Konfiguration des Logins angegeben habt. Infos dazu findet Ihr im Artikel NodeRed - Benutzerlogin einrichten.

Passende FritzBox-Node installieren

Damit NodeRed mit den verbundenen Heizkörperthermostaten kommunizieren kann müsst Ihr die Node „node-red-contrib-fritzapi“ installieren. Wie Ihr Nodes installiert ist im Artikel NodeRed – Neue Nodes installieren beschrieben.


NodeCode zur Ansteuerung eines Fritz DECT Heizkörperthermostat

Der aktuelle Stand des NodeCodes ist mein erster Entwurf einer Ansteuerung. Sicherlich werde ich daran noch weiter arbeiten. Deswegen fragt gerne nach Updates, wenn dieser Beitrag schon seit längerer zeit nicht aktualisiert wurde.

In der aktuellen Version könnt Ihr die am Heizkörper gemessene und die Soll- bzw. Zieltemperatur anzeigen lassen. Außerdem lässt sich natürlich die gewünschte Temperatur einstellen.

Zu guter Letzt wird auch der Ladezustand der Batterien im Heizkörperthermostat angezeigt. Ich vermute, dass dieser in Prozent angezeigt wird. Da der Ladezustand aber aktuell auf 100 steht und sehr langsam sinkt muss ich noch beobachten wie sich dieser Wert beim absinken entwickelt.

Was ich bereits eingebaut aber noch nicht auslösen konnte ist die Boost-Funktion. Am Thermostat selbst lässt sich diese Funktion auslösen indem man zwei Sekunden lang die Menü-Taste drückt. Dadurch wird der Heizkörper für eine kurze Zeitdauer voll aufgeheizt. Praktisch wäre es natürlich, wenn man diese auch aus NodeRed auslösen könnte um einen Raum schnell automatisch aufzuheizen.

Im folgenden nun ein paar Ansichten der Konfiguration und der eigentliche NodeCode.

Ansicht des Flows in der NodeRed Konfigurationsansicht.

Ansicht der Bedienelemente in der Dashboard-Ansicht.

Wie ihr den unten stehenden NodeCode importieren könnt ist im Artikel NodeRed – Node-Code importieren und exportieren beschrieben.

[{"id":"a7962ae6.cd51d8","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":970,"y":4440,"wires":[]},{"id":"358305f.dcbedfa","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1190,"y":4580,"wires":[]},{"id":"e2c05c.824aafa8","type":"delay","z":"53e12de.0458dd4","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"10","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":1510,"y":4500,"wires":[["ce33b77e.42e888"]]},{"id":"483939cf.9e9258","type":"ui_toast","z":"53e12de.0458dd4","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"KlugesHaus","x":1190,"y":4320,"wires":[]},{"id":"3a992371.47ad1c","type":"ui_button","z":"53e12de.0458dd4","name":"Livingroom boost","group":"ec48ea8.9196518","order":23,"width":0,"height":0,"passthru":false,"label":"Livingroom boost","tooltip":"","color":"","bgcolor":"","icon":"","payload":"boost","payloadType":"str","topic":"","x":1210,"y":4540,"wires":[["e2c05c.824aafa8"]]},{"id":"db46f953.f26e68","type":"ui_text","z":"53e12de.0458dd4","group":"ec48ea8.9196518","order":29,"width":0,"height":0,"name":"","label":"Bat livingroom:","format":"{{msg.payload}}","layout":"row-spread","x":980,"y":4260,"wires":[]},{"id":"8b75b2d5.c8baa","type":"ui_text","z":"53e12de.0458dd4","group":"ec48ea8.9196518","order":25,"width":0,"height":0,"name":"Is temp livingroom","label":"Is temp livingroom:","format":"{{msg.payload}}°C","layout":"row-spread","x":990,"y":4400,"wires":[]},{"id":"533ab806.c07cb8","type":"ui_dropdown","z":"53e12de.0458dd4","name":"","label":"Livingroom target temp","tooltip":"","place":"Temperatur","group":"ec48ea8.9196518","order":28,"width":0,"height":0,"passthru":false,"multiple":true,"options":[{"label":"","value":13,"type":"num"},{"label":"","value":14,"type":"num"},{"label":"","value":15,"type":"num"},{"label":"","value":16,"type":"num"},{"label":"","value":17,"type":"num"},{"label":"","value":18,"type":"num"},{"label":"","value":19,"type":"num"},{"label":"","value":20,"type":"num"},{"label":"","value":21,"type":"num"},{"label":"","value":22,"type":"num"},{"label":"","value":23,"type":"num"},{"label":"","value":24,"type":"num"},{"label":"","value":25,"type":"num"}],"payload":"","topic":"","x":1220,"y":4500,"wires":[["e2c05c.824aafa8"]]},{"id":"e5048a7a.b2d4a8","type":"ui_gauge","z":"53e12de.0458dd4","name":"Livingroom Temperature","group":"ec48ea8.9196518","order":21,"width":0,"height":0,"gtype":"gage","title":"Livingroom ","label":"°C","format":"{{value}}","min":"10","max":"25","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1230,"y":4400,"wires":[]},{"id":"72765989.1deb48","type":"pushbullet","z":"53e12de.0458dd4","config":"139243fe.5b95ac","pushtype":"note","title":"KlugesHaus","chan":"","name":"","x":1190,"y":4360,"wires":[]},{"id":"fab61adb.8e4ef8","type":"trigger","z":"53e12de.0458dd4","op1":"Heizung WZ Batterie leer","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"0","bytopic":"all","name":"","x":990,"y":4340,"wires":[["72765989.1deb48","483939cf.9e9258"]]},{"id":"e7e1539f.66fea","type":"comment","z":"53e12de.0458dd4","name":"Get device info / Geräteinfo anfordern","info":"","x":230,"y":4160,"wires":[]},{"id":"7b162249.11acbc","type":"fritz-thermostat","z":"53e12de.0458dd4","connection":"c2e6322e.33404","name":"","action":"getDevice","x":450,"y":4220,"wires":[["56356228.cf8fec","2c507a36.fbb3c6","45d087bf.aab698","cdfaff2e.e8955","8c417156.f97f","4839f59f.2d4bac","56a0e5c3.3ae8cc","6147fb8d.a3eda4","7e243a3.2ef85c4"]]},{"id":"56356228.cf8fec","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":610,"y":4180,"wires":[]},{"id":"988fe74d.d62688","type":"inject","z":"53e12de.0458dd4","name":"inject heater_id","topic":"099950439688","payload":"","payloadType":"str","repeat":"5","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":4220,"wires":[["7b162249.11acbc"]]},{"id":"ce33b77e.42e888","type":"change","z":"53e12de.0458dd4","name":"inject heater_id","rules":[{"t":"set","p":"ain","pt":"msg","to":"099950439688","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1500,"y":4560,"wires":[["88de62a8.94557","36116ab4.f72696"]]},{"id":"88de62a8.94557","type":"fritz-thermostat","z":"53e12de.0458dd4","connection":"c2e6322e.33404","name":"","action":"setTempTarget","x":1470,"y":4640,"wires":[["94392c0d.00301"]]},{"id":"2c507a36.fbb3c6","type":"change","z":"53e12de.0458dd4","name":"battery","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.battery","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":4260,"wires":[["4447bfbb.2f313","db46f953.f26e68"]]},{"id":"4447bfbb.2f313","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":790,"y":4260,"wires":[]},{"id":"45d087bf.aab698","type":"change","z":"53e12de.0458dd4","name":"name","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":4300,"wires":[["8ac5de97.e5d21"]]},{"id":"8ac5de97.e5d21","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":790,"y":4300,"wires":[]},{"id":"cdfaff2e.e8955","type":"change","z":"53e12de.0458dd4","name":"batterylow","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.batterylow","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4340,"wires":[["df36ec43.f77e","fab61adb.8e4ef8"]]},{"id":"df36ec43.f77e","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":790,"y":4340,"wires":[]},{"id":"8c417156.f97f","type":"change","z":"53e12de.0458dd4","name":"present","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.present","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":4380,"wires":[["dd12c973.b2b518"]]},{"id":"dd12c973.b2b518","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":790,"y":4380,"wires":[]},{"id":"4839f59f.2d4bac","type":"change","z":"53e12de.0458dd4","name":"is_temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature.celsius","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":4540,"wires":[["64cf4cb.66c1eb4"]]},{"id":"5290e091.d6486","type":"function","z":"53e12de.0458dd4","name":"convert_t_to_celsius","func":"msg.payload=msg.payload0.5;\nreturn msg;","outputs":1,"noerr":0,"x":920,"y":4580,"wires":[["533ab806.c07cb8","358305f.dcbedfa","e5048a7a.b2d4a8"]]},{"id":"56a0e5c3.3ae8cc","type":"change","z":"53e12de.0458dd4","name":"target_temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hkr.tsoll","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":4580,"wires":[["5290e091.d6486"]]},{"id":"addcb097.29cee","type":"function","z":"53e12de.0458dd4","name":"convert_t_to_celsius","func":"msg.payload=msg.payload0.5;\nreturn msg;","outputs":1,"noerr":0,"x":920,"y":4620,"wires":[["dad67a3a.2241d8"]]},{"id":"6147fb8d.a3eda4","type":"change","z":"53e12de.0458dd4","name":"power_down_temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hkr.absenk","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":4620,"wires":[["addcb097.29cee"]]},{"id":"dad67a3a.2241d8","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1190,"y":4620,"wires":[]},{"id":"e9015a7c.bdb0d8","type":"function","z":"53e12de.0458dd4","name":"convert_t_to_celsius","func":"msg.payload=msg.payload*0.5;\nreturn msg;","outputs":1,"noerr":0,"x":920,"y":4660,"wires":[["7e2bb922.138358"]]},{"id":"7e243a3.2ef85c4","type":"change","z":"53e12de.0458dd4","name":"comfort_temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hkr.komfort","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":4660,"wires":[["e9015a7c.bdb0d8"]]},{"id":"7e2bb922.138358","type":"debug","z":"53e12de.0458dd4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1190,"y":4660,"wires":[]},{"id":"94392c0d.00301","type":"debug","z":"53e12de.0458dd4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1630,"y":4640,"wires":[]},{"id":"36116ab4.f72696","type":"delay","z":"53e12de.0458dd4","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":400,"y":4320,"wires":[["7b162249.11acbc"]]},{"id":"36ee37a8.465248","type":"link in","z":"53e12de.0458dd4","name":"set heater_temp","links":["de5934df.32da48"],"x":1355,"y":4560,"wires":[["ce33b77e.42e888"]]},{"id":"ec242dc3.9023f","type":"inject","z":"53e12de.0458dd4","name":"boost","topic":"","payload":"boost","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1190,"y":4460,"wires":[["e2c05c.824aafa8"]]},{"id":"64cf4cb.66c1eb4","type":"function","z":"53e12de.0458dd4","name":"convert_t_to_celsius","func":"msg.payload=msg.payload/10;\nreturn msg;","outputs":1,"noerr":0,"x":920,"y":4540,"wires":[["a7962ae6.cd51d8","8b75b2d5.c8baa"]]},{"id":"ec48ea8.9196518","type":"ui_group","z":"","name":"Heizung","tab":"748155f1.44babc","order":7,"disp":true,"width":"6","collapse":false},{"id":"139243fe.5b95ac","type":"pushbullet-config","z":"","name":"FabsPushbullet"},{"id":"c2e6322e.33404","type":"fritz-api","z":"","name":"fritzBox","host":"http://fritz.box","strictSSL":true},{"id":"748155f1.44babc","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Ich hoffe bei euch hat alles wie beschrieben funktioniert. Falls nicht oder ihr Fragen oder Anregungen habt lasst es mich in den Kommentaren bitte wissen. Ich trage dies dann ggf. in den Artikel nach.
Auch Ideen für neue Projekte sind immer gerne willkommen. 🙂

Fab

P.S. Viele dieser Projekte - besonders die Hardwareprojekte - kosten viel Zeit und Geld. Natürlich mache ich das weil ich Spaß daran habe, aber wenn Du es cool findest, dass ich die Infos dazu mit Euch teile, würde ich mich über eine kleine Spende an die Kaffeekasse freuen. 🙂

Buy Me a Coffee at ko-fi.com

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.