I am relatively new to Node Red. I am using it within Home Assistant. This is my first request for help.
I am building a flow to manage multiples doors (opening) with contact sensor.
First portion, I am defining flow variables. Currently 2 but more to come,
[{"id":"5153ed25.2db83c","type":"change","z":"144c9bef.2833a4","name":"","rules":[{"t":"set","p":"S4","pt":"flow","to":"S4","tot":"msg"},{"t":"set","p":"S1","pt":"flow","to":"S1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":3780,"wires":[[]]},{"id":"423605f2.fd2cd4","type":"inject","z":"144c9bef.2833a4","name":"Set Flow Wariable for Sensors","props":[{"p":"S4","v":"{\"opening\":\"Front Door\",\"waitFor\":10}","vt":"json"},{"p":"S1","v":"{\"opening\":\"Patio Cuisine\",\"waitFor\":5}","vt":"json"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","x":270,"y":3780,"wires":[["5153ed25.2db83c"]]}]
In the second portion, I am retrieving values from my "flow" object using S4.'variable name'.
I would like to retrieve the data using the content of the topic as an index for the object. This would be something like flow.get("??? topic ???.door") . This would make my flow more flexible for multiple Sensor. Currently I have ro make on function node for each door. Thank you for any help. Hopefully I did include my nodes in a usable format.