Nodered aufsetzen

Der Faulheit halber nimmt man dasfertige C't Setup.

Nur leider crasht der NodeRed- Container beim Start, darum ersetzt man das C't Image im docker-compose.yml vor dem ersten Start dann doch mit dem Original von NodeRed und setzt die Ports und Network modes wie in einer älteren Version, dann geht's jedenfalls

version: '3.6' services: nodered: #image: ghcr.io/ct-open-source/ctnodered:latest image: nodered/node-red ports: - "1880:1880" volumes: - ./data/nodered:/data - /etc/localtime:/etc/localtime depends_on: - mqtt restart: always # network_mode: "host" environment: - TZ=Europe/Berlin mqtt: image: "eclipse-mosquitto" ports: - "1883:1883" - "9001:9001" volumes: - ./data/mqtt:/mosquitto - /etc/localtime:/etc/localtime restart: always environment: - TZ=Europe/Berlin zigbee: image: koenkk/zigbee2mqtt volumes: - ./data/zigbee:/app/data - /run/udev:/run/udev:ro - /etc/localtime:/etc/localtime devices: - "/dev/ttyACM0:/dev/ttyACM0" - "/dev/ttyACM1:/dev/ttyACM1" restart: always privileged: true ports: - 1881:1881 environment: - TZ=Europe/Berlin

Wenn man die ersten MQTT- Node einrichtet: Der lokale MQTT Server läuft dann auf dem Host mqtt und muß auch mit dem Namen als Server angegeben werden.

Beim Start mit docker compose up nodered with nodered über fehlende Schreibrechte im data- Folder meckern, das korrigiert man mit

sudo chmod a+rwx -R data

Die aktuelle Version von mosquitto beendet sich, wenn sie keine config/mosquitto.conf findet und lauscht per Default nur an localhost. Man muß die Config also erst bauen:

cd docker/nodered/data/mqtt
sudo mkdir -p config
sudo nano config/mosquitto.conf

mit dem Inhalt

listener 1883
allow_anonymous true

Anbindung an Node-RED Smart Home Control

Auf https://red.cb-net.co.uk/new-user einen User- Account holen

Auf https://red.cb-net.co.uk/devices das erste Gerät einrichten

Wie beschrieben, die notwendigen Nodes installieren.

Wenn bis dahin alles geklappt hat, wird das Gerät als Device angezeigt, wenn man eine alexa-smart-home-v3 anlegt.

Wenn man dann die Google- Anbindung geschafft hat, kann man mit einer Debug- Node wunderbar die Node- Events reinkommen sehen, wenn man die Google Home Kommandos spricht

Nützliche Nodes

Timer in Dashboard

Hier der komplette Node-Red-Code

