Inhaltsverzeichnis
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
- docker-compose.yml
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 restart: always
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.
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
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": "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, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "sessionExpiry": "" }, { "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": "b662ff46.2c09c", "type": "ui_group", "name": "Licht", "tab": "404aace1.054814", "order": 2, "disp": true, "width": "6", "collapse": false, "className": "" }, { "id": "404aace1.054814", "type": "ui_tab", "name": "Schlafzimmer", "icon": "dashboard", "order": 9, "disabled": false, "hidden": false }, { "id": "62488ee1039aeafd", "type": "ui_base", "theme": { "name": "theme-light", "lightTheme": { "default": "#0094CE", "baseColor": "#0094CE", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": true, "reset": false }, "darkTheme": { "default": "#097479", "baseColor": "#097479", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": false }, "customTheme": { "name": "Untitled Theme 1", "default": "#4B7930", "baseColor": "#4B7930", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" }, "themeState": { "base-color": { "default": "#0094CE", "value": "#0094CE", "edited": false }, "page-titlebar-backgroundColor": { "value": "#0094CE", "edited": false }, "page-backgroundColor": { "value": "#fafafa", "edited": false }, "page-sidebar-backgroundColor": { "value": "#ffffff", "edited": false }, "group-textColor": { "value": "#1bbfff", "edited": false }, "group-borderColor": { "value": "#ffffff", "edited": false }, "group-backgroundColor": { "value": "#ffffff", "edited": false }, "widget-textColor": { "value": "#111111", "edited": false }, "widget-backgroundColor": { "value": "#0094ce", "edited": false }, "widget-borderColor": { "value": "#ffffff", "edited": false }, "base-font": { "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" } }, "angularTheme": { "primary": "indigo", "accents": "blue", "warn": "red", "background": "grey", "palette": "light" } }, "site": { "name": "Node-RED Dashboard", "hideToolbar": "false", "allowSwipe": "false", "lockMenu": "false", "allowTempTheme": "true", "dateFormat": "DD.MM.YYYY", "sizes": { "sx": 48, "sy": 48, "gx": 6, "gy": 6, "cx": 6, "cy": 6, "px": 0, "py": 0 } } }, { "id": "1dca4260.7e015e", "type": "ui_group", "name": "Licht", "tab": "e83d0bb2.e3eb78", "order": 1, "disp": true, "width": "6", "collapse": false, "className": "" }, { "id": "e83d0bb2.e3eb78", "type": "ui_tab", "name": "Nathalie", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "a9cfb70686a5b88d", "type": "ui_tab", "name": "Arbeitszimmer", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "de183c81231b5247", "type": "ui_group", "name": "Licht", "tab": "a9cfb70686a5b88d", "order": 1, "disp": true, "width": "6", "collapse": false, "className": "" }, { "id": "6279881d328e02ad", "type": "ui_tab", "name": "Wohnzimmer", "icon": "dashboard", "order": 4, "disabled": false, "hidden": false }, { "id": "d42d554a5891f506", "type": "ui_group", "name": "Fernseher", "tab": "6279881d328e02ad", "order": 1, "disp": true, "width": "6", "collapse": false, "className": "" }, { "id": "515f77cb.3da748", "type": "websocket-client", "path": "ws://localhost:8000/ws/request", "tls": "", "wholemsg": "false" }, { "id": "ac726da0.2d3b3", "type": "mqtt-broker", "name": "docker mqtt", "broker": "localhost", "port": "1883", "clientid": "", "autoConnect": true, "usetls": false, "compatmode": false, "protocolVersion": 4, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "closeTopic": "", "closeQos": "0", "closePayload": "", "willTopic": "", "willQos": "0", "willPayload": "" }, { "id": "c6c2ee50.12a99", "type": "ui_group", "name": "Eingangstür", "tab": "e78f8765.5ac538", "order": 1, "disp": true, "width": "6", "collapse": false }, { "id": "e78f8765.5ac538", "type": "ui_tab", "name": "Yazaki Brake", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "9639992c42bad520", "type": "websocket-client", "path": "ws://l192.168.1.116:8000/ws/request", "tls": "", "wholemsg": "false", "hb": "0", "subprotocol": "" }, { "id": "1b8f0133cc5fc366", "type": "websocket-client", "path": "ws://zuulac:8000/ws/request", "tls": "", "wholemsg": "false", "hb": "0", "subprotocol": "" }, { "id": "4025a95e85247f7b", "type": "websocket-client", "path": "ws://zuulac:8000/", "tls": "", "wholemsg": "false", "hb": "0", "subprotocol": "" }, { "id": "c8a7fe247f48c29e", "type": "websocket-client", "path": "ws://schnipsl:8000/", "tls": "", "wholemsg": "false", "hb": "0", "subprotocol": "" }, { "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": [ [ "427d398252fc6ea6", "db71b6d178e1f608", "5f4aed668c312586" ] ] }, { "id": "f89cb08278b19366", "type": "link out", "z": "806162448d18ac14", "name": "Abends", "mode": "link", "links": [], "x": 705, "y": 120, "wires": [] }, { "id": "db71b6d178e1f608", "type": "switch", "z": "806162448d18ac14", "name": "An und Aus", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "ON", "vt": "str" }, { "t": "eq", "v": "OFF", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 550, "y": 140, "wires": [ [ "f89cb08278b19366" ], [ "c3a7a8cb9d0e9066" ] ] }, { "id": "c3a7a8cb9d0e9066", "type": "link out", "z": "806162448d18ac14", "name": "Morgens", "mode": "link", "links": [ "26cc962b9d3bfc79", "6a33b4045fa24a5c", "f2493ce1650268f2" ], "x": 705, "y": 160, "wires": [] }, { "id": "427d398252fc6ea6", "type": "link out", "z": "806162448d18ac14", "name": "Dunkelheit", "mode": "link", "links": [ "fa74251f3690f52d", "c18478380dfcc41a" ], "x": 705, "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", "39c6967ec7775363" ] ] }, { "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": "eq", "v": "ON", "vt": "str" }, { "t": "eq", "v": "OFF", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 660, "y": 280, "wires": [ [ "90a61768daa0b5f6" ], [ "2a9339433f2b2d8f" ] ] }, { "id": "90a61768daa0b5f6", "type": "link out", "z": "806162448d18ac14", "name": "Morgensonne An", "mode": "link", "links": [ "f2493ce1650268f2", "dd715b75ba033f3e" ], "x": 815, "y": 280, "wires": [] }, { "id": "2a9339433f2b2d8f", "type": "link out", "z": "806162448d18ac14", "name": "Morgensonne Aus", "mode": "link", "links": [ "6a33b4045fa24a5c", "f2493ce1650268f2" ], "x": 815, "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": 550, "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": "5f9e750d37e1cc94", "type": "conf ping", "z": "806162448d18ac14", "name": "Pixel-8", "host": "pixel-8", "timeout": "5", "requests": "1", "x": 350, "y": 520, "wires": [ [ "7a143d3ecb0f15ce", "4e2d2c2d49f4f418" ] ] }, { "id": "7a143d3ecb0f15ce", "type": "debug", "z": "806162448d18ac14", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 670, "y": 520, "wires": [] }, { "id": "4cfc5e9acaabf57f", "type": "inject", "z": "806162448d18ac14", "name": "Trigger Ping", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "10", "crontab": "", "once": false, "onceDelay": "5", "topic": "", "payload": "", "payloadType": "date", "x": 140, "y": 520, "wires": [ [ "5f9e750d37e1cc94" ] ] }, { "id": "f5c4577f9a766627", "type": "debug", "z": "806162448d18ac14", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 590, "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=0\n return msg\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=1\n return msg\n }\n}\nreturn null\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 260, "y": 220, "wires": [ [ "c3a7a8cb9d0e9066", "f5c4577f9a766627" ] ] }, { "id": "08df6f023ea8dc6b", "type": "mqtt out", "z": "d044ea01444a971e", "name": "Morgensonne", "topic": "home/sunrise1/set", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1200, "y": 460, "wires": [] }, { "id": "ca21ddd4e9b9e71e", "type": "trigger", "z": "d044ea01444a971e", "name": "off", "op1": "{\"state\":\"OFF\"}", "op2": "0", "op1type": "json", "op2type": "str", "duration": "250", "extend": false, "overrideDelay": false, "units": "ms", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 950, "y": 500, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "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": 560, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "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": 640, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "id": "dd715b75ba033f3e", "type": "link in", "z": "d044ea01444a971e", "name": "Sonnemaufgang An", "links": [ "90a61768daa0b5f6", "b812abcfda391d30" ], "x": 255, "y": 460, "wires": [ [ "b3f70f0813abc7c6" ] ] }, { "id": "6a33b4045fa24a5c", "type": "link in", "z": "d044ea01444a971e", "name": "Sonne aus", "links": [ "2a9339433f2b2d8f", "c3a7a8cb9d0e9066" ], "x": 835, "y": 500, "wires": [ [ "ca21ddd4e9b9e71e" ] ] }, { "id": "aefc43ca878864ba", "type": "mqtt in", "z": "d044ea01444a971e", "name": "", "topic": "home/sunrise1", "qos": "2", "datatype": "json", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 380, "y": 240, "wires": [ [ "e5120db2242d1916" ] ] }, { "id": "1c938c1b53dfb4ae", "type": "ui_switch", "z": "d044ea01444a971e", "name": "", "label": "Sonne", "tooltip": "", "group": "b662ff46.2c09c", "order": 16, "width": 0, "height": 0, "passthru": false, "decouple": "true", "topic": "", "topicType": "str", "style": "", "onvalue": "ON", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "OFF", "offvalueType": "str", "officon": "", "offcolor": "", "animate": true, "className": "", "x": 790, "y": 420, "wires": [ [ "b7be36446f2f8e9d" ] ] }, { "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={\"state\":msg_state};\n return msg;\n}else{\n return null;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 380, "y": 340, "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": 600, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "id": "8b4e64f3333d9e2f", "type": "ui_button", "z": "d044ea01444a971e", "name": "", "group": "b662ff46.2c09c", "order": 13, "width": 0, "height": 0, "passthru": false, "label": "Sonnenaufgang", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "{\"effect\":\"sunrise\",\"transition\":\"600\"}", "payloadType": "str", "topic": "topic", "topicType": "msg", "x": 920, "y": 700, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "id": "c4da199f1e85e4ce", "type": "ui_button", "z": "d044ea01444a971e", "name": "", "group": "b662ff46.2c09c", "order": 14, "width": 0, "height": 0, "passthru": false, "label": "Feuer", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "{\"effect\":\"fire\"}", "payloadType": "str", "topic": "topic", "topicType": "msg", "x": 950, "y": 760, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "id": "2fabfc33df7f049b", "type": "ui_button", "z": "d044ea01444a971e", "name": "", "group": "b662ff46.2c09c", "order": 15, "width": 0, "height": 0, "passthru": false, "label": "Wasser", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "{\"effect\":\"aqua\"}", "payloadType": "str", "topic": "topic", "topicType": "msg", "x": 940, "y": 820, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "id": "d3e4cb9ab0f34fdf", "type": "change", "z": "d044ea01444a971e", "name": "Switch ON", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "{\"state\":\"ON\"}", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 550, "y": 420, "wires": [ [ "1c938c1b53dfb4ae" ] ] }, { "id": "b3f70f0813abc7c6", "type": "change", "z": "d044ea01444a971e", "name": "Movie", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "{\"effect\":\"sunrise\",\"transition\":\"600\"}", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 350, "y": 460, "wires": [ [ "d3e4cb9ab0f34fdf", "08df6f023ea8dc6b" ] ] }, { "id": "74c89caddb018cce", "type": "change", "z": "d044ea01444a971e", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.state", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 590, "y": 340, "wires": [ [ "1c938c1b53dfb4ae" ] ] }, { "id": "b7be36446f2f8e9d", "type": "change", "z": "d044ea01444a971e", "name": "Msg State", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "{\"state\": payload}", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 940, "y": 420, "wires": [ [ "08df6f023ea8dc6b" ] ] }, { "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": 860, "y": 160, "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": "On", "payload": "ON", "payloadType": "str", "x": 590, "y": 160, "wires": [ [ "3ea4ffbd.61c7b" ] ] }, { "id": "af4205d9.42c1d8", "type": "inject", "z": "8e566f01.3cb7e", "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": [ [ "3ea4ffbd.61c7b" ] ] }, { "id": "13592edf.e49531", "type": "ui_switch", "z": "8e566f01.3cb7e", "name": "", "label": "Nachtlicht", "tooltip": "", "group": "1dca4260.7e015e", "order": 0, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "topicType": "str", "style": "", "onvalue": "ON", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "OFF", "offvalueType": "str", "officon": "", "offcolor": "", "animate": true, "className": "", "x": 580, "y": 100, "wires": [ [ "3ea4ffbd.61c7b" ] ] }, { "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": [ [ "13592edf.e49531" ] ] }, { "id": "fa74251f3690f52d", "type": "link in", "z": "8e566f01.3cb7e", "name": "Nachtlicht", "links": [ "427d398252fc6ea6" ], "x": 615, "y": 280, "wires": [ [ "3ea4ffbd.61c7b", "a16ab5789893380a" ] ] }, { "id": "a16ab5789893380a", "type": "debug", "z": "8e566f01.3cb7e", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 890, "y": 280, "wires": [] }, { "id": "fd35e0f9d1f37657", "type": "mqtt in", "z": "d81b425e4d857f1d", "name": "", "topic": "stat/tasmota_77CE12/POWER", "qos": "2", "datatype": "auto", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 170, "y": 120, "wires": [ [ "0a5a9ba46bd68044" ] ] }, { "id": "23e2248f994f1c94", "type": "mqtt out", "z": "d81b425e4d857f1d", "name": "", "topic": "cmnd/tasmota_77CE12/POWER", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 1190, "y": 180, "wires": [] }, { "id": "067ae418c00b5ac7", "type": "inject", "z": "d81b425e4d857f1d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "On", "payload": "1", "payloadType": "num", "x": 910, "y": 180, "wires": [ [ "23e2248f994f1c94" ] ] }, { "id": "1253680161c34dbd", "type": "inject", "z": "d81b425e4d857f1d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "Aus", "payload": "0", "payloadType": "str", "x": 910, "y": 240, "wires": [ [ "23e2248f994f1c94" ] ] }, { "id": "6f7383e97d2c25d9", "type": "ui_switch", "z": "d81b425e4d857f1d", "name": "", "label": "Vitrine", "tooltip": "", "group": "de183c81231b5247", "order": 0, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "topicType": "str", "style": "", "onvalue": "1", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "0", "offvalueType": "str", "officon": "", "offcolor": "", "animate": true, "className": "", "x": 970, "y": 80, "wires": [ [ "23e2248f994f1c94" ] ] }, { "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": 720, "y": 120, "wires": [ [ "6f7383e97d2c25d9" ] ] }, { "id": "26cc962b9d3bfc79", "type": "link in", "z": "d81b425e4d857f1d", "name": "Nachtlicht", "links": [ "2a9339433f2b2d8f", "90a61768daa0b5f6", "b812abcfda391d30", "c3a7a8cb9d0e9066" ], "x": 935, "y": 300, "wires": [ [ "23e2248f994f1c94" ] ] }, { "id": "0a5a9ba46bd68044", "type": "change", "z": "d81b425e4d857f1d", "name": "", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "1", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "0", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 450, "y": 120, "wires": [ [ "ea9b7c21cb80a28e" ] ] }, { "id": "71b11e7cd31cdd39", "type": "mqtt in", "z": "b9dc955b9fa84b3f", "name": "", "topic": "ESPURNA-CB3DC3/relay/1", "qos": "2", "datatype": "auto", "broker": "059bca2abc83dd01", "nl": false, "rap": false, "inputs": 0, "x": 160, "y": 120, "wires": [ [ "764bced2aeed5589", "43a7818120e07cb7" ] ] }, { "id": "764bced2aeed5589", "type": "debug", "z": "b9dc955b9fa84b3f", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 390, "y": 60, "wires": [] }, { "id": "64d0e733d7309e4a", "type": "mqtt out", "z": "b9dc955b9fa84b3f", "name": "", "topic": "ESPURNA-CB3DC3/relay/1/set", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "059bca2abc83dd01", "x": 870, "y": 180, "wires": [] }, { "id": "f78873543d55a1c9", "type": "inject", "z": "b9dc955b9fa84b3f", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "On", "payload": "1", "payloadType": "str", "x": 590, "y": 180, "wires": [ [ "64d0e733d7309e4a" ] ] }, { "id": "c4373aa5e7abbf09", "type": "inject", "z": "b9dc955b9fa84b3f", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "Aus", "payload": "0", "payloadType": "str", "x": 590, "y": 240, "wires": [ [ "64d0e733d7309e4a" ] ] }, { "id": "aaf13d84ae4fec07", "type": "ui_switch", "z": "b9dc955b9fa84b3f", "name": "", "label": "Nachtlicht", "tooltip": "", "group": "de183c81231b5247", "order": 0, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "topicType": "str", "style": "", "onvalue": "1", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "0", "offvalueType": "str", "officon": "", "offcolor": "", "animate": true, "className": "", "x": 580, "y": 120, "wires": [ [ "64d0e733d7309e4a" ] ] }, { "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": 400, "y": 120, "wires": [ [ "aaf13d84ae4fec07" ] ] }, { "id": "f2493ce1650268f2", "type": "link in", "z": "b9dc955b9fa84b3f", "name": "Nachtlicht", "links": [ "2a9339433f2b2d8f", "90a61768daa0b5f6", "b812abcfda391d30", "c3a7a8cb9d0e9066" ], "x": 615, "y": 300, "wires": [ [ "64d0e733d7309e4a" ] ] }, { "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": "3843c6acb30bccdf", "type": "ui_switch", "z": "a835cf98310dcb70", "name": "", "label": "SatIP Receiver", "tooltip": "", "group": "d42d554a5891f506", "order": 0, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "topicType": "str", "style": "", "onvalue": "ON", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "OFF", "offvalueType": "str", "officon": "", "offcolor": "", "animate": true, "className": "", "x": 580, "y": 100, "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": [ [ "3843c6acb30bccdf" ] ] }, { "id": "f788f61c153d70b3", "type": "ui_time_scheduler", "z": "128b9e6ffb5a44da", "group": "b662ff46.2c09c", "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" ] ] } ]