Hi,
I'd appreciate some guidance on this issue.
I've a button which, for some reasons, doesn't show its text when loading for the first time the page. The text comes up once actioned the button and stays on.
How do I modify it.
TIA
[
{
"id": "a8fd423c.f1f4f",
"type": "rpi-gpio out",
"z": "df2b4f99.163318",
"name": "relayS",
"pin": "33",
"set": "",
"level": "0",
"freq": "",
"out": "out",
"x": 810,
"y": 340,
"wires": []
},
{
"id": "7f19db02.fc5264",
"type": "ui_button",
"z": "df2b4f99.163318",
"name": "btnS",
"group": "b7650ad6.bcc6",
"order": 1,
"width": "3",
"height": "1",
"passthru": false,
"label": "{{msg.icon}}",
"tooltip": "",
"color": "white",
"bgcolor": "{{msg.colour}}",
"icon": "",
"payload": "X",
"payloadType": "str",
"topic": "",
"x": 570,
"y": 280,
"wires": [
[
"4bed650f.761c1c"
]
]
},
{
"id": "4bed650f.761c1c",
"type": "function",
"z": "df2b4f99.163318",
"name": "With icon on press",
"func": "if (msg.payload == \"X\")\n{\n //\n //node.warn(\"X received\");\n msg.payload = \"1\";\n\n //msg.icon = '<font color = \"white\"><i class=\"material-icons md-48\"> check_circle_outline style:\"color:black\"></i></font>'\n //msg.icon = '<i class=\"material-icons\"> check_circle_outline style:\"color:\"black\">';\n //msg.icon = '<i class=\"material-icons\"> check_circle_outline</i>'\n //msg.icon = '<font color = \"white\"><i class=\"material-icons\"> check_circle_outline</i></font>'\n //msg = {icon: '<font color = \"black\" i class=\"fa fa-book fa-2x\"></i>',\"payload\": \"Button pressed\"};\n}\nelse\n{\n msg.payload = \"0\";\n msg.icon = \"Lavadora S\";\n //msg = {icon: '<font color = \"white\" i class=\"fa fa-book fa-2x\"></i>',\"payload\": \"Button released\"};\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 590,
"y": 360,
"wires": [
[
"7f19db02.fc5264",
"b5e515d.94727e8",
"a8fd423c.f1f4f"
]
]
},
{
"id": "b5e515d.94727e8",
"type": "switch",
"z": "df2b4f99.163318",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 810,
"y": 400,
"wires": [
[
"34f617a0.51a2e8"
]
]
},
{
"id": "34f617a0.51a2e8",
"type": "trigger",
"z": "df2b4f99.163318",
"name": "",
"op1": "",
"op2": "Z",
"op1type": "nul",
"op2type": "str",
"duration": "1",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 620,
"y": 500,
"wires": [
[
"4bed650f.761c1c"
]
]
},
{
"id": "b7650ad6.bcc6",
"type": "ui_group",
"name": "Control",
"tab": "ef5d65ce.36e6b",
"order": 1,
"disp": true,
"width": "6",
"collapse": true
},
{
"id": "ef5d65ce.36e6b",
"type": "ui_tab",
"name": "Washup",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]