I want to create a subflow that can turn off a bulb when a certain message is received and then poll its state to make sure the bulb is off. After confirmation it should repeat the input message. The purpose of this is to daisy-chain a bunch of these (one for each bulb) and watch bulbs being turned off one after another.
It would be great if I could make subscribing to the mqtt topic for the bulb configurable though the subflow environment variables so I could just instantiate the subflow once for each bulb.
I've tried the solution proposed in https://cookbook.nodered.org/mqtt/subscribe-to-topic where the mqtt topic field is set to $(MY_TOPIC) but it doesn't work.
After some debugging it looks like the variable is never expanded. I have replaced mqtt node with a change node for debugging purposes and it looks like the variable is indeed expanded in this case.
Is this a bug or a feature of the mqtt node?
Is my approach on this issue just wrong?