[
{
"id": "abf1e0fe.7300d",
"type": "function",
"z": "e739a64b.fc5348",
"name": "HomeKit指令数据色温处理",
"func": "if(msg.payload.ColorTemperature !== "" && msg.payload.ColorTemperature !== undefined){\n msg.payload = parseInt(1000000 / msg.payload.ColorTemperature);\n return msg\n} ",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 440,
"y": 240,
"wires": [
[
"d5ca76.4758e588",
"658d212.a90c5e"
]
]
},
{
"id": "f9d284da.b40fd8",
"type": "SmartHome-Bot",
"z": "e739a64b.fc5348",
"d": true,
"name": "调光灯",
"account": "6a8d050f.e4f6ec",
"jsonConfig": "5983ef64.4ac27",
"deviceId": "light1-5f2fba5c48d88d63b29a0793",
"auto": false,
"x": 430,
"y": 294,
"wires": [
[],
[
"c21dd720.bb1678"
]
]
},
{
"id": "c21dd720.bb1678",
"type": "function",
"z": "e739a64b.fc5348",
"name": "小爱指令处理",
"func": "var b = context.get('b')||0;\nif(msg.payload.brightness){\n b = msg.payload.brightness;\n context.set('b',b);\n msg.payload=b\n}\n\n// Uncomment lines 9 and 20 to prevent looping\n//if (msg.hap.context !== undefined) {\n if(msg.payload.brightness === 0){\n msg.payload = 0\n }\n if(msg.payload.on === false){\n msg.payload = 0\n }\n if(msg.payload.on === true){\n msg.payload = b\n }\n return msg\n//}",
"outputs": 1,
"noerr": 0,
"x": 460,
"y": 354,
"wires": [
[
"19091ef1.cd5121",
"13a4dfe5.c6919"
]
]
},
{
"id": "6dec54ac.d848ac",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "KNX处理信息反馈",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 470,
"y": 74,
"wires": []
},
{
"id": "72f185ba.8db21c",
"type": "inject",
"z": "e739a64b.fc5348",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "false",
"payloadType": "bool",
"x": 710,
"y": 540,
"wires": [
[
"1eb611b1.73dbfe"
]
]
},
{
"id": "2e0f8462.f6a63c",
"type": "homekit-service",
"z": "e739a64b.fc5348",
"isParent": true,
"bridge": "99fc853f.2a5148",
"parentService": "",
"name": "客厅射灯",
"serviceName": "Lightbulb",
"topic": "",
"filter": false,
"manufacturer": "SMC",
"model": "射灯",
"serialNo": "10011",
"firmwareRev": "",
"hardwareRev": "",
"softwareRev": "",
"cameraConfigVideoProcessor": "",
"cameraConfigSource": "",
"cameraConfigStillImageSource": "",
"cameraConfigMaxStreams": "",
"cameraConfigMaxWidth": "",
"cameraConfigMaxHeight": "",
"cameraConfigMaxFPS": "",
"cameraConfigMaxBitrate": "",
"cameraConfigVideoCodec": "",
"cameraConfigAudioCodec": "",
"cameraConfigAudio": false,
"cameraConfigPacketSize": "",
"cameraConfigVerticalFlip": false,
"cameraConfigHorizontalFlip": false,
"cameraConfigMapVideo": "",
"cameraConfigMapAudio": "",
"cameraConfigVideoFilter": "",
"cameraConfigAdditionalCommandLine": "",
"cameraConfigDebug": false,
"cameraConfigInterfaceName": "",
"characteristicProperties": "{"Brightness":true,"ColorTemperature":{"minValue":166,"maxValue":334}}",
"waitForSetupMsg": false,
"outputs": 2,
"x": 440,
"y": 114,
"wires": [
[
"c34dbf3f.a3d36",
"abf1e0fe.7300d",
"1d2bb82f.efcd18"
],
[]
]
},
{
"id": "c34dbf3f.a3d36",
"type": "function",
"z": "e739a64b.fc5348",
"name": "HomeKit指令数据亮度处理",
"func": "var b = context.get('b')||100;\nif(msg.payload.Brightness){\n b = msg.payload.Brightness;\n context.set('b',b);\n msg.payload=b\n}\n\n// Uncomment lines 9 and 20 to prevent looping\n//if (msg.hap.context !== undefined) {\n if(msg.payload.ColorTemperature){\n return null\n }\n if(msg.payload.Brightness === 0){\n msg.payload = 0\n }\n if(msg.payload.On === false){\n msg.payload = 0\n }\n if(msg.payload.On === true){\n msg.payload = b\n } \n// if(msg.payload.On === true && b === 0){\n// msg.payload = true\n// }\n return msg\n//}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 440,
"y": 192,
"wires": [
[
"be3ffc9d.9eeab",
"19091ef1.cd5121"
]
]
},
{
"id": "54df8373.e6bdec",
"type": "function",
"z": "e739a64b.fc5348",
"name": "开关亮度状态反馈数据处理",
"func": "var input = msg.payload;\nif (input < 101){\n if (input < 1) {\n msg.payload = {\n "On": false\n }\n }\n else {\n msg.payload = {\n "Brightness": input,\n "On": true\n }\n }\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 200,
"y": 114,
"wires": [
[
"2e0f8462.f6a63c",
"6dec54ac.d848ac"
]
]
},
{
"id": "74b67dc6.d35e24",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/2/62",
"outputtopic": "Switch",
"dpt": "1.001",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "KNX-DALI开关反馈",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 190,
"y": 294,
"wires": [
[
"53b842e8.4fa0ac"
]
]
},
{
"id": "53b842e8.4fa0ac",
"type": "switch",
"z": "e739a64b.fc5348",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 130,
"y": 241,
"wires": [
[
"4946e48.2ff171c"
]
]
},
{
"id": "4946e48.2ff171c",
"type": "change",
"z": "e739a64b.fc5348",
"name": "数据转换-关",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 150,
"y": 191,
"wires": [
[
"54df8373.e6bdec"
]
]
},
{
"id": "99baa99d.93a2a8",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/4/62",
"outputtopic": "Brightness",
"dpt": "5.001",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "KNX-DALI调光反馈",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 190,
"y": 354,
"wires": [
[
"54df8373.e6bdec"
]
]
},
{
"id": "f8c0aacb.e38698",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/5/62",
"outputtopic": "ColorTemperature",
"dpt": "7.600",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "KNX-DALI色温反馈",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 190,
"y": 414,
"wires": [
[
"71f9d412.f4c5fc"
]
]
},
{
"id": "19091ef1.cd5121",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/4/2",
"outputtopic": "",
"dpt": "5.001",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "KNX-DALI调光",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 761,
"y": 193,
"wires": [
[
"5175a67d.233348",
"54df8373.e6bdec"
]
]
},
{
"id": "13a4dfe5.c6919",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "小爱信息反馈",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 740,
"y": 354,
"wires": []
},
{
"id": "1d2bb82f.efcd18",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "HOMEKIT输出信息",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 761,
"y": 74,
"wires": []
},
{
"id": "658d212.a90c5e",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/5/2",
"outputtopic": "",
"dpt": "7.600",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "KNX-DALI色温调节",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 770,
"y": 241,
"wires": [
[
"5175a67d.233348"
]
]
},
{
"id": "503b9297.41ae8c",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/5/2",
"outputtopic": "",
"dpt": "7.600",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "色温",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 860,
"y": 540,
"wires": [
[]
]
},
{
"id": "3bb5b6dc.72053a",
"type": "knxUltimateWatchDog",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/1/1",
"maxRetry": 6,
"retryInterval": 10,
"name": "KNX Watchdog",
"autoStart": true,
"checkLevel": "Ethernet",
"x": 200,
"y": 521,
"wires": [
[
"6bf82e01.8086d"
]
]
},
{
"id": "6bf82e01.8086d",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "KNX总线查看",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 440,
"y": 541,
"wires": []
},
{
"id": "5189ee04.3733d",
"type": "knxUltimateLogger",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "",
"intervalCreateETSXML": 15,
"name": "",
"autoStartTimerCreateETSXML": true,
"maxRowsInETSXML": 0,
"x": 150,
"y": 581,
"wires": [
[
"6bf82e01.8086d"
]
]
},
{
"id": "d5ca76.4758e588",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "色温homekit反馈",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 314,
"wires": []
},
{
"id": "71f9d412.f4c5fc",
"type": "function",
"z": "e739a64b.fc5348",
"name": "色温状态反馈数据处理",
"func": "var input = msg.payload;\n if(input !==""){\n\n msg.payload = {\n "ColorTemperature": input\n }\n return msg\n }",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 180,
"y": 74,
"wires": [
[
"2e0f8462.f6a63c",
"6dec54ac.d848ac"
]
]
},
{
"id": "1eb611b1.73dbfe",
"type": "knxUltimate",
"z": "e739a64b.fc5348",
"server": "dfc0eb7e.f83d28",
"topic": "1/2/2",
"outputtopic": "",
"dpt": "1.001",
"initialread": false,
"notifyreadrequest": false,
"notifyresponse": false,
"notifywrite": true,
"notifyreadrequestalsorespondtobus": false,
"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized": "0",
"listenallga": false,
"name": "KNX-DALI开关",
"outputtype": "write",
"outputRBE": true,
"inputRBE": false,
"formatmultiplyvalue": 1,
"formatnegativevalue": "leave",
"formatdecimalsvalue": 999,
"passthrough": "no",
"x": 820,
"y": 480,
"wires": [
[]
]
},
{
"id": "5175a67d.233348",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "DALI输出后反馈",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1030,
"y": 254,
"wires": []
},
{
"id": "be3ffc9d.9eeab",
"type": "debug",
"z": "e739a64b.fc5348",
"name": "HOMEKIT处理后亮度信息",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 779,
"y": 121,
"wires": []
},
{
"id": "103d8bd0.817614",
"type": "comment",
"z": "e739a64b.fc5348",
"name": "下面的功能没用",
"info": "",
"x": 760,
"y": 440,
"wires": []
},
{
"id": "a9f808f0.852b68",
"type": "comment",
"z": "e739a64b.fc5348",
"name": "下面的功能也没用",
"info": "",
"x": 246,
"y": 480,
"wires": []
},
{
"id": "6a8d050f.e4f6ec",
"type": "SmartHome-Bot-Account",
"z": "",
"name": "默认配置"
},
{
"id": "5983ef64.4ac27",
"type": "SmartHome-Bot-Config",
"z": "",
"name": "调光灯",
"jsonConfig": "{\n "2": {\n "1": "on",\n "3": "brightness",\n "4": "color"\n },\n "3": {\n "1": "battery-level",\n "3": "voltage"\n }\n}"
},
{
"id": "99fc853f.2a5148",
"type": "homekit-bridge",
"z": "",
"bridgeName": "客厅射灯",
"pinCode": "325-00-327",
"port": "",
"allowInsecureRequest": false,
"manufacturer": "NRCHKB",
"model": "1.2.0",
"serialNo": "Default Serial Number",
"firmwareRev": "1.2.0",
"hardwareRev": "1.2.0",
"softwareRev": "1.2.0",
"customMdnsConfig": false,
"mdnsMulticast": true,
"mdnsInterface": "",
"mdnsPort": "",
"mdnsIp": "",
"mdnsTtl": "",
"mdnsLoopback": true,
"mdnsReuseAddr": true,
"allowMessagePassthrough": true
},
{
"id": "dfc0eb7e.f83d28",
"type": "knxUltimate-config",
"z": "",
"host": "192.168.124.15",
"port": "3671",
"physAddr": "1.1.22",
"suppressACKRequest": false,
"csv": "",
"KNXEthInterface": "Auto",
"KNXEthInterfaceManuallyInput": "",
"statusDisplayLastUpdate": true,
"statusDisplayDeviceNameWhenALL": true,
"statusDisplayDataPoint": false,
"stopETSImportIfNoDatapoint": "stop",
"loglevel": "error",
"name": "KNX Gateway",
"localEchoInTunneling": true,
"delaybetweentelegrams": "50",
"delaybetweentelegramsfurtherdelayREAD": "1"
}
]