Great Nodered users.
I've the below flow where the msg is supposed to have multiple properties, but it seems the properties are lost in between nodes !
[
{
"id": "a9eb292a6233f9f1",
"type": "inject",
"z": "129b235eefae568b",
"name": "",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "state",
"v": "OFF",
"vt": "str"
},
{
"p": "background",
"v": "RED",
"vt": "str"
},
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "inverter",
"payload": "false",
"payloadType": "bool",
"x": 110,
"y": 60,
"wires": [
[
"2437fb407f0c0b44",
"234ba221963d2297"
]
]
},
{
"id": "9079ecab67bcd03b",
"type": "change",
"z": "129b235eefae568b",
"name": "",
"rules": [
{
"t": "change",
"p": "background",
"pt": "msg",
"from": "RED",
"fromt": "str",
"to": "GREEN",
"tot": "str"
},
{
"t": "change",
"p": "state",
"pt": "msg",
"from": "OFF",
"fromt": "str",
"to": "ON",
"tot": "str"
},
{
"t": "change",
"p": "background",
"pt": "msg",
"from": "GREEN",
"fromt": "str",
"to": "RED",
"tot": "str"
},
{
"t": "change",
"p": "state",
"pt": "msg",
"from": "ON",
"fromt": "str",
"to": "OFF",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "true",
"fromt": "bool",
"to": "false",
"tot": "bool"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "false",
"fromt": "bool",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 60,
"wires": [
[
"d685e5a3ea2915fc",
"2437fb407f0c0b44"
]
]
},
{
"id": "d685e5a3ea2915fc",
"type": "debug",
"z": "129b235eefae568b",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 660,
"y": 60,
"wires": []
},
{
"id": "2437fb407f0c0b44",
"type": "ui_button",
"z": "129b235eefae568b",
"name": "",
"group": "d488c32a39e6b090",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "{{msg.state}}",
"tooltip": "",
"color": "",
"bgcolor": "{{msg.background}}",
"className": "",
"icon": "",
"payload": "false",
"payloadType": "bool",
"topic": "inverter",
"topicType": "msg",
"x": 250,
"y": 60,
"wires": [
[
"9079ecab67bcd03b",
"565d1c11f6297a74"
]
]
},
{
"id": "565d1c11f6297a74",
"type": "debug",
"z": "129b235eefae568b",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 20,
"wires": []
},
{
"id": "234ba221963d2297",
"type": "debug",
"z": "129b235eefae568b",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 260,
"y": 20,
"wires": []
},
{
"id": "d488c32a39e6b090",
"type": "ui_group",
"name": "dashboard_group_1",
"tab": "a7d5e487503829e6",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "a7d5e487503829e6",
"type": "ui_tab",
"name": "dashboard_tab_1",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]
What do I do wrong ?
The button is supposed to change background colour on each click as the msg.state is supposed to swap from true to false or false to true.