I don't fully understand how node-red memory/data store in memory works yet, but here's a more detailed test result
Step1. inject timestamp with topic as number, topic pass through the switch node as number
Step2. inject timestamp with topic as string, topic pass through the switch node as string
Step3. toggle the string switch in ui page, either on or off, topic pass through the switch node as string
Step4. toggle the number switch in ui page, either on or off, topic does not pass
19 Nov 20:14:34 - [info] Node-RED version: v3.0.2
19 Nov 20:14:34 - [info] Node.js version: v18.12.1
19 Nov 20:14:34 - [info] Windows_NT 10.0.22621 x64 LE
19 Nov 20:14:35 - [info] Loading palette nodes
19 Nov 20:14:37 - [info] Dashboard version 3.2.0 started at /ui
[
{
"id": "b96bd8b5a5db8dd3",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "19d3920d92883087",
"type": "inject",
"z": "b96bd8b5a5db8dd3",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"v": "0",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 220,
"y": 120,
"wires": [
[
"b97be716cfbe6cd2",
"f5de58d57a08fa9a"
]
]
},
{
"id": "9aa3e16f74a36f01",
"type": "debug",
"z": "b96bd8b5a5db8dd3",
"name": "debug 6",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 120,
"wires": []
},
{
"id": "b97be716cfbe6cd2",
"type": "debug",
"z": "b96bd8b5a5db8dd3",
"name": "debug 7",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 420,
"y": 180,
"wires": []
},
{
"id": "f5de58d57a08fa9a",
"type": "ui_switch",
"z": "b96bd8b5a5db8dd3",
"name": "",
"label": "Number no topic",
"tooltip": "",
"group": "8a2eb87d8e2bccbb",
"order": 24,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 440,
"y": 120,
"wires": [
[
"9aa3e16f74a36f01"
]
]
},
{
"id": "14a403cd2558226a",
"type": "inject",
"z": "b96bd8b5a5db8dd3",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "0",
"payload": "",
"payloadType": "date",
"x": 230,
"y": 260,
"wires": [
[
"bbf87f5763dbfe89",
"f7042246de796dfd"
]
]
},
{
"id": "32a35a44605ffde0",
"type": "debug",
"z": "b96bd8b5a5db8dd3",
"name": "debug 8",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 640,
"y": 260,
"wires": []
},
{
"id": "bbf87f5763dbfe89",
"type": "debug",
"z": "b96bd8b5a5db8dd3",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 420,
"y": 320,
"wires": []
},
{
"id": "f7042246de796dfd",
"type": "ui_switch",
"z": "b96bd8b5a5db8dd3",
"name": "",
"label": "String with topic",
"tooltip": "",
"group": "8a2eb87d8e2bccbb",
"order": 24,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 440,
"y": 260,
"wires": [
[
"32a35a44605ffde0"
]
]
},
{
"id": "7ea1a085ecdfcc63",
"type": "comment",
"z": "b96bd8b5a5db8dd3",
"name": "Number",
"info": "",
"x": 190,
"y": 80,
"wires": []
},
{
"id": "1d500d8b29dcba08",
"type": "comment",
"z": "b96bd8b5a5db8dd3",
"name": "String",
"info": "",
"x": 190,
"y": 220,
"wires": []
},
{
"id": "8a2eb87d8e2bccbb",
"type": "ui_group",
"name": "test",
"tab": "dbf28c5fd1b0a6a4",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "dbf28c5fd1b0a6a4",
"type": "ui_tab",
"name": "test",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]