I just wrote a small app to do this for me (doors were my intent, but windows would certainly also work):
If you don't want to use custom code, that post also contains a screenshot of a rule this replaced. As noted above, %device%
and %value%
refer to the triggering device, so the best way I've found to do this with RM is manually building a string using a series of conditionals (here, "Speak Lock Status" is a virtual momentary-ish switch I turn on when I want this announcement):
I don't see why the suggestions above wouldn't work, either; this is just what I happened to use myself. As you noted, the Notifications app won't work--that's more meant to respond to specific events, not evaluate specific conditions on demand.
Either way, there's a reason I wrote the app (I didn't like the other ways).