Skip to content

Instantly share code, notes, and snippets.

@ix9
Created August 27, 2019 11:50
Show Gist options
  • Save ix9/14c92405d46aba096c5cd3bc39296e98 to your computer and use it in GitHub Desktop.
Save ix9/14c92405d46aba096c5cd3bc39296e98 to your computer and use it in GitHub Desktop.
[
{
"id": "18679b2b.145575",
"type": "openhab2-in",
"z": "37888c90.4bd3c4",
"name": "TV Lamps",
"controller": "37b8f8b8.27a338",
"itemname": "Light_LivingTVLampsBrightness",
"x": 460,
"y": 1400,
"wires": [
[
"7f5b284f.cbb3e"
],
[]
]
},
{
"id": "b773a1fd.d3144",
"type": "homekit-service",
"z": "37888c90.4bd3c4",
"bridge": "8a51bc50.aa504",
"name": "TV Lamps",
"serviceName": "Lightbulb",
"manufacturer": "Philips",
"model": "LivingWhites",
"serialNo": "123456",
"characteristicProperties": "{}",
"x": 980,
"y": 1400,
"wires": [
[
"54a112d6.998adc",
"37ec2bff.07583c"
]
]
},
{
"id": "fdc23214.16159",
"type": "openhab2-out",
"z": "37888c90.4bd3c4",
"name": "TV Lamps",
"controller": "37b8f8b8.27a338",
"itemname": "Light_LivingTVLampsBrightness",
"topic": "ItemCommand",
"payload": "",
"x": 1400,
"y": 1400,
"wires": [
[]
]
},
{
"id": "54a112d6.998adc",
"type": "function",
"z": "37888c90.4bd3c4",
"name": "Homekit to OpenHAB",
"func": "if (msg.payload.On === false)\n{\n newstate = 0;\n}\nelse\n{\nnewstate = msg.payload.Brightness;\n}\nmsg.payload = newstate;\n\n\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 1180,
"y": 1380,
"wires": [
[
"fdc23214.16159"
]
]
},
{
"id": "7f5b284f.cbb3e",
"type": "function",
"z": "37888c90.4bd3c4",
"name": "OpenHAB to Homekit",
"func": "newstate = msg.payload;\n\n msg.payload = {\n \"Brightness\": newstate\n }\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 740,
"y": 1400,
"wires": [
[
"b773a1fd.d3144"
]
]
},
{
"id": "37b8f8b8.27a338",
"type": "openhab2-controller",
"z": "",
"name": "OPENHAB",
"protocol": "http",
"host": "localhost",
"port": "8080",
"path": "",
"username": "",
"password": ""
},
{
"id": "8a51bc50.aa504",
"type": "homekit-bridge",
"z": "",
"bridgeName": "NodeRED Bridge",
"pinCode": "111-11-111",
"port": "",
"manufacturer": "Raspberry",
"model": "OPENHAB-NodeRED",
"serialNo": "123456"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment