Skip to content

Instantly share code, notes, and snippets.

@oliverrahner
Created May 12, 2018 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliverrahner/d5b2fa6e4456cd8c3858dc30b73bce2e to your computer and use it in GitHub Desktop.
Save oliverrahner/d5b2fa6e4456cd8c3858dc30b73bce2e to your computer and use it in GitHub Desktop.
node-red flow for homekit with lights and window coverings
[
{
"id":"61e77a.fcbc8088",
"type":"tab",
"label":"Flow 1",
"disabled":false,
"info":""
},
{
"id":"3fa4c9db.c6a2ce",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_AZ_Rollladen",
"x":130,
"y":40,
"wires":[
[
"68aefc99.f3e3f4"
],
[
]
]
},
{
"id":"6a552f92.2e919",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_AZ_Rollladen",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":40,
"wires":[
]
},
{
"id":"436b4fcd.5b6eb8",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_AZ_Licht",
"x":110,
"y":840,
"wires":[
[
"a59948f0.5da8d8"
],
[
]
]
},
{
"id":"a59948f0.5da8d8",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":840,
"wires":[
[
"28879b9f.9337cc"
]
]
},
{
"id":"9003ba59.1ca94",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_AZ_Licht",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":840,
"wires":[
]
},
{
"id":"68aefc99.f3e3f4",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":40,
"wires":[
[
"c046eefb.ec2c8"
]
]
},
{
"id":"c046eefb.ec2c8",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Arbeitszimmer",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":40,
"wires":[
[
"3f697313.3e402c"
]
]
},
{
"id":"3f697313.3e402c",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":40,
"wires":[
[
"6a552f92.2e919"
]
]
},
{
"id":"28879b9f.9337cc",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Arbeitszimmer",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":650,
"y":840,
"wires":[
[
"cf4f0a2e.69a06"
]
]
},
{
"id":"cf4f0a2e.69a06",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":840,
"wires":[
[
"9003ba59.1ca94"
]
]
},
{
"id":"6cc63923.973ce8",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_KU_Rollladen",
"x":130,
"y":100,
"wires":[
[
"66de578b.87971"
],
[
]
]
},
{
"id":"64edd530.b46b84",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_KU_Rollladen",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":100,
"wires":[
]
},
{
"id":"66de578b.87971",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":100,
"wires":[
[
"9a0f7e34.029fa"
]
]
},
{
"id":"9a0f7e34.029fa",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Küche",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":640,
"y":100,
"wires":[
[
"eca5ed97.46867"
]
]
},
{
"id":"eca5ed97.46867",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":100,
"wires":[
[
"64edd530.b46b84"
]
]
},
{
"id":"ee6f7925.94a82",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_1",
"x":140,
"y":160,
"wires":[
[
"e01ed094.61a5e"
],
[
]
]
},
{
"id":"4bdda64a.75dcf",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_1",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":160,
"wires":[
]
},
{
"id":"e01ed094.61a5e",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":160,
"wires":[
[
"bfbf54b7.8375f"
]
]
},
{
"id":"bfbf54b7.8375f",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Wohnzimmer 1",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":160,
"wires":[
[
"1126c4ac.06091b"
]
]
},
{
"id":"1126c4ac.06091b",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":160,
"wires":[
[
"4bdda64a.75dcf"
]
]
},
{
"id":"94df52ec.00d5f",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_2",
"x":140,
"y":220,
"wires":[
[
"2d62fd09.9fd4ba"
],
[
]
]
},
{
"id":"b7e78840.ef85e8",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_2",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":220,
"wires":[
]
},
{
"id":"2d62fd09.9fd4ba",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":220,
"wires":[
[
"55b52f4e.5fdb4"
]
]
},
{
"id":"55b52f4e.5fdb4",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Wohnzimmer 2",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":220,
"wires":[
[
"b1034c51.53fc58"
]
]
},
{
"id":"b1034c51.53fc58",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":220,
"wires":[
[
"b7e78840.ef85e8"
]
]
},
{
"id":"1150fdf8.72b002",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_3",
"x":140,
"y":280,
"wires":[
[
"28aa7f8.d4a078"
],
[
]
]
},
{
"id":"1a2a4ce0.7a39a3",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_3",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":280,
"wires":[
]
},
{
"id":"28aa7f8.d4a078",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":280,
"wires":[
[
"77cc82c3.d6e1cc"
]
]
},
{
"id":"77cc82c3.d6e1cc",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Wohnzimmer 3",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":280,
"wires":[
[
"774aa934.e98098"
]
]
},
{
"id":"774aa934.e98098",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":280,
"wires":[
[
"1a2a4ce0.7a39a3"
]
]
},
{
"id":"9f405348.aa876",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_4",
"x":140,
"y":340,
"wires":[
[
"831352bb.04434"
],
[
]
]
},
{
"id":"8b90682f.0dc538",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_4",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":340,
"wires":[
]
},
{
"id":"831352bb.04434",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":340,
"wires":[
[
"efd4517.cc9193"
]
]
},
{
"id":"efd4517.cc9193",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Wohnzimmer 4",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":340,
"wires":[
[
"cf1010c5.6bcfb"
]
]
},
{
"id":"cf1010c5.6bcfb",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":340,
"wires":[
[
"8b90682f.0dc538"
]
]
},
{
"id":"32b8dc58.20d69c",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_5",
"x":140,
"y":400,
"wires":[
[
"f888e128.296bb8"
],
[
]
]
},
{
"id":"8682ff6d.d94c08",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Rollladen_5",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":400,
"wires":[
]
},
{
"id":"f888e128.296bb8",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":400,
"wires":[
[
"a884b227.bdd4f"
]
]
},
{
"id":"a884b227.bdd4f",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Wohnzimmer 5",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":400,
"wires":[
[
"d495353.77fadc8"
]
]
},
{
"id":"d495353.77fadc8",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":400,
"wires":[
[
"8682ff6d.d94c08"
]
]
},
{
"id":"74e22340.0b6594",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_GA_Rollladen",
"x":130,
"y":460,
"wires":[
[
"aaf0182f.df2158"
],
[
]
]
},
{
"id":"bfaf5b65.eb1fc8",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_GA_Rollladen",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":460,
"wires":[
]
},
{
"id":"aaf0182f.df2158",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":460,
"wires":[
[
"9dc43ea3.8ee638"
]
]
},
{
"id":"9dc43ea3.8ee638",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Gästezimmer",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":460,
"wires":[
[
"1d1564ea.910a3b"
]
]
},
{
"id":"1d1564ea.910a3b",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":460,
"wires":[
[
"bfaf5b65.eb1fc8"
]
]
},
{
"id":"ee83f11b.1ca8f8",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_JU_Rollladen",
"x":130,
"y":520,
"wires":[
[
"d1624c72.7f3368"
],
[
]
]
},
{
"id":"42c0251d.8cbd8c",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_JU_Rollladen",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":520,
"wires":[
]
},
{
"id":"d1624c72.7f3368",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":520,
"wires":[
[
"c834088.0e2de78"
]
]
},
{
"id":"c834088.0e2de78",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Kind 1",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":640,
"y":520,
"wires":[
[
"efe0377b.ef1368"
]
]
},
{
"id":"efe0377b.ef1368",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":520,
"wires":[
[
"42c0251d.8cbd8c"
]
]
},
{
"id":"6e45889f.36eef8",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_MA_Rollladen",
"x":130,
"y":580,
"wires":[
[
"dd23e093.7b8508"
],
[
]
]
},
{
"id":"de8300af.600a6",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_MA_Rollladen",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":580,
"wires":[
]
},
{
"id":"dd23e093.7b8508",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":580,
"wires":[
[
"673fffaa.d7b0f"
]
]
},
{
"id":"673fffaa.d7b0f",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Kind2",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":640,
"y":580,
"wires":[
[
"303c95c0.ff04f2"
]
]
},
{
"id":"303c95c0.ff04f2",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":580,
"wires":[
[
"de8300af.600a6"
]
]
},
{
"id":"92976fd2.9f7e58",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_SZ_Rollladen_1",
"x":130,
"y":640,
"wires":[
[
"98ffd843.5bb558"
],
[
]
]
},
{
"id":"42963336.d49d5c",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_SZ_Rollladen_1",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":640,
"wires":[
]
},
{
"id":"98ffd843.5bb558",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":640,
"wires":[
[
"e8bf2ce1.7e0b5"
]
]
},
{
"id":"e8bf2ce1.7e0b5",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Schlafzimmer 1",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":640,
"wires":[
[
"2c86a454.30f3b4"
]
]
},
{
"id":"2c86a454.30f3b4",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":640,
"wires":[
[
"42963336.d49d5c"
]
]
},
{
"id":"f321e31a.f358f",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_SZ_Rollladen_2",
"x":130,
"y":700,
"wires":[
[
"2dfa7a0e.feabf6"
],
[
]
]
},
{
"id":"8f04fcff.0f1c4",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_SZ_Rollladen_2",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":700,
"wires":[
]
},
{
"id":"2dfa7a0e.feabf6",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering To Homekit",
"func":"var pos = 100 - msg.payload;\nif (pos <= 2) { pos = 0 }\nif (pos >= 98) { pos = 100 }\n\nmsg.payload = \n{\n \"CurrentPosition\": pos,\n \"TargetPosition\": pos,\n \"PositionState\": 2\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":360,
"y":700,
"wires":[
[
"2036fd0e.05417a"
]
]
},
{
"id":"2036fd0e.05417a",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Rollladen Schlafzimmer 2",
"serviceName":"WindowCovering",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":700,
"wires":[
[
"27fdc4b4.4ceae4"
]
]
},
{
"id":"27fdc4b4.4ceae4",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"WindowCovering From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nif (typeof msg.payload.TargetPosition !== 'undefined')\n{\n msg.payload = 100 - msg.payload.TargetPosition;\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":970,
"y":700,
"wires":[
[
"8f04fcff.0f1c4"
]
]
},
{
"id":"53b7854e.fc4884",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Licht_Couchtisch",
"x":150,
"y":900,
"wires":[
[
"5cb57493.1b0fa4"
],
[
]
]
},
{
"id":"5cb57493.1b0fa4",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":900,
"wires":[
[
"e92d2a96.ecb088"
]
]
},
{
"id":"6e9e7405.0a468c",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Licht_Couchtisch",
"topic":"ItemCommand",
"payload":"",
"x":1280,
"y":900,
"wires":[
]
},
{
"id":"e92d2a96.ecb088",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Wohnzimmer Couchtisch",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":690,
"y":900,
"wires":[
[
"7b81ec5d.020774"
]
]
},
{
"id":"7b81ec5d.020774",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":900,
"wires":[
[
"6e9e7405.0a468c"
]
]
},
{
"id":"3f058a94.5d2696",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Licht_Esstisch",
"x":140,
"y":960,
"wires":[
[
"131f0435.67be5c"
],
[
]
]
},
{
"id":"131f0435.67be5c",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":960,
"wires":[
[
"971a0a25.194ff"
]
]
},
{
"id":"8f701115.7cbe48",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Licht_Esstisch",
"topic":"ItemCommand",
"payload":"",
"x":1270,
"y":960,
"wires":[
]
},
{
"id":"971a0a25.194ff",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Wohnzimmer Esstisch",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":680,
"y":960,
"wires":[
[
"85621ac2.524b58"
]
]
},
{
"id":"85621ac2.524b58",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":960,
"wires":[
[
"8f701115.7cbe48"
]
]
},
{
"id":"e3e473d0.cda99",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Licht_Wand",
"x":140,
"y":1020,
"wires":[
[
"3f54987e.2f2ed"
],
[
]
]
},
{
"id":"3f54987e.2f2ed",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":1020,
"wires":[
[
"7390dae7.fa8dac"
]
]
},
{
"id":"f4594786.241978",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"EG_WZ_Licht_Wand",
"topic":"ItemCommand",
"payload":"",
"x":1260,
"y":1020,
"wires":[
]
},
{
"id":"7390dae7.fa8dac",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Wohnzimmer Wand",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":670,
"y":1020,
"wires":[
[
"a116ee37.98c94"
]
]
},
{
"id":"a116ee37.98c94",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":1020,
"wires":[
[
"f4594786.241978"
]
]
},
{
"id":"a4219a9f.7a1658",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_GA_Licht",
"x":110,
"y":1080,
"wires":[
[
"5d413365.9edd54"
],
[
]
]
},
{
"id":"5d413365.9edd54",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":1080,
"wires":[
[
"184fa2cd.f1f165"
]
]
},
{
"id":"e6fe7cbe.6eece",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_GA_Licht",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":1080,
"wires":[
]
},
{
"id":"184fa2cd.f1f165",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Gästezimmer",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":650,
"y":1080,
"wires":[
[
"fd3b463.7193f38"
]
]
},
{
"id":"fd3b463.7193f38",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":1080,
"wires":[
[
"e6fe7cbe.6eece"
]
]
},
{
"id":"6e2b0849.5e1aa",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_JU_Licht",
"x":110,
"y":1140,
"wires":[
[
"9d9430d.6ef18d"
],
[
]
]
},
{
"id":"9d9430d.6ef18d",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":1140,
"wires":[
[
"2e09cdef.335712"
]
]
},
{
"id":"bd5eadd5.10edb",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_JU_Licht",
"topic":"ItemCommand",
"payload":"",
"x":1230,
"y":1140,
"wires":[
]
},
{
"id":"2e09cdef.335712",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Kind 1",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":620,
"y":1140,
"wires":[
[
"4724ea12.0677c4"
]
]
},
{
"id":"4724ea12.0677c4",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":1140,
"wires":[
[
"bd5eadd5.10edb"
]
]
},
{
"id":"6236ec1.df0e694",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_MA_Licht",
"x":110,
"y":1200,
"wires":[
[
"4fa7a7c7.51023"
],
[
]
]
},
{
"id":"4fa7a7c7.51023",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":1200,
"wires":[
[
"8544ffbc.3425a8"
]
]
},
{
"id":"2dd74602.19e0da",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_MA_Licht",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":1200,
"wires":[
]
},
{
"id":"8544ffbc.3425a8",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Kind2",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":630,
"y":1200,
"wires":[
[
"59f93e3f.70d2b8"
]
]
},
{
"id":"59f93e3f.70d2b8",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":1200,
"wires":[
[
"2dd74602.19e0da"
]
]
},
{
"id":"f51caa6d.c5ad4",
"type":"openhab2-in",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_SZ_Licht",
"x":110,
"y":1260,
"wires":[
[
"bdad64bb.6beeb8"
],
[
]
]
},
{
"id":"bdad64bb.6beeb8",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light To Homekit",
"func":"var bright = msg.payload;\n\nmsg.payload = {};\nmsg.payload.Brightness = bright;\nif (bright > 0)\n{\n msg.payload.On = true;\n} else {\n msg.payload.On = false;\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"x":370,
"y":1260,
"wires":[
[
"aa56738d.83b2"
]
]
},
{
"id":"cfa67c9.9b3698",
"type":"openhab2-out",
"z":"61e77a.fcbc8088",
"name":"",
"controller":"6aea838d.42c1f4",
"itemname":"OG_SZ_Licht",
"topic":"ItemCommand",
"payload":"",
"x":1240,
"y":1260,
"wires":[
]
},
{
"id":"aa56738d.83b2",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"3e828778.3dc658",
"name":"Licht Schlafzimmerr",
"serviceName":"Lightbulb",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":650,
"y":1260,
"wires":[
[
"32e98896.f1adc8"
]
]
},
{
"id":"32e98896.f1adc8",
"type":"function",
"z":"61e77a.fcbc8088",
"name":"Light From Homekit",
"func":"// filter events which did not originate in HomeKit\nif (msg.hap.context === undefined )\n{\n return null;\n}\n\nvar brightness;\nif (typeof msg.payload.Brightness !== 'undefined')\n{\n msg.payload = msg.payload.Brightness;\n return msg;\n}\nelse if (typeof msg.payload.On !== 'undefined')\n{\n if (msg.payload.On)\n {\n msg.payload = 100;\n } else if (!msg.payload.On) {\n msg.payload = 0;\n }\n return msg;\n}\nelse {\n return null;\n}\n",
"outputs":1,
"noerr":0,
"x":910,
"y":1260,
"wires":[
[
"cfa67c9.9b3698"
]
]
},
{
"id":"7ad1f777.a68f1",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"47a4c2a.c2694bc",
"name":"Test-Switch",
"serviceName":"Switch",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":290,
"y":1400,
"wires":[
[
]
]
},
{
"id":"b640990b.5739d",
"type":"homekit-service",
"z":"61e77a.fcbc8088",
"bridge":"47a4c2a.c2694bc",
"name":"Test-Switch-2",
"serviceName":"Switch",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number",
"characteristicProperties":"{}",
"x":440,
"y":1420,
"wires":[
[
]
]
},
{
"id":"6aea838d.42c1f4",
"type":"openhab2-controller",
"z":"",
"name":"openhab2",
"protocol":"http",
"host":"localhost",
"port":"8080",
"path":"",
"username":"",
"password":""
},
{
"id":"3e828778.3dc658",
"type":"homekit-bridge",
"z":"",
"bridgeName":"OpenHAB",
"pinCode":"111-11-111",
"port":"",
"manufacturer":"OpenHABian",
"model":"NodeRED",
"serialNo":"1234"
},
{
"id":"47a4c2a.c2694bc",
"type":"homekit-bridge",
"z":"",
"bridgeName":"Test-Bridge-2",
"pinCode":"222-22-222",
"port":"",
"manufacturer":"Default Manufacturer",
"model":"Default Model",
"serialNo":"Default Serial Number"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment