Hello,
In my level 1 NR-flow, I am repeating the same node multiple times, so I figured out, it would be easier to maintain using a subflow.
My problem is now that I can't read flow variable from the parent flow (level 1) in the subflow.
I have read different posts on the subject, but my attempts are not successful.
The output msg is not set with the correct values.
Any advice ?
Node-RED version: v3.0.2
[
{
"id": "9e1d5c1629033e70",
"type": "subflow",
"name": "V3V State",
"info": "",
"category": "",
"in": [
{
"x": 520,
"y": 160,
"wires": [
{
"id": "16fbf363e7292075"
}
]
}
],
"out": [
{
"x": 890,
"y": 160,
"wires": [
{
"id": "16fbf363e7292075",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#DDAA99"
},
{
"id": "16fbf363e7292075",
"type": "change",
"z": "9e1d5c1629033e70",
"name": "State msg",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "state",
"tot": "str"
},
{
"t": "set",
"p": "timestamp",
"pt": "msg",
"to": "$parent.timestamp",
"tot": "env"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$parent.position",
"tot": "env"
},
{
"t": "set",
"p": "motion",
"pt": "msg",
"to": "$parent.motion",
"tot": "env"
},
{
"t": "set",
"p": "control_mode",
"pt": "msg",
"to": "$parent.control_mode",
"tot": "env"
},
{
"t": "set",
"p": "reliability",
"pt": "msg",
"to": "$parent.reliability",
"tot": "env"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 160,
"wires": [
[]
]
}
]