Это наверное вы решили что Nod red это куча кода??? Нет это так выглядит выгрузка для копи-паста.
MQTT блок там не подключен. Просто кусок песочницы на вырост. Я торопился поделится и не почистил. Посмотрите
.
Отпишитесь как оно по итогам .
Код: Выделить всё
[
{
"id": "abc8c3aa.d64268",
"type": "mqtt in",
"z": "23474e9.60a5632",
"name": "MQTT P18",
"topic": "megad/0/p18_P18",
"qos": "0",
"broker": "fb5bf956.cd47b8",
"x": 100,
"y": 100,
"wires": [
[]
]
},
{
"id": "5c218053.3c855",
"type": "debug",
"z": "23474e9.60a5632",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 770,
"y": 140,
"wires": []
},
{
"id": "49560842.f4cfc8",
"type": "http request",
"z": "23474e9.60a5632",
"name": "Включить все",
"method": "GET",
"url": "http://192.168.1.214/sec/?cmd=a:1",
"tls": "",
"x": 457,
"y": 99.99999904632568,
"wires": [
[
"5c218053.3c855"
]
]
},
{
"id": "41dbbbf8.21cd9c",
"type": "comment",
"z": "23474e9.60a5632",
"name": "http://192.168.1.214/sec/?cmd=a:1",
"info": "",
"x": 517,
"y": 135,
"wires": []
},
{
"id": "56efdf5f.cbeb58",
"type": "switch",
"z": "23474e9.60a5632",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "true",
"vt": "str"
},
{
"t": "eq",
"v": "false",
"vt": "str"
}
],
"checkall": "true",
"outputs": 2,
"x": 270,
"y": 140,
"wires": [
[
"49560842.f4cfc8"
],
[
"1052a898.9eb4bf"
]
]
},
{
"id": "1052a898.9eb4bf",
"type": "http request",
"z": "23474e9.60a5632",
"name": "Выключить все",
"method": "GET",
"url": "http://192.168.1.214/sec/?cmd=a:0",
"tls": "",
"x": 460,
"y": 180,
"wires": [
[
"5c218053.3c855"
]
]
},
{
"id": "2a222b03.30813c",
"type": "comment",
"z": "23474e9.60a5632",
"name": "http://192.168.1.214/sec/?cmd=a:0",
"info": "",
"x": 518,
"y": 222,
"wires": []
},
{
"id": "f5885cae.d2fa38",
"type": "debug",
"z": "23474e9.60a5632",
"name": "P18",
"active": true,
"console": "false",
"complete": "payload",
"x": 270,
"y": 40,
"wires": []
},
{
"id": "4b96b16d.924468",
"type": "debug",
"z": "23474e9.60a5632",
"name": "false debag/true debag",
"active": true,
"console": "false",
"complete": "payload",
"x": 360,
"y": 280,
"wires": []
},
{
"id": "dbb5bb2.6e4a448",
"type": "inject",
"z": "23474e9.60a5632",
"name": "true debag",
"topic": "",
"payload": "true",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 120,
"y": 180,
"wires": [
[
"56efdf5f.cbeb58",
"4b96b16d.924468"
]
]
},
{
"id": "1a3a44e8.f29ae3",
"type": "inject",
"z": "23474e9.60a5632",
"name": "false debag",
"topic": "",
"payload": "false",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 120,
"y": 220,
"wires": [
[
"56efdf5f.cbeb58",
"4b96b16d.924468"
]
]
},
{
"id": "33935cef.d2d0bc",
"type": "ioBroker in",
"z": "23474e9.60a5632",
"name": "IoBroker P18",
"topic": "megad.0.p18_P18",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"x": 110,
"y": 40,
"wires": [
[
"56efdf5f.cbeb58",
"f5885cae.d2fa38"
]
]
},
{
"id": "fb5bf956.cd47b8",
"type": "mqtt-broker",
"z": "23474e9.60a5632",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthPayload": ""
}
]