Room Variable?

I'm using the Basic Rules App.

I have a rule that sends the following notification to my phone:

%date% at %time%. Leak Sensor %device% has detected water in location %room%. State is %value%.

All the % variables work except for %room%.

Is it possible to dynamically send the room location?

For example. I'd like to get a notification such as:

11-Jan-2025 at 14:22. Leak Sensor LS1 has detected water in location Hall Bath. State is wet.

(I realize I could probably use the more advanced rule builder, but the Basic Rules app works for for all my other use cases currently).

(I saw another post where this was requested in 2022. It seems like it would be a simple addition, considering the other variables that are supported, not to mention a logical one to add).

I think it's for this very reason so many users name their devices [room_name] [type] [label], e.g. Hallway Motion Sensor 1

But to answer you more directly, no such system-wide substitution variable %room% exists (yet).

1 Like

Thanks. Sounds like that’s what I’ll have to do.

Hopefully that variable gets added in the future.

What made you choose to use the %room% variable? Is it referenced somewhere that made you choose to include it in your message?

Can't say I have used these kind of things much myself. Just thought it was worth asking in case someone else sees what you have and makes the same assumption.

It may also be worth posting separately under the feedback category your suggestion for a room variable.

I use speech output a lot. Variables are a very convenient way to create useful messages. Very useful for parsing logs, etc. I wish they were more available.

I found the name variable and assumed (wrongly) that room (and others would be available).

A number of years ago I created my own IoT automation platform and used user-accessible variables. Incredibly useful in logic to extend rules engines. The ability to create counters for events, checking conditions across devices and the environment as well as more robust output can’t be understated in a comprehensive automation platform.

1 Like

Agreed that Rule Machine would benefit from additional built-in vars like you're suggesting, and support any request you make along those lines over in the Feedback category.

In the meantime, do check out Webcore, as it already offers built-in references (I'm just not sure about one specifically for Room).