[ { "id": "806162448d18ac14", "type": "tab", "label": "Nachtlichter", "disabled": false, "info": "", "env": [] }, { "id": "d044ea01444a971e", "type": "tab", "label": "Morgensonne", "disabled": false, "info": "", "env": [] }, { "id": "67a1adb0.e42284", "type": "tab", "label": "Sunrise", "disabled": false, "info": "" }, { "id": "8e566f01.3cb7e", "type": "tab", "label": "Nathalie Nachtlicht", "disabled": false, "info": "" }, { "id": "d81b425e4d857f1d", "type": "tab", "label": "Vitrine", "disabled": false, "info": "", "env": [] }, { "id": "06e0f70d4768d26a", "type": "tab", "label": "Ladekontrolle", "disabled": false, "info": "", "env": [] }, { "id": "b9dc955b9fa84b3f", "type": "tab", "label": "Arbeitszimmer", "disabled": false, "info": "", "env": [] }, { "id": "a835cf98310dcb70", "type": "tab", "label": "SatIP Empfänger", "disabled": false, "info": "", "env": [] }, { "id": "128b9e6ffb5a44da", "type": "tab", "label": "Dashboard Morgenlichter", "disabled": false, "info": "", "env": [] }, { "id": "32c1fd5e.098ec2", "type": "tab", "label": "Zuul- Websocket", "disabled": false, "info": "" }, { "id": "20f5b48f.283ffc", "type": "subflow", "name": "Timer Settings (2)", "info": "", "category": "", "in": [ { "x": 500, "y": 320, "wires": [ { "id": "dd09ea56.667bf8" } ] } ], "out": [ { "x": 740, "y": 320, "wires": [ { "id": "dd09ea56.667bf8", "port": 0 } ] } ], "env": [ { "name": "TimerNumber", "type": "num", "value": "" }, { "name": "PayloadON", "type": "str", "value": "" }, { "name": "PayloadOFF", "type": "str", "value": "" } ], "color": "#DDAA99" }, { "id": "059bca2abc83dd01", "type": "mqtt-broker", "name": "mqtt", "broker": "mqtt", "port": "1883", "clientid": "", "autoConnect": true, "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "autoUnsubscribe": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "sessionExpiry": "" }, { "id": "4025a95e85247f7b", "type": "websocket-client", "path": "ws://zuulac:8000/", "tls": "", "wholemsg": "false", "hb": "0", "subprotocol": "" }, { "id": "84ca84997ca40b2b", "type": "alexa-smart-home-v3-conf", "username": "steffenkoehler", "mqttserver": "mq-red.cb-net.co.uk", "webapiurl": "red.cb-net.co.uk", "contextName": "memory" }, { "id": "f68a58dad3a415d7", "type": "ui-base", "name": "My Dashboard", "path": "/dashboard", "appIcon": "", "includeClientData": true, "acceptsClientConfig": [ "ui-notification", "ui-control" ], "showPathInSidebar": false, "headerContent": "page", "navigationStyle": "default", "titleBarStyle": "default", "showReconnectNotification": true, "notificationDisplayTime": 1, "showDisconnectNotification": true, "allowInstall": true }, { "id": "6b4a8aa538269f22", "type": "ui-theme", "name": "Default Theme", "colors": { "surface": "#ffffff", "primary": "#0094CE", "bgPage": "#eeeeee", "groupBg": "#ffffff", "groupOutline": "#cccccc" }, "sizes": { "density": "default", "pagePadding": "12px", "groupGap": "12px", "groupBorderRadius": "4px", "widgetGap": "12px" } }, { "id": "faa61e092a1033e6", "type": "ui-page", "name": "Lichter", "ui": "f68a58dad3a415d7", "path": "/page1", "icon": "home", "layout": "grid", "theme": "6b4a8aa538269f22", "breakpoints": [ { "name": "Default", "px": "0", "cols": "3" }, { "name": "Tablet", "px": "576", "cols": "6" }, { "name": "Small Desktop", "px": "768", "cols": "9" }, { "name": "Desktop", "px": "1024", "cols": "12" } ], "order": 1, "className": "", "visible": "true", "disabled": "false" }, { "id": "a08df7b2703d7adf", "type": "ui-group", "name": "Schalter", "page": "faa61e092a1033e6", "width": 6, "height": 1, "order": 1, "showTitle": true, "className": "", "visible": "true", "disabled": "false", "groupType": "default" }, { "id": "dd09ea56.667bf8", "type": "function", "z": "20f5b48f.283ffc", "name": "", "func": "var x = env.get(\"TimerNumber\"); \nvar y = env.get(\"PayloadON\"); \nvar z = env.get(\"PayloadOFF\"); \n\nflow.set(\"$parent.Timer\"+x, x);\nflow.set(\"$parent.Payload\"+x+\"_on\", y);\nflow.set(\"$parent.Payload\"+x+\"_off\", z);\n\n\n\nmsg.payload = \"Your timer \" + x + \" has been set\";\n\nreturn msg;\n", "outputs": 1, "noerr": 0, "x": 600, "y": 320, "wires": [ [] ] }, { "id": "dd504f7211099e5f", "type": "schedex", "z": "806162448d18ac14", "name": "Dunkelheit", "passthroughunhandled": false, "suspended": false, "lat": "53.327275", "lon": "8.477777", "ontime": "21:45", "ontopic": "", "onpayload": "ON", "onoffset": 0, "onrandomoffset": 0, "offtime": "sunrise", "offtopic": "", "offpayload": "OFF", "offoffset": 0, "offrandomoffset": 0, "mon": true, "tue": true, "wed": true, "thu": true, "fri": true, "sat": true, "sun": true, "x": 370, "y": 80, "wires": [ [ "8896526d3968af27" ] ] }, { "id": "f89cb08278b19366", "type": "link out", "z": "806162448d18ac14", "name": "Abends", "mode": "link", "links": [], "x": 1025, "y": 120, "wires": [] }, { "id": "db71b6d178e1f608", "type": "switch", "z": "806162448d18ac14", "name": "An und Aus", "property": "payload", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 870, "y": 140, "wires": [ [ "f89cb08278b19366" ], [ "c3a7a8cb9d0e9066" ] ] }, { "id": "c3a7a8cb9d0e9066", "type": "link out", "z": "806162448d18ac14", "name": "Morgens", "mode": "link", "links": [ "26cc962b9d3bfc79", "6a33b4045fa24a5c", "f2493ce1650268f2" ], "x": 1025, "y": 160, "wires": [] }, { "id": "427d398252fc6ea6", "type": "link out", "z": "806162448d18ac14", "name": "Dunkelheit", "mode": "link", "links": [ "fa74251f3690f52d" ], "x": 1105, "y": 80, "wires": [] }, { "id": "227713a38e9c3fb2", "type": "alexa-smart-home-v3", "z": "806162448d18ac14", "conf": "84ca84997ca40b2b", "device": "39313", "acknowledge": true, "name": "Morgensonne", "topic": "Sonne", "x": 490, "y": 280, "wires": [ [ "3903df5baa7e7504", "fe656d0e17f4f7d0" ] ] }, { "id": "3903df5baa7e7504", "type": "debug", "z": "806162448d18ac14", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 690, "y": 400, "wires": [] }, { "id": "39c6967ec7775363", "type": "switch", "z": "806162448d18ac14", "name": "ON-OFF", "property": "payload", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 940, "y": 280, "wires": [ [ "90a61768daa0b5f6" ], [ "2a9339433f2b2d8f" ] ] }, { "id": "90a61768daa0b5f6", "type": "link out", "z": "806162448d18ac14", "name": "Morgensonne An", "mode": "link", "links": [ "f2493ce1650268f2", "dd715b75ba033f3e" ], "x": 1095, "y": 280, "wires": [] }, { "id": "2a9339433f2b2d8f", "type": "link out", "z": "806162448d18ac14", "name": "Morgensonne Aus", "mode": "link", "links": [ "6a33b4045fa24a5c", "f2493ce1650268f2" ], "x": 1095, "y": 320, "wires": [] }, { "id": "5f38f775dfbeaa9c", "type": "inject", "z": "806162448d18ac14", "name": "Aktuelle On/Off Abfrage", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "info_local", "payloadType": "str", "x": 120, "y": 80, "wires": [ [ "dd504f7211099e5f" ] ] }, { "id": "5f4aed668c312586", "type": "debug", "z": "806162448d18ac14", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 850, "y": 40, "wires": [] }, { "id": "daa0f2e77175b08e", "type": "inject", "z": "806162448d18ac14", "name": "Dunkelheit OFF", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "OFF", "payloadType": "str", "x": 100, "y": 140, "wires": [ [ "dd504f7211099e5f" ] ] }, { "id": "f5c4577f9a766627", "type": "debug", "z": "806162448d18ac14", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 730, "y": 220, "wires": [] }, { "id": "4e2d2c2d49f4f418", "type": "function", "z": "806162448d18ac14", "name": "Treshold Ping failures", "func": "\nvar previous = context.get('ping_treshold')||0;\nvar trigger_level = 120 // 120 ticks a 6 ticks per min = 20 mins delay\nif ( msg.payload === false){\n if (previous< trigger_level){\n previous ++\n if (previous >= trigger_level){\n // negative trigger\n previous=trigger_level\n context.set('ping_treshold',previous)\n msg.payload=false\n return msg // returns false as falling edge\n }\n context.set('ping_treshold',previous)\n }\n}else{\n if (previous > 0){\n previous=0 \n // positive trigger\n context.set('ping_treshold',previous)\n msg.payload=true\n return msg\n }\n}\nreturn null\n", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 420, "y": 180, "wires": [ [ "f5c4577f9a766627", "72f133dddbb8e1c6" ] ] }, { "id": "5f6ed5a33d387b50", "type": "ping", "z": "806162448d18ac14", "protocol": "Automatic", "mode": "timed", "name": "", "host": "Pixel-8", "timer": "20", "inputs": 0, "x": 70, "y": 180, "wires": [ [ "4e2d2c2d49f4f418" ] ] }, { "id": "8896526d3968af27", "type": "change", "z": "806162448d18ac14", "name": "ONOFF to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 600, "y": 80, "wires": [ [ "427d398252fc6ea6", "5f4aed668c312586", "db71b6d178e1f608" ] ] }, { "id": "fe656d0e17f4f7d0", "type": "change", "z": "806162448d18ac14", "name": "ONOFF to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 740, "y": 280, "wires": [ [ "39c6967ec7775363" ] ] }, { "id": "72f133dddbb8e1c6", "type": "switch", "z": "806162448d18ac14", "name": "Allow only FALSE message", "property": "payload", "propertyType": "msg", "rules": [ { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 740, "y": 180, "wires": [ [ "c3a7a8cb9d0e9066" ] ] }, { "id": "08df6f023ea8dc6b", "type": "mqtt out", "z": "d044ea01444a971e", "name": "Morgensonne", "topic": "home/sunrise1/set", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1560, "y": 620, "wires": [] }, { "id": "4926620580762ce5", "type": "inject", "z": "d044ea01444a971e", "name": "", "props": [ { "p": "payload", "v": "{\"state\":\"ON\"}", "vt": "json" }, { "p": "topic", "v": "", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"state\":\"ON\"}", "payloadType": "json", "x": 930, "y": 720, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "6e8216935c42e810", "type": "inject", "z": "d044ea01444a971e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"state\":\"OFF\"}", "payloadType": "json", "x": 920, "y": 800, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "dd715b75ba033f3e", "type": "link in", "z": "d044ea01444a971e", "name": "Sonnemaufgang An", "links": [ "90a61768daa0b5f6", "b812abcfda391d30" ], "x": 195, "y": 620, "wires": [ [ "b3f70f0813abc7c6" ] ] }, { "id": "6a33b4045fa24a5c", "type": "link in", "z": "d044ea01444a971e", "name": "Sonne aus", "links": [ "2a9339433f2b2d8f", "c3a7a8cb9d0e9066" ], "x": 845, "y": 580, "wires": [ [ "b7be36446f2f8e9d" ] ] }, { "id": "aefc43ca878864ba", "type": "mqtt in", "z": "d044ea01444a971e", "name": "", "topic": "home/sunrise1", "qos": "2", "datatype": "json", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 180, "y": 300, "wires": [ [ "e70d130e6ede457a", "5c6263f34f1cc806" ] ] }, { "id": "e5120db2242d1916", "type": "function", "z": "d044ea01444a971e", "name": "ChangedState", "func": "var previous = context.get('previous')||'';\nvar msg_state=msg.payload.state\nif (previous!= msg_state){\n context.set('previous',msg_state);\n msg.payload=msg_state;\n return msg;\n}else{\n return null;\n}", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 400, "y": 380, "wires": [ [ "74c89caddb018cce" ] ] }, { "id": "e029be296f1ef9a9", "type": "inject", "z": "d044ea01444a971e", "name": "Sunrise Movie", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"effect\":\"sunrise\",\"transition\":\"600\"}", "payloadType": "json", "x": 930, "y": 760, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "d3e4cb9ab0f34fdf", "type": "change", "z": "d044ea01444a971e", "name": "Switch ON", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 570, "y": 460, "wires": [ [ "d7203ba84b2cd31f", "0c36fc7b7736a319" ] ] }, { "id": "b3f70f0813abc7c6", "type": "change", "z": "d044ea01444a971e", "name": "Request Sunrise", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "{\"effect\":\"sunrise\",\"transition\":\"600\"}", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 330, "y": 620, "wires": [ [ "d3e4cb9ab0f34fdf", "1464bde8027b0004" ] ] }, { "id": "74c89caddb018cce", "type": "change", "z": "d044ea01444a971e", "name": "ONOFF to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 600, "y": 380, "wires": [ [ "d7203ba84b2cd31f", "616848466ff2e8d2" ] ] }, { "id": "b7be36446f2f8e9d", "type": "change", "z": "d044ea01444a971e", "name": "bool to State", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "{\"state\": \"ON\"}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "{\"state\": \"OFF\"}", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1070, "y": 460, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "d7203ba84b2cd31f", "type": "ui-switch", "z": "d044ea01444a971e", "name": "Morgensonne", "label": "Morgensonne", "group": "a08df7b2703d7adf", "order": 9, "width": 0, "height": 0, "passthru": false, "decouple": false, "topic": "payload", "topicType": "msg", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 800, "y": 460, "wires": [ [ "b7be36446f2f8e9d", "231a6371e2b10277" ] ] }, { "id": "4755f75988167ecd", "type": "ui-button", "z": "d044ea01444a971e", "group": "a08df7b2703d7adf", "name": "Effekt 1", "label": "Effekt 1", "order": 3, "width": 0, "height": 0, "emulateClick": false, "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "iconPosition": "left", "payload": "", "payloadType": "str", "topic": "topic", "topicType": "msg", "buttonColor": "", "textColor": "", "iconColor": "", "enableClick": true, "enablePointerdown": false, "pointerdownPayload": "", "pointerdownPayloadType": "str", "enablePointerup": false, "pointerupPayload": "", "pointerupPayloadType": "str", "x": 960, "y": 880, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "458d2ac841454277", "type": "ui-button", "z": "d044ea01444a971e", "group": "a08df7b2703d7adf", "name": "Effekt 2", "label": "Effekt 2", "order": 2, "width": 0, "height": 0, "emulateClick": false, "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "iconPosition": "left", "payload": "", "payloadType": "str", "topic": "topic", "topicType": "msg", "buttonColor": "", "textColor": "", "iconColor": "", "enableClick": true, "enablePointerdown": false, "pointerdownPayload": "", "pointerdownPayloadType": "str", "enablePointerup": false, "pointerupPayload": "", "pointerupPayloadType": "str", "x": 960, "y": 940, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "911823150a09f3bc", "type": "ui-button", "z": "d044ea01444a971e", "group": "a08df7b2703d7adf", "name": "Effekt 3", "label": "Effekt 3", "order": 1, "width": 0, "height": 0, "emulateClick": false, "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "iconPosition": "left", "payload": "", "payloadType": "str", "topic": "topic", "topicType": "msg", "buttonColor": "", "textColor": "", "iconColor": "", "enableClick": true, "enablePointerdown": false, "pointerdownPayload": "", "pointerdownPayloadType": "str", "enablePointerup": false, "pointerupPayload": "", "pointerupPayloadType": "str", "x": 960, "y": 1000, "wires": [ [ "1464bde8027b0004" ] ] }, { "id": "616848466ff2e8d2", "type": "debug", "z": "d044ea01444a971e", "name": "debug 1", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 820, "y": 300, "wires": [] }, { "id": "231a6371e2b10277", "type": "debug", "z": "d044ea01444a971e", "name": "debug 2", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 820, "y": 360, "wires": [] }, { "id": "e70d130e6ede457a", "type": "debug", "z": "d044ea01444a971e", "name": "debug 3", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 680, "y": 180, "wires": [] }, { "id": "0c36fc7b7736a319", "type": "debug", "z": "d044ea01444a971e", "name": "debug 5", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 700, "y": 560, "wires": [] }, { "id": "1464bde8027b0004", "type": "function", "z": "d044ea01444a971e", "name": "store state in Flow", "func": "flow.set(\"state\", msg.payload.state);\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1310, "y": 620, "wires": [ [ "08df6f023ea8dc6b", "1469e0fefc27aa2f" ] ] }, { "id": "1469e0fefc27aa2f", "type": "debug", "z": "d044ea01444a971e", "name": "Morgensonne Input", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1550, "y": 460, "wires": [] }, { "id": "5c6263f34f1cc806", "type": "function", "z": "d044ea01444a971e", "name": "react on wrong state", "func": "var correct_state = flow.get('state');\nnode.warn(correct_state);\nvar msg_state=msg.payload.state\nif (correct_state == \"OFF\" && msg_state ==\"ON\"){\n msg.payload=false; // try to switch the lamp off again\n node.warn(\"Try to switch off\");\n return [null, msg];\n}else{\n return [msg, null];\n}", "outputs": 2, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 580, "y": 60, "wires": [ [ "e5120db2242d1916" ], [ "b7be36446f2f8e9d" ] ] }, { "id": "3fec84a9.e74f6c", "type": "inject", "z": "67a1adb0.e42284", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"effect\":\"sunrise\",\"transition\":600}", "payloadType": "json", "x": 280, "y": 200, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "163d12b6.a7b6fd", "type": "mqtt out", "z": "67a1adb0.e42284", "name": "", "topic": "home/sunrise2/set", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 710, "y": 160, "wires": [] }, { "id": "deef52c7.5f52e", "type": "inject", "z": "67a1adb0.e42284", "name": "", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"state\":\"OFF\"}", "payloadType": "json", "x": 300, "y": 240, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "5bf020f9.803f4", "type": "inject", "z": "67a1adb0.e42284", "name": "", "props": [ { "p": "payload", "v": "{\"state\":\"ON\"}", "vt": "json" }, { "p": "topic", "v": "", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"state\":\"ON\"}", "payloadType": "json", "x": 290, "y": 280, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "3ebdb00c.5f7a3", "type": "inject", "z": "67a1adb0.e42284", "name": "", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"effect\":\"aqua\"}", "payloadType": "json", "x": 300, "y": 40, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "7a921fd3.17fb7", "type": "inject", "z": "67a1adb0.e42284", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"effect\":\"sunrise\",\"loop\":\"false\"}", "payloadType": "json", "x": 280, "y": 120, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "3121006f.2d812", "type": "inject", "z": "67a1adb0.e42284", "name": "", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"effect\":\"sunrOse\"}", "payloadType": "json", "x": 310, "y": 160, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "62633276.25399c", "type": "inject", "z": "67a1adb0.e42284", "name": "", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"effect\":\"sunrise\"}", "payloadType": "json", "x": 310, "y": 80, "wires": [ [ "163d12b6.a7b6fd" ] ] }, { "id": "ab71e19d.8f1ab", "type": "mqtt in", "z": "8e566f01.3cb7e", "name": "", "topic": "stat/sonoff522BFF/POWER", "qos": "2", "datatype": "auto", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 160, "y": 100, "wires": [ [ "4b855817.514258", "72fc0a46.dfb914" ] ] }, { "id": "4b855817.514258", "type": "debug", "z": "8e566f01.3cb7e", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 390, "y": 40, "wires": [] }, { "id": "3ea4ffbd.61c7b", "type": "mqtt out", "z": "8e566f01.3cb7e", "name": "", "topic": "cmnd/sonoff522BFF/POWER", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1520, "y": 220, "wires": [] }, { "id": "7d9fda11.feee64", "type": "inject", "z": "8e566f01.3cb7e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "false", "payloadType": "bool", "x": 860, "y": 280, "wires": [ [ "17737f6e08e44023" ] ] }, { "id": "af4205d9.42c1d8", "type": "inject", "z": "8e566f01.3cb7e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "true", "payloadType": "bool", "x": 860, "y": 220, "wires": [ [ "17737f6e08e44023" ] ] }, { "id": "72fc0a46.dfb914", "type": "function", "z": "8e566f01.3cb7e", "name": "ChangesOnly", "func": "var previous = context.get('previous')||'';\n\nif (previous!= msg.payload){\n context.set('previous',msg.payload);\n return msg;\n}else{\n return null;\n}", "outputs": 1, "noerr": 0, "x": 400, "y": 100, "wires": [ [ "93856a67c260212f" ] ] }, { "id": "fa74251f3690f52d", "type": "link in", "z": "8e566f01.3cb7e", "name": "Nachtlicht", "links": [ "427d398252fc6ea6" ], "x": 1015, "y": 320, "wires": [ [ "a16ab5789893380a", "17737f6e08e44023" ] ] }, { "id": "a16ab5789893380a", "type": "debug", "z": "8e566f01.3cb7e", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1290, "y": 320, "wires": [] }, { "id": "d634211e59f88f22", "type": "ui-switch", "z": "8e566f01.3cb7e", "name": "Nathalies Licht", "label": "Nathalie Licht", "group": "a08df7b2703d7adf", "order": 4, "width": 0, "height": 0, "passthru": false, "decouple": false, "topic": "topic", "topicType": "msg", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 840, "y": 100, "wires": [ [ "17737f6e08e44023" ] ] }, { "id": "17737f6e08e44023", "type": "change", "z": "8e566f01.3cb7e", "name": "Bool to ONOFF", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "ON", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "OFF", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1240, "y": 260, "wires": [ [ "3ea4ffbd.61c7b" ] ] }, { "id": "93856a67c260212f", "type": "change", "z": "8e566f01.3cb7e", "name": "ONOFF to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 620, "y": 100, "wires": [ [ "d634211e59f88f22" ] ] }, { "id": "fd35e0f9d1f37657", "type": "mqtt in", "z": "d81b425e4d857f1d", "name": "", "topic": "stat/tasmota_77CE12/POWER", "qos": "2", "datatype": "auto-detect", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 170, "y": 120, "wires": [ [ "ea9b7c21cb80a28e" ] ] }, { "id": "23e2248f994f1c94", "type": "mqtt out", "z": "d81b425e4d857f1d", "name": "", "topic": "cmnd/tasmota_77CE12/POWER", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1730, "y": 240, "wires": [] }, { "id": "067ae418c00b5ac7", "type": "inject", "z": "d81b425e4d857f1d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "true", "payloadType": "bool", "x": 1140, "y": 220, "wires": [ [ "45cc3e34cb24ba26" ] ] }, { "id": "1253680161c34dbd", "type": "inject", "z": "d81b425e4d857f1d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "false", "payloadType": "bool", "x": 1140, "y": 280, "wires": [ [ "45cc3e34cb24ba26" ] ] }, { "id": "ea9b7c21cb80a28e", "type": "function", "z": "d81b425e4d857f1d", "name": "ChangesOnly", "func": "var previous = context.get('previous')||'';\n\nif (previous!= msg.payload){\n context.set('previous',msg.payload);\n return msg;\n}else{\n return null;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 460, "y": 120, "wires": [ [ "afe41f2d4c6a8cf8" ] ] }, { "id": "26cc962b9d3bfc79", "type": "link in", "z": "d81b425e4d857f1d", "name": "Nachtlicht", "links": [ "2a9339433f2b2d8f", "90a61768daa0b5f6", "b812abcfda391d30", "c3a7a8cb9d0e9066" ], "x": 1215, "y": 340, "wires": [ [ "45cc3e34cb24ba26" ] ] }, { "id": "e8b4d50fcafcd810", "type": "ui-switch", "z": "d81b425e4d857f1d", "name": "Vitrine", "label": "Vitrine", "group": "a08df7b2703d7adf", "order": 5, "width": 0, "height": 0, "passthru": false, "decouple": false, "topic": "topic", "topicType": "msg", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 930, "y": 120, "wires": [ [ "45cc3e34cb24ba26" ] ] }, { "id": "45cc3e34cb24ba26", "type": "change", "z": "d81b425e4d857f1d", "name": "Bool to ONOFF", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "ON", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "OFF", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1440, "y": 240, "wires": [ [ "23e2248f994f1c94" ] ] }, { "id": "afe41f2d4c6a8cf8", "type": "change", "z": "d81b425e4d857f1d", "name": "ONOFF to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 720, "y": 120, "wires": [ [ "e8b4d50fcafcd810", "39b92997dd7d90f0" ] ] }, { "id": "39b92997dd7d90f0", "type": "debug", "z": "d81b425e4d857f1d", "name": "debug 4", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 940, "y": 380, "wires": [] }, { "id": "c7d551328dabd0f5", "type": "mqtt in", "z": "06e0f70d4768d26a", "name": "", "topic": "stat/tasmota_502D3E/POWER", "qos": "2", "datatype": "auto-detect", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 190, "y": 120, "wires": [ [ "ded4c03b26bcb68c" ] ] }, { "id": "7ed17a2f56647345", "type": "mqtt out", "z": "06e0f70d4768d26a", "name": "", "topic": "cmnd/tasmota_502D3E/POWER", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1750, "y": 240, "wires": [] }, { "id": "e69d4e3b68941ae6", "type": "inject", "z": "06e0f70d4768d26a", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "true", "payloadType": "bool", "x": 1160, "y": 220, "wires": [ [ "dbeb78b2d34e56df" ] ] }, { "id": "580ad27a111e2632", "type": "inject", "z": "06e0f70d4768d26a", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "false", "payloadType": "bool", "x": 1160, "y": 280, "wires": [ [ "dbeb78b2d34e56df" ] ] }, { "id": "ded4c03b26bcb68c", "type": "function", "z": "06e0f70d4768d26a", "name": "ChangesOnly", "func": "var previous = context.get('previous')||'';\n\nif (previous!= msg.payload){\n context.set('previous',msg.payload);\n return msg;\n}else{\n return null;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 480, "y": 120, "wires": [ [ "0912574b39ac87fc" ] ] }, { "id": "7f182a302d2fe5ed", "type": "ui-switch", "z": "06e0f70d4768d26a", "name": "Ladekontrollleuchte", "label": "Ladekontrollleuchte", "group": "a08df7b2703d7adf", "order": 6, "width": 0, "height": 0, "passthru": false, "decouple": false, "topic": "topic", "topicType": "msg", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 990, "y": 120, "wires": [ [ "dbeb78b2d34e56df" ] ] }, { "id": "dbeb78b2d34e56df", "type": "change", "z": "06e0f70d4768d26a", "name": "Bool to ONOFF", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "ON", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "OFF", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1460, "y": 240, "wires": [ [ "7ed17a2f56647345" ] ] }, { "id": "0912574b39ac87fc", "type": "change", "z": "06e0f70d4768d26a", "name": "ONOFF to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 740, "y": 120, "wires": [ [ "7f182a302d2fe5ed", "cb62523d5a2e5810" ] ] }, { "id": "cb62523d5a2e5810", "type": "debug", "z": "06e0f70d4768d26a", "name": "debug 6", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 960, "y": 380, "wires": [] }, { "id": "03a73c51116f6b71", "type": "mqtt in", "z": "06e0f70d4768d26a", "name": "", "topic": "wallbox/e66368254f8e2d2c/data", "qos": "2", "datatype": "json", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 290, "y": 480, "wires": [ [ "e0b4f19d4822145c", "750690d13173326a", "90245f37cb1ea996" ] ] }, { "id": "e0b4f19d4822145c", "type": "debug", "z": "06e0f70d4768d26a", "name": "Wallbox", "active": true, "tosidebar": false, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 500, "y": 580, "wires": [] }, { "id": "750690d13173326a", "type": "ui-chart", "z": "06e0f70d4768d26a", "group": "a08df7b2703d7adf", "name": "Stromaufnahme", "label": "Wallbox", "order": 10, "chartType": "line", "category": "topic", "categoryType": "msg", "xAxisLabel": "", "xAxisProperty": "", "xAxisPropertyType": "timestamp", "xAxisType": "time", "xAxisFormat": "", "xAxisFormatType": "auto", "xmin": "", "xmax": "", "yAxisLabel": "", "yAxisProperty": "payload.signal", "yAxisPropertyType": "msg", "ymin": "", "ymax": "", "bins": 10, "action": "append", "stackSeries": false, "pointShape": "circle", "pointRadius": 4, "showLegend": true, "removeOlder": 1, "removeOlderUnit": "3600", "removeOlderPoints": "", "colors": [ "#0095ff", "#ff0000", "#ff7f0e", "#2ca02c", "#a347e1", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "textColor": [ "#666666" ], "textColorDefault": true, "gridColor": [ "#e5e5e5" ], "gridColorDefault": true, "width": 6, "height": 8, "className": "", "interpolation": "linear", "x": 740, "y": 480, "wires": [ [] ] }, { "id": "90245f37cb1ea996", "type": "function", "z": "06e0f70d4768d26a", "name": "Hysteresis", "func": "var previous = context.get('previous')||false;\n\nif (previous && msg.payload.signal<1000){\n previous=false\n context.set('previous',previous);\n msg.payload=previous\n return msg;\n}else if \n(! previous && msg.payload.signal>2000){\n previous=true\n context.set('previous',previous);\n msg.payload=previous\n return msg;\n}\nelse {\n return null;\n}", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 690, "y": 260, "wires": [ [ "dbeb78b2d34e56df" ] ] }, { "id": "71b11e7cd31cdd39", "type": "mqtt in", "z": "b9dc955b9fa84b3f", "name": "", "topic": "ESPURNA-CB3DC3/relay/1", "qos": "2", "datatype": "auto-detect", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 160, "y": 120, "wires": [ [ "871d578729d17faa" ] ] }, { "id": "64d0e733d7309e4a", "type": "mqtt out", "z": "b9dc955b9fa84b3f", "name": "", "topic": "ESPURNA-CB3DC3/relay/1/set", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1370, "y": 200, "wires": [] }, { "id": "f78873543d55a1c9", "type": "inject", "z": "b9dc955b9fa84b3f", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "true", "payloadType": "bool", "x": 880, "y": 180, "wires": [ [ "29884ef27095bb7d" ] ] }, { "id": "c4373aa5e7abbf09", "type": "inject", "z": "b9dc955b9fa84b3f", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "topic", "payload": "false", "payloadType": "bool", "x": 880, "y": 240, "wires": [ [ "29884ef27095bb7d" ] ] }, { "id": "43a7818120e07cb7", "type": "function", "z": "b9dc955b9fa84b3f", "name": "ChangesOnly", "func": "var previous = context.get('previous')||'';\n\nif (previous!= msg.payload){\n context.set('previous',msg.payload);\n return msg;\n}else{\n return null;\n}", "outputs": 1, "noerr": 0, "x": 580, "y": 120, "wires": [ [ "5857b25ae32aafbb" ] ] }, { "id": "f2493ce1650268f2", "type": "link in", "z": "b9dc955b9fa84b3f", "name": "Nachtlicht", "links": [ "2a9339433f2b2d8f", "90a61768daa0b5f6", "b812abcfda391d30", "c3a7a8cb9d0e9066" ], "x": 895, "y": 300, "wires": [ [ "29884ef27095bb7d" ] ] }, { "id": "5857b25ae32aafbb", "type": "ui-switch", "z": "b9dc955b9fa84b3f", "name": "Arbeitszimmer", "label": "Arbeitszimmer", "group": "a08df7b2703d7adf", "order": 7, "width": 0, "height": 0, "passthru": false, "decouple": false, "topic": "topic", "topicType": "str", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 820, "y": 100, "wires": [ [ "29884ef27095bb7d" ] ] }, { "id": "29884ef27095bb7d", "type": "change", "z": "b9dc955b9fa84b3f", "name": "Bool to ONOFF", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "ON", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "OFF", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1120, "y": 200, "wires": [ [ "64d0e733d7309e4a" ] ] }, { "id": "871d578729d17faa", "type": "change", "z": "b9dc955b9fa84b3f", "name": "Number to Bool", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "1", "fromt": "num", "to": "true", "tot": "bool" }, { "t": "change", "p": "payload", "pt": "msg", "from": "0", "fromt": "num", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 400, "y": 120, "wires": [ [ "43a7818120e07cb7" ] ] }, { "id": "a78a2e025fcd8c09", "type": "mqtt in", "z": "a835cf98310dcb70", "name": "", "topic": "stat/tasmota_33C654/POWER", "qos": "2", "datatype": "auto", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 140, "y": 100, "wires": [ [ "305070209b180bbd", "69d5d46fee845fcd" ] ] }, { "id": "305070209b180bbd", "type": "debug", "z": "a835cf98310dcb70", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 370, "y": 40, "wires": [] }, { "id": "bd4230dc4eea4557", "type": "mqtt out", "z": "a835cf98310dcb70", "name": "", "topic": "cmnd/tasmota_33C654/POWER", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 850, "y": 160, "wires": [] }, { "id": "bd88385b6c9e80a3", "type": "inject", "z": "a835cf98310dcb70", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "On", "payload": "ON", "payloadType": "str", "x": 570, "y": 160, "wires": [ [ "bd4230dc4eea4557" ] ] }, { "id": "975e796daf41f1de", "type": "inject", "z": "a835cf98310dcb70", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "Aus", "payload": "OFF", "payloadType": "str", "x": 580, "y": 220, "wires": [ [ "bd4230dc4eea4557" ] ] }, { "id": "69d5d46fee845fcd", "type": "function", "z": "a835cf98310dcb70", "name": "ChangesOnly", "func": "var previous = context.get('previous')||'';\n\nif (previous!= msg.payload){\n context.set('previous',msg.payload);\n return msg;\n}else{\n return null;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 380, "y": 100, "wires": [ [ "697db4e52ce07ec6" ] ] }, { "id": "697db4e52ce07ec6", "type": "ui-switch", "z": "a835cf98310dcb70", "name": "SatTV- Power", "label": "SatIP", "group": "a08df7b2703d7adf", "order": 8, "width": 0, "height": 0, "passthru": false, "decouple": false, "topic": "topic", "topicType": "msg", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 600, "y": 100, "wires": [ [ "bd4230dc4eea4557" ] ] }, { "id": "f788f61c153d70b3", "type": "ui_time_scheduler", "z": "128b9e6ffb5a44da", "group": "Schalter", "name": "", "startDay": "1", "refresh": 60, "devices": [ "Morgensonne" ], "singleOff": false, "onlySendChange": false, "customPayload": false, "eventMode": true, "eventOptions": [ { "label": "Ein", "event": "ON" } ], "sendTopic": false, "lat": "53.32738518075729", "lon": "", "customContextStore": "", "outputs": 2, "order": 16, "width": 0, "height": 0, "x": 470, "y": 300, "wires": [ [ "be4a5bddf35ba028" ], [ "033b7a6461592678", "b812abcfda391d30" ] ] }, { "id": "be4a5bddf35ba028", "type": "debug", "z": "128b9e6ffb5a44da", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 790, "y": 300, "wires": [] }, { "id": "033b7a6461592678", "type": "debug", "z": "128b9e6ffb5a44da", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 790, "y": 360, "wires": [] }, { "id": "b812abcfda391d30", "type": "link out", "z": "128b9e6ffb5a44da", "name": "Morgensonne an", "mode": "link", "links": [ "dd715b75ba033f3e", "f2493ce1650268f2" ], "x": 595, "y": 420, "wires": [] }, { "id": "95de46d2.506628", "type": "websocket out", "z": "32c1fd5e.098ec2", "name": "zuul", "server": "", "client": "4025a95e85247f7b", "x": 970, "y": 260, "wires": [] }, { "id": "555024da.a2d69c", "type": "websocket in", "z": "32c1fd5e.098ec2", "name": "Zuul", "server": "", "client": "4025a95e85247f7b", "x": 50, "y": 240, "wires": [ [ "3c6d3630.41e21a" ] ] }, { "id": "4786210e.c8c08", "type": "debug", "z": "32c1fd5e.098ec2", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 990, "y": 200, "wires": [] }, { "id": "ed3f53ff.e57f5", "type": "comment", "z": "32c1fd5e.098ec2", "name": "Client", "info": "", "x": 90, "y": 60, "wires": [] }, { "id": "9ed49469.3c9358", "type": "json", "z": "32c1fd5e.098ec2", "name": "", "property": "payload", "action": "", "pretty": false, "x": 370, "y": 240, "wires": [ [ "c262156a.4af558", "a28d858a.f80338" ] ] }, { "id": "e9b01134.ce2ed", "type": "change", "z": "32c1fd5e.098ec2", "name": "Set OTP Parameters", "rules": [ { "t": "set", "p": "payload.type", "pt": "msg", "to": "ac_otprequest", "tot": "str" }, { "t": "set", "p": "payload.config.result", "pt": "msg", "to": "zuul_active", "tot": "flow" }, { "t": "set", "p": "payload.config.msg", "pt": "msg", "to": "zuul_msg", "tot": "flow" }, { "t": "set", "p": "payload.config.type", "pt": "msg", "to": "qrcode", "tot": "str" }, { "t": "set", "p": "payload.config.keypadchars", "pt": "msg", "to": "1234567890ABCD", "tot": "str" }, { "t": "set", "p": "payload.config.length", "pt": "msg", "to": "10", "tot": "num" }, { "t": "set", "p": "payload.config.valid_time", "pt": "msg", "to": "60", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 760, "y": 260, "wires": [ [ "4786210e.c8c08", "95de46d2.506628" ] ] }, { "id": "c262156a.4af558", "type": "switch", "z": "32c1fd5e.098ec2", "name": "OTP Request", "property": "payload", "propertyType": "msg", "rules": [ { "t": "jsonata_exp", "v": "payload.type = \"otprequest\"", "vt": "jsonata" }, { "t": "jsonata_exp", "v": "payload.type = \"tokenstate\" and payload.config.valid = true", "vt": "jsonata" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 520, "y": 240, "wires": [ [ "e9b01134.ce2ed" ], [ "665b57f8.5d4768", "34cec614d74bf158" ], [] ] }, { "id": "3c6d3630.41e21a", "type": "function", "z": "32c1fd5e.098ec2", "name": "Kill Session", "func": "msg._session = \"\";\nreturn msg;", "outputs": 1, "noerr": 0, "x": 230, "y": 240, "wires": [ [ "9ed49469.3c9358" ] ] }, { "id": "9d6e5f0.a99c5a", "type": "inject", "z": "32c1fd5e.098ec2", "name": "TRUE", "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "A", "payload": "true", "payloadType": "bool", "x": 110, "y": 540, "wires": [ [ "4808ec97.fa80b4" ] ] }, { "id": "a7f4c80.7e8b738", "type": "inject", "z": "32c1fd5e.098ec2", "name": "FALSE", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "A", "payload": "false", "payloadType": "bool", "x": 110, "y": 600, "wires": [ [ "4808ec97.fa80b4" ] ] }, { "id": "4808ec97.fa80b4", "type": "rbe", "z": "32c1fd5e.098ec2", "name": "Detect Change", "func": "rbe", "gap": "", "start": "", "inout": "out", "property": "payload", "x": 300, "y": 560, "wires": [ [ "925f2da0.bef99", "9952b919.359a08" ] ] }, { "id": "925f2da0.bef99", "type": "change", "z": "32c1fd5e.098ec2", "name": "zuul_active", "rules": [ { "t": "set", "p": "zuul_active", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 730, "y": 560, "wires": [ [] ] }, { "id": "f4ae387f.d10208", "type": "change", "z": "32c1fd5e.098ec2", "name": "zuul_msg_Ok", "rules": [ { "t": "set", "p": "zuul_msg", "pt": "flow", "to": "Hinein spaziert! Dein QRCode ist {0} Sekunden gültig", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 740, "y": 600, "wires": [ [] ] }, { "id": "9952b919.359a08", "type": "switch", "z": "32c1fd5e.098ec2", "name": "Set OTP Message", "property": "payload", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 510, "y": 620, "wires": [ [ "f4ae387f.d10208" ], [ "e274611f.2f38e" ] ] }, { "id": "e274611f.2f38e", "type": "change", "z": "32c1fd5e.098ec2", "name": "zuul_msg_Denied", "rules": [ { "t": "set", "p": "zuul_msg", "pt": "flow", "to": "Passt gerade nicht..", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 750, "y": 640, "wires": [ [] ] }, { "id": "58cf6248.7a406c", "type": "websocket out", "z": "32c1fd5e.098ec2", "name": "zuul", "server": "", "client": "4025a95e85247f7b", "x": 970, "y": 140, "wires": [] }, { "id": "595c27c8.759778", "type": "template", "z": "32c1fd5e.098ec2", "name": "Send Token", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "{\"type\": \"ac_tokenquery\", \"config\":{ \"token\": \"{{{payload}}}\", \"doorid\": \"1\" } }", "output": "json", "x": 730, "y": 140, "wires": [ [ "58cf6248.7a406c", "4786210e.c8c08" ] ] }, { "id": "5769967d.e270b8", "type": "mqtt out", "z": "32c1fd5e.098ec2", "name": "", "topic": "qrdoor/e661308e3728732/open", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1050, "y": 340, "wires": [] }, { "id": "a28d858a.f80338", "type": "debug", "z": "32c1fd5e.098ec2", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 510, "y": 340, "wires": [] }, { "id": "3a7fb79f.fd3da8", "type": "mqtt in", "z": "32c1fd5e.098ec2", "name": "", "topic": "qrdoor/e661308e3728732/code", "qos": "2", "datatype": "utf8", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 210, "y": 140, "wires": [ [ "595c27c8.759778", "4786210e.c8c08" ] ] }, { "id": "665b57f8.5d4768", "type": "change", "z": "32c1fd5e.098ec2", "name": "Filter Door-ID", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.config.msg.doorid", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 740, "y": 480, "wires": [ [ "6e298f59.4ff2f", "fa57583d.4a4738" ] ] }, { "id": "6e298f59.4ff2f", "type": "mqtt out", "z": "32c1fd5e.098ec2", "name": "Modem", "topic": "serial/dial", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 980, "y": 480, "wires": [] }, { "id": "fa57583d.4a4738", "type": "debug", "z": "32c1fd5e.098ec2", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 940, "y": 560, "wires": [] }, { "id": "34cec614d74bf158", "type": "change", "z": "32c1fd5e.098ec2", "name": "Set ON time", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "5", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 750, "y": 340, "wires": [ [ "5769967d.e270b8" ] ] }, { "id": "c29d994684d5fb7a", "type": "global-config", "env": [], "modules": { "node-red-contrib-alexa-smart-home": "0.4.68", "@flowfuse/node-red-dashboard": "1.26.0", "node-red-contrib-schedex": "1.10.7", "node-red-node-ping": "0.3.3", "node-red-contrib-ui-time-scheduler": "1.17.2" } } ]