This is likely a very dumb, newby question, but my google foo seems to be failing me and I can't find the answer.
I have a series of nearly identical flows connected to different motion sensors. One half of the flows turn on the lights (if they are off and it's dark) and the other half turn the lights off again if no motion is detected for a while (again, if the lights are on). These seem like perfect candidates for subflows: The logic is the same, only the entity ids (what sensor to check for darkness and what lights to turn on or off). But I can't figure out how to get the entities ids in as variables that I can use in the "Entity ID" property of the "call service" or "current state" nodes.
I've tried triggering with the payload set to an object like:
{ "sensor": "sensor.xxxx_room_sensor_light_level", "lights": "light.bathroom, light.hallway" }
And I see that payload in the debug output in the subflow, but I don't know how to, say, set an environment variable of LIGHT_SENSOR to the contents of msg.payload.sensor
. What keeps happening is that LIGHT_SENSOR gets set to "msg.payload.sensor" (that literal string).
Presumably, I will be able to just use ${LIGHT_SENSOR} as the entity id when I need it, I assume/hope, but I haven't been able to get to this point.
What silly thing am I missing?