OK so I've got this routine working quite nicely, thanks to those who helped me out already especially @BorrisTheCat for the information on variable and switch connectors, that actually made simplifying my other rules much easier too!
I've got the routine working almost as I want it but I can't work out one thing, I have an IF - ELSE clause in the rule as you'll see below, I wanted to make it so that the notification under the IF statement would return saying that %device_name% was still open. however that didn't work when I tried it as it returned a device name of "Nighttime" which is my local variable. I'm presuming maybe I have to create local variables for each contact sensor to be able to call the ones that are open?
As I couldn't get this to work I changed the announcement to be "There are doors or windows still open, Please close them immediately, the alarm will be set in 4 minutes"
Ideally I want it so that if the IF is triggered it will return a notification sating which doors and windows are still open based on the contact sensors it's checking.
I've stared at this for a few days pondering how to make this work but i'm stuck .
I want the action under the if statement below to return a statement identifying which contact sensors are still open.
So here's what I have so far: