刚开始玩NR,分享一个转换人体存在传感器到homekit可识别的流

image
做了一个简单的替换

[
{
“id”: “367141d342080d9e”,
“type”: “tab”,
“label”: “流程 1”,
“disabled”: false,
“info”: “”,
“env”: []
},
{
“id”: “c50136c669bf9f7e”,
“type”: “group”,
“z”: “367141d342080d9e”,
“style”: {
“stroke”: “#999999”,
“stroke-opacity”: “1”,
“fill”: “none”,
“fill-opacity”: “1”,
“label”: true,
“label-position”: “nw”,
“color”: “#a4a4a4
},
“nodes”: [
“22f71a78568bb76d”,
“ecf632d4ebfd7969”,
“28f1f3a1511dbe22”,
“94fc4b8510bad2f2”,
“b3a56860f3bff2be”,
“e7a69e99be9660fd”,
“0421da9e0d6b60a0”,
“6f26e84e5e2ea91b”,
“77e42bde542db8de”,
“704d05b7bdbbd7bb”,
“a38c079e6f1f308b”
],
“x”: 74,
“y”: 119,
“w”: 972,
“h”: 242
},
{
“id”: “22f71a78568bb76d”,
“type”: “ha-binary-sensor”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “虚拟客厅体感”,
“entityConfig”: “dc7e1ddd45d5e844”,
“version”: 0,
“state”: “payload”,
“stateType”: “msg”,
“attributes”: [],
“inputOverride”: “allow”,
“outputProperties”: [
{
“property”: “payload”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “data”
}
],
“x”: 620,
“y”: 160,
“wires”: [
[
“28f1f3a1511dbe22”
]
]
},
{
“id”: “ecf632d4ebfd7969”,
“type”: “change”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “someone exists”,
“fromt”: “str”,
“to”: “on”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “no one exists”,
“fromt”: “str”,
“to”: “off”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “data”,
“pt”: “msg”,
“from”: “someone exists”,
“fromt”: “str”,
“to”: “on”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “data”,
“pt”: “msg”,
“from”: “no one exists”,
“fromt”: “str”,
“to”: “off”,
“tot”: “str”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 400,
“y”: 240,
“wires”: [
[
“77e42bde542db8de”
]
]
},
{
“id”: “28f1f3a1511dbe22”,
“type”: “debug”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “感应器转换状态”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “true”,
“targetType”: “full”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 920,
“y”: 240,
“wires”: []
},
{
“id”: “94fc4b8510bad2f2”,
“type”: “server-state-changed”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “卫生间体感状态”,
“server”: “”,
“version”: 5,
“outputs”: 1,
“exposeAsEntityConfig”: “”,
“entityIdType”: “exact”,
“outputInitially”: false,
“stateType”: “str”,
“ifState”: “”,
“ifStateType”: “str”,
“ifStateOperator”: “is”,
“outputOnlyOnStateChange”: false,
“for”: “0”,
“forType”: “num”,
“forUnits”: “minutes”,
“ignorePrevStateNull”: false,
“ignorePrevStateUnknown”: false,
“ignorePrevStateUnavailable”: false,
“ignoreCurrentStateUnknown”: false,
“ignoreCurrentStateUnavailable”: false,
“outputProperties”: [
{
“property”: “payload”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “entityState”
},
{
“property”: “data”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “eventData”
}
],
“x”: 180,
“y”: 240,
“wires”: [
[
“ecf632d4ebfd7969”
]
]
},
{
“id”: “b3a56860f3bff2be”,
“type”: “server-state-changed”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “客厅体感状态”,
“server”: “3713ee69f03349f5”,
“version”: 5,
“outputs”: 1,
“exposeAsEntityConfig”: “”,
“entityId”: “”,
“entityIdType”: “exact”,
“outputInitially”: false,
“stateType”: “str”,
“ifState”: “”,
“ifStateType”: “str”,
“ifStateOperator”: “is”,
“outputOnlyOnStateChange”: false,
“for”: “0”,
“forType”: “num”,
“forUnits”: “minutes”,
“ignorePrevStateNull”: false,
“ignorePrevStateUnknown”: false,
“ignorePrevStateUnavailable”: false,
“ignoreCurrentStateUnknown”: false,
“ignoreCurrentStateUnavailable”: false,
“outputProperties”: [
{
“property”: “payload”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “entityState”
},
{
“property”: “data”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “eventData”
}
],
“x”: 170,
“y”: 160,
“wires”: [
[
“a38c079e6f1f308b”
]
]
},
{
“id”: “e7a69e99be9660fd”,
“type”: “ha-binary-sensor”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “虚拟卧室体感”,
“entityConfig”: “0141673b77934954”,
“version”: 0,
“state”: “payload”,
“stateType”: “msg”,
“attributes”: [],
“inputOverride”: “allow”,
“outputProperties”: [
{
“property”: “payload”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “data”
}
],
“x”: 620,
“y”: 320,
“wires”: [
[
“28f1f3a1511dbe22”
]
]
},
{
“id”: “0421da9e0d6b60a0”,
“type”: “change”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “someone exists”,
“fromt”: “str”,
“to”: “on”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “no one exists”,
“fromt”: “str”,
“to”: “off”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “data”,
“pt”: “msg”,
“from”: “someone exists”,
“fromt”: “str”,
“to”: “on”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “data”,
“pt”: “msg”,
“from”: “no one exists”,
“fromt”: “str”,
“to”: “off”,
“tot”: “str”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 400,
“y”: 320,
“wires”: [
[
“e7a69e99be9660fd”
]
]
},
{
“id”: “6f26e84e5e2ea91b”,
“type”: “server-state-changed”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “卧室体感状态”,
“server”: “”,
“version”: 5,
“outputs”: 1,
“exposeAsEntityConfig”: “”,
“entityIdType”: “exact”,
“outputInitially”: false,
“stateType”: “str”,
“ifState”: “”,
“ifStateType”: “str”,
“ifStateOperator”: “is”,
“outputOnlyOnStateChange”: false,
“for”: “0”,
“forType”: “num”,
“forUnits”: “minutes”,
“ignorePrevStateNull”: false,
“ignorePrevStateUnknown”: false,
“ignorePrevStateUnavailable”: false,
“ignoreCurrentStateUnknown”: false,
“ignoreCurrentStateUnavailable”: false,
“outputProperties”: [
{
“property”: “payload”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “entityState”
},
{
“property”: “data”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “eventData”
}
],
“x”: 170,
“y”: 320,
“wires”: [
[
“0421da9e0d6b60a0”
]
]
},
{
“id”: “77e42bde542db8de”,
“type”: “ha-binary-sensor”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “虚拟卫生间体感”,
“entityConfig”: “6140214c77b432f7”,
“version”: 0,
“state”: “payload”,
“stateType”: “msg”,
“attributes”: [],
“inputOverride”: “allow”,
“outputProperties”: [
{
“property”: “payload”,
“propertyType”: “msg”,
“value”: “”,
“valueType”: “data”
}
],
“x”: 620,
“y”: 240,
“wires”: [
[
“28f1f3a1511dbe22”
]
]
},
{
“id”: “704d05b7bdbbd7bb”,
“type”: “comment”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “转换为homekit可识别”,
“info”: “”,
“x”: 900,
“y”: 160,
“wires”: []
},
{
“id”: “a38c079e6f1f308b”,
“type”: “change”,
“z”: “367141d342080d9e”,
“g”: “c50136c669bf9f7e”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “someone”,
“fromt”: “str”,
“to”: “on”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “no one”,
“fromt”: “str”,
“to”: “off”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “data”,
“pt”: “msg”,
“from”: “someone”,
“fromt”: “str”,
“to”: “on”,
“tot”: “str”
},
{
“t”: “change”,
“p”: “data”,
“pt”: “msg”,
“from”: “no one”,
“fromt”: “str”,
“to”: “off”,
“tot”: “str”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 400,
“y”: 160,
“wires”: [
[
“22f71a78568bb76d”
]
]
},
{
“id”: “dc7e1ddd45d5e844”,
“type”: “ha-entity-config”,
“server”: “3713ee69f03349f5”,
“deviceConfig”: “e17414398f8343d9”,
“name”: “转换客厅存在”,
“version”: “6”,
“entityType”: “binary_sensor”,
“haConfig”: [
{
“property”: “name”,
“value”: “转换客厅存在”
},
{
“property”: “icon”,
“value”: “”
},
{
“property”: “entity_picture”,
“value”: “”
},
{
“property”: “entity_category”,
“value”: “”
},
{
“property”: “device_class”,
“value”: “motion”
}
],
“resend”: true,
“debugEnabled”: false
},
{
“id”: “3713ee69f03349f5”,
“type”: “server”,
“name”: “home”,
“version”: 5,
“addon”: false,
“rejectUnauthorizedCerts”: false,
“ha_boolean”: “y|yes|true|on|home|open”,
“connectionDelay”: true,
“cacheJson”: true,
“heartbeat”: false,
“heartbeatInterval”: “30”,
“areaSelector”: “friendlyName”,
“deviceSelector”: “friendlyName”,
“entitySelector”: “friendlyName”,
“statusSeparator”: ": ",
“statusYear”: “hidden”,
“statusMonth”: “short”,
“statusDay”: “numeric”,
“statusHourCycle”: “default”,
“statusTimeFormat”: “h:m”,
“enableGlobalContextStore”: false
},
{
“id”: “0141673b77934954”,
“type”: “ha-entity-config”,
“server”: “3713ee69f03349f5”,
“deviceConfig”: “6b7292b05f33ddec”,
“name”: “转换卧室存在”,
“version”: “6”,
“entityType”: “binary_sensor”,
“haConfig”: [
{
“property”: “name”,
“value”: “转换卧室存在”
},
{
“property”: “icon”,
“value”: “”
},
{
“property”: “entity_picture”,
“value”: “”
},
{
“property”: “entity_category”,
“value”: “”
},
{
“property”: “device_class”,
“value”: “motion”
}
],
“resend”: true,
“debugEnabled”: false
},
{
“id”: “6140214c77b432f7”,
“type”: “ha-entity-config”,
“server”: “3713ee69f03349f5”,
“deviceConfig”: “9242fe94e44d5a0f”,
“name”: “转换卫生间存在”,
“version”: “6”,
“entityType”: “binary_sensor”,
“haConfig”: [
{
“property”: “name”,
“value”: “转换卫生间存在”
},
{
“property”: “icon”,
“value”: “”
},
{
“property”: “entity_picture”,
“value”: “”
},
{
“property”: “entity_category”,
“value”: “”
},
{
“property”: “device_class”,
“value”: “motion”
}
],
“resend”: true,
“debugEnabled”: false
},
{
“id”: “e17414398f8343d9”,
“type”: “ha-device-config”,
“name”: “客厅存在感应#”,
“hwVersion”: “”,
“manufacturer”: “Node-RED-Bojan”,
“model”: “”,
“swVersion”: “”
},
{
“id”: “6b7292b05f33ddec”,
“type”: “ha-device-config”,
“name”: “卧室存在感应#”,
“hwVersion”: “”,
“manufacturer”: “Node-RED-Bojan”,
“model”: “”,
“swVersion”: “”
},
{
“id”: “9242fe94e44d5a0f”,
“type”: “ha-device-config”,
“name”: “卫生间存在感应#”,
“hwVersion”: “”,
“manufacturer”: “Node-RED-Bojan”,
“model”: “”,
“swVersion”: “”
}
]