Configure Node properties of a Subflow


I am using node-red-contrib-alexa-remote2 to control my Alexa Echo and connected Smart Home devices as a first useful way to explore Node-RED. It provices a Node (amongst others) to control a single Smart Home device. Let's have a look on how the Node properties look like if I wanted to turn my Kitchen light off.

Unfortunately there is no toggle, only allowing for turning a light on or off. I took this as an oppurtunity to get into subflows.

My idea is to create a subflow that takes the Account (global configuration node, as far as I understand) and device name or id. It consists of 3 Alexa nodes: The first one queries the current state of the target device (on / off). A switch node then either triggers the turn device on or turn device off node.

While I understand that I can use environment variables for subflow configuration, I don't understand how I could somehow inject those values into the Alexa Nodes, configuring the Account and device in a dynamic way.

Is there some API to access a Node's configuration and some init code of a subflow where I could do this?

Thanks in advance!

1 Like

Voting up this feature request. It would be so useful to be able to pick config-nodes for nodes inside a subflow using subflow properties.

I'm not 100% this works, but I recall @knolleary mentioning it was possible to edit the subflow's JSON and change the value of Account for example ton an env var (${YOURVAR})
would need to test this though...

Just tried and it doesn't seem to work