Currently I have a subflow with a MQTT in node that receives all sensor messages and I have to filter for the one I want based on the subflow property/environment variable sensorName.
Instead of subscribing the MQTT In node to all sensor messages and then filtering, how can I subscribe it to only the sensor 'sensorName'. Is there a way for me to set the MQTT in topic to something like
qolsys/binary_sensor/${sensorName}/state
This interpolated format is supported if the input field is an env var. Regular fields can only support ${envvar} see environment-variables docs for details
Since you are putting the mqtt node inside a subflow, you could set it to the value of ${topic} and in the subflow template setup, you add a topic field and allow env var values.
Alternatively , you can dynamically subscribe to any topic you desire at runtime (inside or outside of a subflow). There is built in help describing this. Also search the forum for dynamic subscribe mqtt.