[
{
"id": "1b55fbc9.098694",
"type": "ui_dropdown",
"z": "f1b7e2b9.bfea2",
"name": "",
"label": "",
"tooltip": "",
"place": "切换",
"group": "44264aa6.af1954",
"order": 6,
"width": 0,
"height": 0,
"passthru": false,
"multiple": false,
"options": [
{
"label": "MAC BOOK",
"value": "MAC BOOK",
"type": "str"
},
{
"label": "群晖",
"value": "群晖",
"type": "str"
},
{
"label": "电视盒子",
"value": "电视盒子",
"type": "str"
},
{
"label": "Apple TV",
"value": "Apple TV",
"type": "str"
},
{
"label": "N1服务器",
"value": "N1服务器",
"type": "str"
}
],
"payload": "",
"topic": "",
"x": 300,
"y": 1580,
"wires": [
[
"af67fcf0.e0771"
]
]
},
{
"id": "9366df3.dbccd2",
"type": "mqtt out",
"z": "f1b7e2b9.bfea2",
"name": "",
"topic": "hdmi/cmnd",
"qos": "",
"retain": "",
"broker": "3898d830.2de578",
"x": 570,
"y": 1580,
"wires": []
},
{
"id": "58029022.4eeab",
"type": "mqtt in",
"z": "f1b7e2b9.bfea2",
"name": "",
"topic": "hdmi/state",
"qos": "2",
"datatype": "auto",
"broker": "3898d830.2de578",
"x": 160,
"y": 1580,
"wires": [
[
"1b55fbc9.098694",
"cbb4ee2d.4dbf6"
]
]
},
{
"id": "af67fcf0.e0771",
"type": "function",
"z": "f1b7e2b9.bfea2",
"name": "",
"func": "var a = msg.payload\nif(a == "N1服务器"){\n msg.payload = 1\n}else if(a == "电视盒子"){\n msg.payload = 2\n}else if(a == "Apple TV"){\n msg.payload = 3\n}else if(a == "群晖"){\n msg.payload = 4\n}else if(a == "MAC BOOK"){\n msg.payload = 5\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 430,
"y": 1580,
"wires": [
[
"9366df3.dbccd2"
]
]
},
{
"id": "44264aa6.af1954",
"type": "ui_group",
"z": "",
"name": "HDMI",
"tab": "4b6ab69.9eea548",
"order": 6,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "3898d830.2de578",
"type": "mqtt-broker",
"z": "",
"name": "N1",
"broker": "192.168.123.233",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "node-red/server/status",
"birthQos": "0",
"birthPayload": "在线",
"closeTopic": "node-red/server/status",
"closeQos": "0",
"closePayload": "关闭",
"willTopic": "node-red/server/status",
"willQos": "0",
"willPayload": "不可用"
},
{
"id": "4b6ab69.9eea548",
"type": "ui_tab",
"z": "",
"name": "设备控制",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]