[
{
"id": "4b348da2.77a314",
"type": "tab",
"label": "流程4",
"disabled": false,
"info": ""
},
{
"id": "2247ab14.5fb634",
"type": "server-events",
"z": "4b348da2.77a314",
"name": "获取所有事件",
"server": "909c521e.52735",
"x": 153.3333282470703,
"y": 398.33331298828125,
"wires": [
[
"769c172c.1e3a58"
]
]
},
{
"id": "769c172c.1e3a58",
"type": "switch",
"z": "4b348da2.77a314",
"name": "获取客厅无线开关事件",
"property": "payload.entity_id",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "binary_sensor.switch_158d0001223ea8",
"vt": "str"
},
{
"t": "eq",
"v": "binary_sensor.switch_158d0001b9425f",
"vt": "str"
},
{
"t": "eq",
"v": "binary_sensor.cube_158d000278ead4",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 367.3333282470703,
"y": 397.33331298828125,
"wires": [
[],
[],
[
"2462e000.cddc2"
]
]
},
{
"id": "2462e000.cddc2",
"type": "switch",
"z": "4b348da2.77a314",
"name": "魔方",
"property": "payload.event.action_type",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "flip90",
"vt": "str"
},
{
"t": "eq",
"v": "flip180",
"vt": "str"
},
{
"t": "eq",
"v": "shake_air",
"vt": "str"
},
{
"t": "eq",
"v": "rotate",
"vt": "str"
},
{
"t": "eq",
"v": "tap_twice",
"vt": "str"
},
{
"t": "eq",
"v": "move",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 6,
"x": 596.3332958221436,
"y": 419.6666564941406,
"wires": [
[],
[],
[],
[
"ebef2114.4035b"
],
[
"50f9e36.1f7751c"
],
[]
]
},
{
"id": "f9d5f8c9.7519d8",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "提高亮度",
"server": "909c521e.52735",
"service_domain": "light",
"service": "turn_on",
"data": "{ "entity_id": "light.living_room", "brightness": "200" }",
"mergecontext": "",
"x": 1198.3333282470703,
"y": 262.33331298828125,
"wires": [
[]
]
},
{
"id": "e6482a78.187f18",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "降低亮度",
"server": "909c521e.52735",
"service_domain": "light",
"service": "turn_on",
"data": "{ "entity_id": "light.living_room", "brightness": "30" }",
"mergecontext": "",
"x": 1195.3333282470703,
"y": 300.33331298828125,
"wires": [
[]
]
},
{
"id": "50f9e36.1f7751c",
"type": "function",
"z": "4b348da2.77a314",
"name": "获取mode变量状态",
"func": "if(flow.get('mode')==='brightness'){\n return [msg,null];\n}\nelse{\n return [null,msg];}\n",
"outputs": 2,
"noerr": 0,
"x": 822.3333282470703,
"y": 561.3333129882812,
"wires": [
[
"937f2ee0.de56d",
"f23ed97.ed4bb28"
],
[
"3a7b7a6a.d2b286"
]
]
},
{
"id": "937f2ee0.de56d",
"type": "function",
"z": "4b348da2.77a314",
"name": "设置mode变量状态为color_temp",
"func": "flow.set('mode','color_temp');\nreturn null;",
"outputs": 1,
"noerr": 0,
"x": 1132.3333282470703,
"y": 536.3333129882812,
"wires": [
[]
]
},
{
"id": "9c02c415.487ce8",
"type": "function",
"z": "4b348da2.77a314",
"name": "获取mode变量状态为temperature",
"func": "flow.set('mode','temperature');\nreturn null;",
"outputs": 1,
"noerr": 0,
"x": 1440.3333282470703,
"y": 612.3333129882812,
"wires": [
[]
]
},
{
"id": "3a7b7a6a.d2b286",
"type": "function",
"z": "4b348da2.77a314",
"name": "获取mode变量状态",
"func": "if(flow.get('mode')==='color_temp'){\n return [msg,null];\n}\nelse{\n return [null,msg];}\n",
"outputs": 2,
"noerr": 0,
"x": 1131.3333282470703,
"y": 634.3333129882812,
"wires": [
[
"9c02c415.487ce8",
"7e5a6eba.20a27"
],
[
"5b8279fc.9ba6e8",
"f03ef696.ddcd58"
]
]
},
{
"id": "5b8279fc.9ba6e8",
"type": "function",
"z": "4b348da2.77a314",
"name": "获取mode变量状态为temperature",
"func": "flow.set('mode','brightness');\nreturn null;",
"outputs": 1,
"noerr": 0,
"x": 1444.3333282470703,
"y": 760.3333129882812,
"wires": [
[]
]
},
{
"id": "ebef2114.4035b",
"type": "function",
"z": "4b348da2.77a314",
"name": "获取mode变量状态",
"func": "if(flow.get('mode')==='brightness'){\n return [msg,null];\n}\nelse{\n return [null,msg];}\n",
"outputs": 2,
"noerr": 0,
"x": 794.3332824707031,
"y": 383.66663360595703,
"wires": [
[
"d2f489e3.695278"
],
[
"c8859af2.08ae88"
]
]
},
{
"id": "c8859af2.08ae88",
"type": "function",
"z": "4b348da2.77a314",
"name": "获取mode变量状态",
"func": "if(flow.get('mode')==='color_temp'){\n return [msg,null];\n}\nelse{\n return [null,msg];}\n",
"outputs": 2,
"noerr": 0,
"x": 827.3333053588867,
"y": 453.6666450500488,
"wires": [
[
"377854a6.b9ac0c"
],
[
"811a5eb0.ad23b"
]
]
},
{
"id": "d2f489e3.695278",
"type": "switch",
"z": "4b348da2.77a314",
"name": "获取魔方事件",
"property": "payload.event.action_value",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": " 0",
"vt": "str"
},
{
"t": "lt",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1005.9999771118164,
"y": 355.66665744781494,
"wires": [
[
"f9d5f8c9.7519d8"
],
[
"e6482a78.187f18"
]
]
},
{
"id": "9924f107.12b94",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "调暖",
"server": "909c521e.52735",
"service_domain": "light",
"service": "turn_on",
"data": "{ "entity_id": "light.living_room", "color_temp": "370" }",
"mergecontext": "",
"x": 1182.3333282470703,
"y": 380.33331298828125,
"wires": [
[]
]
},
{
"id": "fca4056e.ec0c78",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "调冷",
"server": "909c521e.52735",
"service_domain": "light",
"service": "turn_on",
"data": "{ "entity_id": "light.living_room", "color_temp": "153" }",
"mergecontext": "",
"x": 1180.3333282470703,
"y": 423.33331298828125,
"wires": [
[]
]
},
{
"id": "377854a6.b9ac0c",
"type": "switch",
"z": "4b348da2.77a314",
"name": "获取魔方事件",
"property": "payload.event.action_value",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": " 0",
"vt": "str"
},
{
"t": "lt",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1021.3333282470703,
"y": 429.33331298828125,
"wires": [
[
"9924f107.12b94"
],
[
"fca4056e.ec0c78"
]
]
},
{
"id": "b5af3efd.30666",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "提高温度",
"server": "909c521e.52735",
"service_domain": "climate",
"service": "set_temperature",
"data": "{ "entity_id": "climate.air_conditioner", "temperature": "26" }",
"mergecontext": "",
"x": 1269.3333282470703,
"y": 463.33331298828125,
"wires": [
[]
]
},
{
"id": "6ca213dd.7dcf6c",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "降低温度",
"server": "909c521e.52735",
"service_domain": "climate",
"service": "set_temperature",
"data": "{ "entity_id": "climate.air_conditioner", "temperature": "20" }",
"mergecontext": "",
"x": 1263.3333282470703,
"y": 500.33331298828125,
"wires": [
[]
]
},
{
"id": "811a5eb0.ad23b",
"type": "switch",
"z": "4b348da2.77a314",
"name": "获取魔方事件",
"property": "payload.event.action_value",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": " 0",
"vt": "str"
},
{
"t": "lt",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1032.3333282470703,
"y": 479.33331298828125,
"wires": [
[
"b5af3efd.30666"
],
[
"6ca213dd.7dcf6c"
]
]
},
{
"id": "3a43f3b0.bd4c7c",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "若琪播报",
"server": "909c521e.52735",
"service_domain": "rokid_tts",
"service": "speak",
"data": "",
"mergecontext": "",
"x": 1525.3333282470703,
"y": 832.3333129882812,
"wires": [
[]
]
},
{
"id": "f03ef696.ddcd58",
"type": "function",
"z": "4b348da2.77a314",
"name": "TTS内容",
"func": "var message = `切换至调光`;\nmsg.payload = {};\nmsg.payload.data = {"message":message};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1357.9998321533203,
"y": 848.8334350585938,
"wires": [
[
"c41efe1d.031d4",
"3a43f3b0.bd4c7c"
]
]
},
{
"id": "c41efe1d.031d4",
"type": "debug",
"z": "4b348da2.77a314",
"name": "调式信息",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 1526.9998321533203,
"y": 873.8334350585938,
"wires": []
},
{
"id": "e68bffa5.714e1",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "若琪播报",
"server": "909c521e.52735",
"service_domain": "rokid_tts",
"service": "speak",
"data": "",
"mergecontext": "",
"x": 1656.3334007263184,
"y": 644.3333377838135,
"wires": [
[]
]
},
{
"id": "7e5a6eba.20a27",
"type": "function",
"z": "4b348da2.77a314",
"name": "TTS内容",
"func": "var message = `切换至调温`;\nmsg.payload = {};\nmsg.payload.data = {"message":message};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1358.9998321533203,
"y": 651.8334350585938,
"wires": [
[
"e0bd92e.a5fca7",
"e68bffa5.714e1"
]
]
},
{
"id": "e0bd92e.a5fca7",
"type": "debug",
"z": "4b348da2.77a314",
"name": "调式信息",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 1652.333236694336,
"y": 684.8334407806396,
"wires": []
},
{
"id": "ca566174.45873",
"type": "api-call-service",
"z": "4b348da2.77a314",
"name": "若琪播报",
"server": "909c521e.52735",
"service_domain": "rokid_tts",
"service": "speak",
"data": "",
"mergecontext": "",
"x": 1362.3333282470703,
"y": 538.3333129882812,
"wires": [
[]
]
},
{
"id": "f23ed97.ed4bb28",
"type": "function",
"z": "4b348da2.77a314",
"name": "TTS内容",
"func": "var message = `切换至调色`;\nmsg.payload = {};\nmsg.payload.data = {"message":message};\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"x": 1109.9998321533203,
"y": 583.8334350585938,
"wires": [
[
"c45f1c02.91859",
"ca566174.45873"
]
]
},
{
"id": "c45f1c02.91859",
"type": "debug",
"z": "4b348da2.77a314",
"name": "调式信息",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 1317.9998321533203,
"y": 578.8334350585938,
"wires": []
},
{
"id": "909c521e.52735",
"type": "server",
"z": "",
"name": "Home Assistant",
"url": "http://192.1.1.111:8123",
"pass": "123456"
}
]