Electric heating for gym-room

Hardware: PRI 4 (bullseye), shelly plug s, enocean humidity & temperature sensor, electric convection heater (max 2000 Watt)
The room will be used between 8 and 9 in the morning and should have 18 °C. The rest of the day it could fall back to 16°C.
To achieve this, I use Chron plus to handle the set temperature. To avoid problems with power loss, I am sending the set (soll) temperature every 2 min to the 2-point-switch. - Chron plus will always restart with the correct time.
On startup, the ist temperature is set to soll temperature. This avoids starting the heater before the first sensor ist temperature is received.
I am switching the shelly plug s with http requests. As I have many http requests on my RPI, I am using a central http-request flow which I added as well.
The little symbol clock/hand switches between automatic set temperature and manual set temperature which could be done in the numeric input field. Below that field the run time of the heater is displayed.
The time of the last update is displayed on the topic of each gauge.
On the very right side of the display a dot shows the status of the heater. (Red = on).
At the bottom of the screen are the time for sunrise and sunset as well as the duration of day and night delivered from Chron plus.

[{"id":"6571233d56e4147b","type":"tab","label":"central http request","disabled":false,"info":"","env":[]},{"id":"d59a2325dd14c795","type":"link in","z":"6571233d56e4147b","name":"http-request-in","links":["7425a2432b92bb18"],"x":145,"y":280,"wires":[["5ab34b4781bc1caf","14d66265c705c0b9"]]},{"id":"e68047ac842dec83","type":"http request","z":"6571233d56e4147b","name":"central HTTP request","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":670,"y":280,"wires":[["f329bb9bfb89d858"]]},{"id":"94280fbadd4967bf","type":"link out","z":"6571233d56e4147b","name":"http-request-out","mode":"return","links":[],"x":1005,"y":280,"wires":[]},{"id":"5ab34b4781bc1caf","type":"function","z":"6571233d56e4147b","name":"requestTimeout","func":"const to = 20000;               // request timeout in ms\nconst z = date_time_string();\n\nlet counter = context.get('counter') + 1;\nlet s = counter + \" | \" + z + \" | \" + msg.url + \" | \" + to + \"ms\";\nnode.status({ text: s });\ncontext.set('counter', counter);\nmsg.requestTimeout = to;\nreturn msg;\n\n//--------------------------------------------------------------------\n\nfunction date_time_string() {\n    const date = new Date(Date.now());\n    const year = date.getFullYear();\n    const month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n    const day = (\"0\" + date.getDate()).slice(-2);\n    const hours = (\"0\" + date.getHours()).slice(-2);\n    const minutes = (\"0\" + date.getMinutes()).slice(-2);\n    const seconds = (\"0\" + date.getSeconds()).slice(-2);\n    let datetimestring = hours + ':' + minutes + ':' + seconds;\n    return datetimestring;\n}","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set(\"counter\", 0)\n","finalize":"","libs":[],"x":310,"y":280,"wires":[["e68047ac842dec83"]]},{"id":"7171d46447d9dd80","type":"function","z":"6571233d56e4147b","name":"","func":"msg.payload = \"Fehlerzeitpunkt: \" + msg.date + \" / \" +\n    \"RPI 67\" + \" / \" +\n    \"Flow: central http request\" + \" / \" +\n    \"topic: \" + msg.topic + \" / \" +\n    \"url: \" + msg.url + \" / \" +\n    \"Fehlermeldung: \" + msg.error.message + \" / \" +\n    \"Fehler ID: \"+ msg.error.source.id + \" / \" +\n    \"Fehlertyp: \" + msg.error.source.type + \" / \" +\n    \"Fehlernode: \" + msg.error.source.name + \" / \" + \n    \"Fehlerzähler: \" + msg.error.source.count;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":440,"wires":[["ecffc259c5e6f15b","fe2a97bef7fedda4"]]},{"id":"734b1bf305b93e8c","type":"catch","z":"6571233d56e4147b","name":"All errors","scope":null,"uncaught":false,"x":190,"y":440,"wires":[["624e340d47724b0a"]]},{"id":"ecffc259c5e6f15b","type":"mqtt out","z":"6571233d56e4147b","name":"","topic":"send-to-Telegram","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"4d127d7585f20d02","x":780,"y":460,"wires":[]},{"id":"624e340d47724b0a","type":"change","z":"6571233d56e4147b","name":"DD-MM-YYYY HH:mm:ss","rules":[{"t":"set","p":"date","pt":"msg","to":"$moment().format(\"DD-MM-YYYY HH:mm:ss\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":440,"wires":[["7171d46447d9dd80"]]},{"id":"fe2a97bef7fedda4","type":"debug","z":"6571233d56e4147b","name":"debug central http request 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":420,"wires":[]},{"id":"3e71970ac957f920","type":"debug","z":"6571233d56e4147b","name":"debug central http request 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1110,"y":240,"wires":[]},{"id":"f329bb9bfb89d858","type":"switch","z":"6571233d56e4147b","name":"","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":860,"y":280,"wires":[["94280fbadd4967bf","3e71970ac957f920"],["2f9ad77be5d3ada8"]]},{"id":"2f9ad77be5d3ada8","type":"debug","z":"6571233d56e4147b","name":"debug central http request 3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1110,"y":320,"wires":[]},{"id":"14d66265c705c0b9","type":"debug","z":"6571233d56e4147b","name":"debug central http request 1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":220,"wires":[]},{"id":"d8a4fcc0c3abc0ee","type":"ui_spacer","z":"6571233d56e4147b","name":"spacer","group":"4083a85ccbfc8864","order":6,"width":1,"height":1},{"id":"f77140076aef89df","type":"ui_spacer","z":"6571233d56e4147b","name":"spacer","group":"4083a85ccbfc8864","order":9,"width":1,"height":1},{"id":"4d127d7585f20d02","type":"mqtt-broker","name":"","broker":"10.0.0.43","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"MQTT/Development","birthQos":"0","birthRetain":"true","birthPayload":"online","birthMsg":{},"closeTopic":"MQTT/Development","closeQos":"0","closeRetain":"true","closePayload":"offline","closeMsg":{},"willTopic":"MQTT/Development","willQos":"0","willRetain":"true","willPayload":"disconnected","willMsg":{},"sessionExpiry":""},{"id":"4083a85ccbfc8864","type":"ui_group","name":"shelly 2.5 UGTR","tab":"97b02d6687551271","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"97b02d6687551271","type":"ui_tab","name":"shelly 2.5","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Main flow (to big for preformatted text)
Gymroom Heating.txt (38.7 KB)

3 Likes