[ { "id": "8ac04ff6.c9177", "type": "mqtt in", "z": "adffa1d1.469c8", "name": "Mi Button", "topic": "/home/zigbee/Button", "qos": "2", "datatype": "auto", "broker": "595dfa51.2c1224", "x": 100, "y": 180, "wires": [ [ "3a425cfa.aecc64" ] ] }, { "id": "93147768.c40168", "type": "debug", "z": "adffa1d1.469c8", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 710, "y": 300, "wires": [] }, { "id": "d5a28f99.17d5", "type": "function", "z": "adffa1d1.469c8", "name": "", "func": "var Knoten = \"Button\"\nvar Click = msg.payload.click\nvar volt = msg.payload.voltage/1000\nvar qual = msg.payload.linkquality\nvar duration = 0;\nduration = msg.payload.duration/1000\nvar bat = msg.payload.battery\n\nmsg.payload = [{\n Room: Knoten,\n Click: Click,\n Volt: volt,\n Qual: qual,\n Bat: bat\n}]\n\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Click: \" + Click + \", Qual: \" + qual + \"%, Volt: \" + volt + \"V\" + \", Duration: \" + duration +\"sec\" });\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 510, "y": 300, "wires": [ [ "93147768.c40168" ] ] }, { "id": "3a425cfa.aecc64", "type": "json", "z": "adffa1d1.469c8", "name": "", "property": "payload", "action": "", "pretty": false, "x": 330, "y": 180, "wires": [ [ "d5a28f99.17d5", "faafe038.ed117" ] ] }, { "id": "c0f9345e.722848", "type": "debug", "z": "adffa1d1.469c8", "name": "Single", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 690, "y": 40, "wires": [] }, { "id": "c4ee567c.e59908", "type": "debug", "z": "adffa1d1.469c8", "name": "Double", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 700, "y": 80, "wires": [] }, { "id": "d60bffa4.63337", "type": "debug", "z": "adffa1d1.469c8", "name": "Long Release", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 720, "y": 240, "wires": [] }, { "id": "faafe038.ed117", "type": "switch", "z": "adffa1d1.469c8", "name": "", "property": "payload.click", "propertyType": "msg", "rules": [ { "t": "eq", "v": "single", "vt": "str" }, { "t": "eq", "v": "double", "vt": "str" }, { "t": "eq", "v": "triple", "vt": "str" }, { "t": "eq", "v": "quadruple", "vt": "str" }, { "t": "eq", "v": "many", "vt": "str" }, { "t": "eq", "v": "long_release", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 6, "x": 510, "y": 140, "wires": [ [ "c0f9345e.722848" ], [ "c4ee567c.e59908" ], [ "2eb7793a.4bc9c6" ], [ "8ed3dba.e2b0328" ], [ "d45a15e4.2c2a78" ], [ "d60bffa4.63337" ] ] }, { "id": "2eb7793a.4bc9c6", "type": "debug", "z": "adffa1d1.469c8", "name": "Triple", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 690, "y": 120, "wires": [] }, { "id": "8ed3dba.e2b0328", "type": "debug", "z": "adffa1d1.469c8", "name": "Quadruple", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 710, "y": 160, "wires": [] }, { "id": "d45a15e4.2c2a78", "type": "debug", "z": "adffa1d1.469c8", "name": "Many", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 690, "y": 200, "wires": [] }, { "id": "595dfa51.2c1224", "type": "mqtt-broker", "name": "", "broker": "192.168.123.16", "port": "1883", "clientid": "", "usetls": false, "compatmode": true, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "closeTopic": "", "closePayload": "", "willTopic": "", "willQos": "0", "willPayload": "" } ]