Variable of type device

Ok something really nerdy but that has always enticed me is to have a speaker announce certain events. Like “welcome home” or “a package just arrived “.

One can easily set this up by creating an MP3 and setting up a rule.

Further enhancement would be to have different MP3 for different people so it’s customized “hey Matt, a package just arrived”. In the rules that’s easily enough selected by choosing the MP3 based on who is at home.

Even cooler, if you have multiple speakers, would be to only play it in the room you are in.

For example using motion sensors to detect the room motion was last seen in.

Now you can do that in a rule but it requires a lot of “if”

If you could setup a variable representing a device (like a speaker).

Rule 1 sets that Device to a speaker based on motion.

Then rule 2 could be “stupid” and play the notification on the “closestSpeaker” variable without having knowledge of which speaker it actually was. The first rule would have already set it.

That way when you setup N rules for speaking, you only need the “if” logic tree in the first rule that sets the variable.

If that makes any sense.