|
[ |
|
{ |
|
"id": "cccc2a50.dc1d98", |
|
"type": "mqtt in", |
|
"z": "4d2d578e.6cea28", |
|
"name": "bureaulamp", |
|
"topic": "server/stat/bureaulamp/RESULT", |
|
"qos": "0", |
|
"datatype": "auto", |
|
"broker": "707b233c.d0ad2c", |
|
"x": 150, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"1313e7b8.7cad58" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "849705a5.16c0b", |
|
"type": "function", |
|
"z": "4d2d578e.6cea28", |
|
"name": "mqtt 2 homekit", |
|
"func": "// delete topic to prevent loop\nif (msg.payload.POWER == \"ON\"){\n msg.payload = {\n \"On\": 1\n }\n}else{\n msg.payload = {\n \"On\": 0\n }\n}\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"x": 560, |
|
"y": 540, |
|
"wires": [ |
|
[ |
|
"2ca327b4.382a28" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "8b289149.f7a3c", |
|
"type": "function", |
|
"z": "4d2d578e.6cea28", |
|
"name": "prepare switch", |
|
"func": "if (msg.payload.POWER == \"ON\"){\n msg.payload = true\n}else{\n msg.payload = false\n}\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"x": 560, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"c13bd0bf.3eb018" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "32328423.dc283c", |
|
"type": "function", |
|
"z": "4d2d578e.6cea28", |
|
"name": "homekit 2 mqtt", |
|
"func": "// vars\nif(msg.payload.On){\n msg.payload = true\n}else{\n msg.payload = false\n}\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"x": 940, |
|
"y": 540, |
|
"wires": [ |
|
[ |
|
"e1c12735.825cb8" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "c13bd0bf.3eb018", |
|
"type": "ui_switch", |
|
"z": "4d2d578e.6cea28", |
|
"name": "", |
|
"label": "Bureaulamp", |
|
"tooltip": "", |
|
"group": "efa9c015.d79758", |
|
"order": 5, |
|
"width": 0, |
|
"height": 0, |
|
"passthru": false, |
|
"decouple": "true", |
|
"topic": "server/cmnd/bureaulamp/POWER", |
|
"style": "", |
|
"onvalue": "true", |
|
"onvalueType": "bool", |
|
"onicon": "", |
|
"oncolor": "", |
|
"offvalue": "false", |
|
"offvalueType": "bool", |
|
"officon": "", |
|
"offcolor": "", |
|
"x": 750, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"f0f75ebd.c55388" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "1313e7b8.7cad58", |
|
"type": "json", |
|
"z": "4d2d578e.6cea28", |
|
"name": "", |
|
"property": "payload", |
|
"action": "", |
|
"pretty": false, |
|
"x": 310, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"26bf9763.22444" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "f0f75ebd.c55388", |
|
"type": "mqtt out", |
|
"z": "4d2d578e.6cea28", |
|
"name": "", |
|
"topic": "", |
|
"qos": "", |
|
"retain": "", |
|
"broker": "707b233c.d0ad2c", |
|
"x": 1110, |
|
"y": 480, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "2ca327b4.382a28", |
|
"type": "homekit-service", |
|
"z": "4d2d578e.6cea28", |
|
"isParent": true, |
|
"bridge": "93e1fd.7adf2e", |
|
"parentService": "", |
|
"name": "Bureaulamp", |
|
"serviceName": "Lightbulb", |
|
"topic": "", |
|
"filter": false, |
|
"manufacturer": "Default Manufacturer", |
|
"model": "Default Model", |
|
"serialNo": "Default Serial Number", |
|
"cameraConfigVideoProcessor": "ffmpeg", |
|
"cameraConfigSource": "", |
|
"cameraConfigStillImageSource": "", |
|
"cameraConfigMaxStreams": 2, |
|
"cameraConfigMaxWidth": 1280, |
|
"cameraConfigMaxHeight": 720, |
|
"cameraConfigMaxFPS": 10, |
|
"cameraConfigMaxBitrate": 300, |
|
"cameraConfigVideoCodec": "libx264", |
|
"cameraConfigAudioCodec": "libfdk_aac", |
|
"cameraConfigAudio": false, |
|
"cameraConfigPacketSize": 1316, |
|
"cameraConfigVerticalFlip": false, |
|
"cameraConfigHorizontalFlip": false, |
|
"cameraConfigMapVideo": "0:0", |
|
"cameraConfigMapAudio": "0:1", |
|
"cameraConfigVideoFilter": "scale=1280:720", |
|
"cameraConfigAdditionalCommandLine": "-tune zerolatency", |
|
"cameraConfigDebug": false, |
|
"cameraConfigSnapshotOutput": "disabled", |
|
"cameraConfigInterfaceName": "", |
|
"characteristicProperties": "{}", |
|
"x": 750, |
|
"y": 540, |
|
"wires": [ |
|
[ |
|
"32328423.dc283c" |
|
], |
|
[] |
|
] |
|
}, |
|
{ |
|
"id": "e1c12735.825cb8", |
|
"type": "mqtt out", |
|
"z": "4d2d578e.6cea28", |
|
"name": "", |
|
"topic": "", |
|
"qos": "", |
|
"retain": "", |
|
"broker": "707b233c.d0ad2c", |
|
"x": 1110, |
|
"y": 540, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "26bf9763.22444", |
|
"type": "function", |
|
"z": "4d2d578e.6cea28", |
|
"name": "∞", |
|
"func": "// fix repeated messages\nlet millisecondsBetweenMessages = 300;\nlet previousTime=context.get('time') || 0;\nlet currentTime=Math.round(Date.now());\nlet timeDifference=currentTime-previousTime;\n\n// set variable for next round\ncontext.set('time', currentTime);\n\nif (timeDifference < millisecondsBetweenMessages){\n node.warn('To fast: '+timeDifference+'ms');\n msg = null; // stop msg from sending\n}\n\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"x": 415, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"8b289149.f7a3c", |
|
"849705a5.16c0b" |
|
] |
|
], |
|
"icon": "node-red/timer.svg", |
|
"l": false |
|
}, |
|
{ |
|
"id": "707b233c.d0ad2c", |
|
"type": "mqtt-broker", |
|
"z": "", |
|
"name": "serverPi", |
|
"broker": "localhost", |
|
"port": "1883", |
|
"clientid": "", |
|
"usetls": false, |
|
"compatmode": false, |
|
"keepalive": "60", |
|
"cleansession": true, |
|
"birthTopic": "", |
|
"birthQos": "0", |
|
"birthRetain": "false", |
|
"birthPayload": "", |
|
"closeTopic": "", |
|
"closeQos": "0", |
|
"closeRetain": "false", |
|
"closePayload": "", |
|
"willTopic": "", |
|
"willQos": "0", |
|
"willRetain": "false", |
|
"willPayload": "" |
|
}, |
|
{ |
|
"id": "efa9c015.d79758", |
|
"type": "ui_group", |
|
"z": "", |
|
"name": "Woonkamer", |
|
"tab": "f529ddcc.a47f8", |
|
"order": 1, |
|
"disp": true, |
|
"width": "6", |
|
"collapse": false |
|
}, |
|
{ |
|
"id": "93e1fd.7adf2e", |
|
"type": "homekit-bridge", |
|
"z": "", |
|
"bridgeName": "server Home", |
|
"pinCode": "111-11-111", |
|
"port": "", |
|
"allowInsecureRequest": false, |
|
"manufacturer": "server", |
|
"model": "Model", |
|
"serialNo": "Serial Number", |
|
"customMdnsConfig": false, |
|
"mdnsMulticast": true, |
|
"mdnsInterface": "", |
|
"mdnsPort": "", |
|
"mdnsIp": "", |
|
"mdnsTtl": "", |
|
"mdnsLoopback": true, |
|
"mdnsReuseAddr": true, |
|
"allowMessagePassthrough": true |
|
}, |
|
{ |
|
"id": "f529ddcc.a47f8", |
|
"type": "ui_tab", |
|
"z": "", |
|
"name": "Lichten", |
|
"icon": "dashboard", |
|
"order": 1, |
|
"disabled": false, |
|
"hidden": false |
|
} |
|
] |