I need to setup a node that can search for the word "Polling" and return a boolean TRUE. The input payload is from a STATUS node that has an object like this: msg.status.text "Polling: HoldingRegister"
So I thought of using a change node to search for the string "Polling" and have the change node return a boolean TRUE.
An attempt to do this was the following flow, but it did not work:
[
{
"id": "c902de97108c71a8",
"type": "status",
"z": "6e8dfb6f99f4c853",
"name": "",
"scope": [
"f930ef143a32d5ae"
],
"x": 160,
"y": 260,
"wires": [
[
"bf8ade576c032ebf",
"2deb05efdbde91cf"
]
]
},
{
"id": "bf8ade576c032ebf",
"type": "debug",
"z": "6e8dfb6f99f4c853",
"name": "debug 4",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "true",
"targetType": "full",
"statusVal": "payload",
"statusType": "auto",
"x": 390,
"y": 260,
"wires": []
},
{
"id": "0d65803f80bce43f",
"type": "ui-led",
"z": "6e8dfb6f99f4c853",
"name": "LED",
"group": "2593d50c1273e43d",
"order": -1,
"width": 0,
"height": 0,
"label": "",
"labelPlacement": "left",
"labelAlignment": "left",
"states": [
{
"value": "false",
"valueType": "bool",
"color": "#ff0000"
},
{
"value": "true",
"valueType": "bool",
"color": "#00ff00"
}
],
"allowColorForValueInMessage": false,
"shape": "circle",
"showBorder": true,
"showGlow": true,
"x": 550,
"y": 400,
"wires": []
},
{
"id": "2deb05efdbde91cf",
"type": "change",
"z": "6e8dfb6f99f4c853",
"name": "monitor error",
"rules": [
{
"t": "change",
"p": "status.shape",
"pt": "msg",
"from": "Polling",
"fromt": "re",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 350,
"y": 360,
"wires": [
[
"0d65803f80bce43f",
"f6b29116d906883d"
]
]
},
{
"id": "d7b533531f222b3e",
"type": "inject",
"z": "6e8dfb6f99f4c853",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 310,
"y": 460,
"wires": [
[
"0d65803f80bce43f"
]
]
},
{
"id": "f8e6143cc006e929",
"type": "inject",
"z": "6e8dfb6f99f4c853",
"name": "false",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "false",
"payloadType": "bool",
"x": 310,
"y": 500,
"wires": [
[
"0d65803f80bce43f"
]
]
},
{
"id": "f6b29116d906883d",
"type": "debug",
"z": "6e8dfb6f99f4c853",
"name": "debug 5",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 570,
"y": 480,
"wires": []
},
{
"id": "2593d50c1273e43d",
"type": "ui-group",
"name": "UI Group",
"page": "d76a88afe14c7c33",
"width": "6",
"height": "1",
"order": -1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "d76a88afe14c7c33",
"type": "ui-page",
"name": "UI page",
"ui": "f2ce66a50d362da1",
"path": "/page1",
"icon": "home",
"layout": "grid",
"theme": "d6404a5c856c6736",
"order": -1,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "f2ce66a50d362da1",
"type": "ui-base",
"name": "UI Name",
"path": "/dashboard",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": false,
"navigationStyle": "default"
},
{
"id": "d6404a5c856c6736",
"type": "ui-theme",
"name": "New theme",
"colors": {
"surface": "#ffffff",
"primary": "#0094ce",
"bgPage": "#eeeeee",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
}
]
Thank you for your help