Hello friends.
Today i try to create the following:
-
A dropdown widget where the information of the payload will be written only after pushing "submit"
-
Change the colour of the widget (backgorund) to red, when changes are made. After submitting change the color back to "normal".
-
When i push submit to "publish" the payload of the dropdown, i want that there is a password prompt where i have to enter a password. Only after entering the correct password, the payload is send.
I already have point 1 and i am struggling with point 2 right now. I cant figure out, how to detect a change (a select in the dropdown) that initiates the color-change
my code so far:
[
{
"id": "c1c21252.8f72d8",
"type": "ui_button",
"z": "191728c3ee9255a0",
"name": "submit remote",
"group": "83fd112e3229a323",
"order": 2,
"width": 2,
"height": 1,
"passthru": false,
"label": "Submit",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"topicType": "str",
"x": 860,
"y": 1300,
"wires": [
[
"93b4c78d.a069"
]
]
},
{
"id": "e91258f6.69587",
"type": "function",
"z": "191728c3ee9255a0",
"name": "Store REMOTE",
"func": "flow.set(\"selectedOption\",msg.payload);\nreturn null;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 1320,
"wires": [
[
"661535bc6ac3dfb7"
]
]
},
{
"id": "93b4c78d.a069",
"type": "function",
"z": "191728c3ee9255a0",
"name": "Create Message",
"func": "msg.payload = \"You selected \" + flow.get(\"selectedOption\");\ncontext.set(\"selectedOption\", null);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1090,
"y": 1300,
"wires": [
[
"5f36baf00769c377"
]
]
},
{
"id": "45f59cacf24d378b",
"type": "debug",
"z": "191728c3ee9255a0",
"name": "debug 283",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 430,
"y": 1260,
"wires": []
},
{
"id": "661535bc6ac3dfb7",
"type": "debug",
"z": "191728c3ee9255a0",
"name": "debug 284",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 1300,
"wires": []
},
{
"id": "5f36baf00769c377",
"type": "debug",
"z": "191728c3ee9255a0",
"name": "debug 285",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1320,
"y": 1300,
"wires": []
},
{
"id": "78df02054f343c2d",
"type": "ui_dropdown",
"z": "191728c3ee9255a0",
"name": "REMOTE_T",
"label": "REMOTE:",
"tooltip": "Activates Remote-control. Unable to control Pump when OFF",
"place": "",
"group": "83fd112e3229a323",
"order": 1,
"width": 3,
"height": 1,
"passthru": true,
"multiple": false,
"options": [
{
"label": "ON",
"value": true,
"type": "bool"
},
{
"label": "OFF",
"value": false,
"type": "bool"
}
],
"payload": "",
"topic": "test",
"topicType": "msg",
"className": "",
"x": 250,
"y": 1320,
"wires": [
[
"45f59cacf24d378b",
"e91258f6.69587"
]
]
},
{
"id": "83fd112e3229a323",
"type": "ui_group",
"name": "CONTROL",
"tab": "4ad3c40739cbf998",
"order": 1,
"disp": true,
"width": 10,
"collapse": false,
"className": ""
},
{
"id": "4ad3c40739cbf998",
"type": "ui_tab",
"name": "PUMP A",
"icon": "dashboard",
"order": 3,
"disabled": false,
"hidden": false
}
]
thank you