Starting a flow from a Virtual Device with Number TAG

Hi,
For my Roborock vacuum I would like to set up a VD for each room and then when I press the VD for a room pass a number from the VD to the Flow. That number will then be used for a very simple flow which cleans the room associated with that number.
Is that possible?

The flow card ā€œStart flow with numberā€ ?

Flows for the VDs:

Whenā€¦
ā€“ VD/Button no. 1 is pushed
Thenā€¦
ā€“ Logic: Set variable Roborock to 1 (= room 1)

Whenā€¦
ā€“ VD/Button no. 2 is pushed
Thenā€¦
ā€“ Logic: Set variable Roborock to 2 (= room 2)

And so onā€¦

Flow(s) for cleaning the rooms:
Whenā€¦
ā€“ Logic: Variable Roborock has changed
Andā€¦
ā€“ Logic: Variable Roborock is 1
Thenā€¦
ā€“ Clean room 1

Whenā€¦
ā€“ Logic: Variable Roborock has changed
Andā€¦
ā€“ Logic: Variable Roborock is 2
Thenā€¦
ā€“ Clean room 2

And so onā€¦

Yes, thatā€™s what I want to use, but how do you pass the number. So if I have a VD which says vacuum the dining room which is room number 18, how do I pass the 18 to the flow?

In my opinion the Start flow with number flow card is not for using this number for further use.
But you can use this flow card in the same way like the Variable has changed flow card.

Flow 1
Whenā€¦
ā€“ VD/Button no. 1 is pushed
Thenā€¦
ā€“ Start Flow ā€œRoborockā€ with no. 1

Flow 2
Whenā€¦
ā€“ This flow is started with a number tag
Andā€¦
ā€“ Start value is 1
Thenā€¦
ā€“ Clean room 1

Wouldnā€™t it be much more simple to do this?

When VD button 1 is pressed
Then clean room 1

2 Likes

You just fill in 18 :face_with_raised_eyebrow: ?
And then make a flow which start with the card ā€œThis flow is started with a number tagā€ and use the tag ā€œstart valueā€

Let me think about thatā€¦ :thinking:

Yes! :joy:

1 Like

Yeh OK, I get it, and in the end this is what I did. But I canā€™t help thinking that if such a card exists ā€œStart flow with numberā€ then there must be a way of passing a parameter when starting the flow so that the Start Value takes on that number. Yet I canā€™t seem to find any reference on how to do that. Maybe it can be done from a Script.

You first start that flow from another flow via the THEN card ā€˜Start [flow name] with [number]ā€™ in which you provide the number tag.

The flow that you are trying to call needs to start with the WHEN card ā€˜This flow is started with a number tag.

You can then check which number was passed to the flow by checking the ā€˜Start valueā€™ tag.

Got it. Thanks