Код: Выделить всё
[
{
"id": "125478b1cb37c51e",
"type": "inject",
"z": "2411c3f0dc53c5af",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "hi",
"payloadType": "str",
"x": 490,
"y": 680,
"wires": [
[
"51e05f8cd93b39f1"
]
]
},
{
"id": "51e05f8cd93b39f1",
"type": "mqtt out",
"z": "2411c3f0dc53c5af",
"name": "",
"topic": "test1",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "8262c7fa35a35d43",
"x": 630,
"y": 680,
"wires": []
},
{
"id": "1288e14eef27bc9a",
"type": "ui-dropdown",
"z": "2411c3f0dc53c5af",
"group": "4b7224a4fd8c7228",
"name": "",
"label": "Select Option:",
"tooltip": "",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"multiple": false,
"chips": false,
"clearable": false,
"options": [
{
"label": "Room",
"value": "Room",
"type": "str"
},
{
"label": "Kitchen",
"value": "Kitchen",
"type": "str"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"typeIsComboBox": true,
"msgTrigger": "onChange",
"x": 660,
"y": 620,
"wires": [
[
"save_dropdown",
"8537fa7aaee7d933"
]
]
},
{
"id": "save_dropdown",
"type": "change",
"z": "2411c3f0dc53c5af",
"name": "Save dropdown to flow",
"rules": [
{
"t": "set",
"p": "selectedOption",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"x": 900,
"y": 620,
"wires": [
[
"1bdff5d3d53d1c11",
"0f370a14e3194769"
]
]
},
{
"id": "379cc7e16645951e",
"type": "mqtt in",
"z": "2411c3f0dc53c5af",
"name": "",
"topic": "test1",
"qos": "0",
"datatype": "utf8",
"broker": "8262c7fa35a35d43",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 630,
"y": 540,
"wires": [
[
"12fab7605c0cd2b0"
]
]
},
{
"id": "12fab7605c0cd2b0",
"type": "change",
"z": "2411c3f0dc53c5af",
"name": "",
"rules": [
{
"t": "move",
"p": "payload",
"pt": "msg",
"to": "payload1",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 540,
"wires": [
[
"1bdff5d3d53d1c11"
]
]
},
{
"id": "1bdff5d3d53d1c11",
"type": "function",
"z": "2411c3f0dc53c5af",
"name": "Prepare HTTP Request",
"func": "msg.headers = {\n 'tags': 'warning',\n 'priority': '1',\n 'X-Title': flow.get(\"selectedOption\") // Получаем значение из flow-контекста\n};\nmsg.payload = {\n 'topic': msg.topic, // Динамическое имя топика\n 'message': msg.payload1\n};\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1150,
"y": 540,
"wires": [
[
"17e016a44e16f0a3"
]
]
},
{
"id": "17e016a44e16f0a3",
"type": "http request",
"z": "2411c3f0dc53c5af",
"name": "Send to ntfy.sh",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://ntfy.sh/твоя подписка",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "other",
"keyValue": "",
"valueType": "other",
"valueValue": ""
}
],
"x": 1220,
"y": 600,
"wires": [
[]
]
},
{
"id": "216b34163c36780f",
"type": "inject",
"z": "2411c3f0dc53c5af",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Room",
"payloadType": "str",
"x": 490,
"y": 620,
"wires": [
[
"1288e14eef27bc9a"
]
]
},
{
"id": "0f370a14e3194769",
"type": "debug",
"z": "2411c3f0dc53c5af",
"name": "debug 558",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1170,
"y": 700,
"wires": []
},
{
"id": "8537fa7aaee7d933",
"type": "debug",
"z": "2411c3f0dc53c5af",
"name": "debug 559",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 950,
"y": 680,
"wires": []
},
{
"id": "f06c328b5399259f",
"type": "aedes broker",
"z": "2411c3f0dc53c5af",
"name": "",
"mqtt_port": 1883,
"mqtt_ws_bind": "port",
"mqtt_ws_port": null,
"mqtt_ws_path": "",
"cert": "",
"key": "",
"certname": "",
"keyname": "",
"dburl": "",
"usetls": false,
"x": 670,
"y": 760,
"wires": [
[],
[]
]
},
{
"id": "8262c7fa35a35d43",
"type": "mqtt-broker",
"name": "192.168.43.1",
"broker": "192.168.43.1",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "4b7224a4fd8c7228",
"type": "ui-group",
"name": "ntfy",
"page": "0bde524d3a874c26",
"width": "6",
"height": "1",
"order": 1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "0bde524d3a874c26",
"type": "ui-page",
"name": "Главная",
"ui": "1bb9db23437aaf62",
"path": "/main",
"icon": "",
"layout": "grid",
"theme": "a965ccfef139317a",
"breakpoints": [
{
"name": "Default",
"px": "0",
"cols": "3"
},
{
"name": "Tablet",
"px": "576",
"cols": "6"
},
{
"name": "Small Desktop",
"px": "768",
"cols": "9"
},
{
"name": "Desktop",
"px": "1024",
"cols": "12"
}
],
"order": 7,
"className": "",
"visible": true,
"disabled": false
},
{
"id": "1bb9db23437aaf62",
"type": "ui-base",
"name": "Устройства Управления",
"path": "/dashboard",
"appIcon": "",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": false,
"navigationStyle": "icon",
"titleBarStyle": "default"
},
{
"id": "a965ccfef139317a",
"type": "ui-theme",
"name": "Default",
"colors": {
"surface": "#5c5c5c",
"primary": "#0094ce",
"bgPage": "#383838",
"groupBg": "#4f4f4f",
"groupOutline": "#858585"
},
"sizes": {
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px",
"density": "default"
}
}
]