Hi all. Hope someone might be able to help me.
I have contact sensors on multiple windows.
I have a shutdown routine prompted by a voice command thats turns all the lights off at bedtime.
What I would like to include in this routine is for each contact sensor status to be checked and for alexa to tell me if i have left a window open (and which one) before i head up to bed.
Any clever folks out there have any suggestions?
Thanks in advance
You could create a virtual contact sensor or switch with an unique easy to say name.
Then write 2 ST routines.
- If ANY contact sensor is open then the virtual contact sensor is open.
- If ALL contact sensors are closed then the virtual contact sensor is closed.
Then at any point in time you can ask Alexa if the virtual contact sensor is open or shut.
You could also go 1 step further and write Alexa routines to automatically fire when you trigger your good night routine.
Hi Paul thanks this sounds great. So i have set up the 2 routines using a virtual switch as you suggested. So now if ANY of the contact sensors is open Alexa says “a window is open” and if ALL the sensors are closed she says “all the windows are closed”
But this triggers at the time when i open the window or shut the window. How can i stop this happening and how could i trigger this routine within the night time routine?
Add an additional condition to the automations for “Night Mode”. When you put the house to sleep, they should run.
I believe you can only have 1 trigger (if) in an Alexa routine, so you need to make the change on the ST side.
As @blueyetisoftware suggested you could add Night Mode as a precondition on your 2 ST routines. Your good night routine could put the house into Night Mode.
To trigger a SmartThings routine within an Alexa routine have the Alexa routine turn on a virtual switch and have that virtual switch being on be one of the preconditions in the SmartThings routine.
That way when you tell Alexa good night to start your Alexa good night routine the switch will turn on and if all the other preconditions are true the ST routine will run. You will need to turn the virtual switch off again so it’s ready for next time.
Thanks all great suggestions and it works well for when all conditions are true…ie all windows closed and virtual switch 1 on >> virtual switch 2 closes >> alexa routine to report all windows closed. However…
…in 2nd routine in ST, the condition is ANY window is open >> virtual switch 2 opens >> alexa reports a window is open. If I add virtual switch 1 to this then virtual switch 2 would open even if all the windows were closed. Unless there is a way to have a group of IFs & AND condition.
Hope this all makes sense…HELP!!
If you use a precondition it works as an and in addition to your other ifs
Paul thats awesome and I thought i had it cracked. Got it working now for windows all closed but not for an open window. Let me show you what ive done see if you can see a fault.
Thanks JD. Ive set that up but it isnt working and i cant see why not!! Do you knownif it has to be certain virtual switch for preconditions? Mine is virtual contact sensor. I have used same type for closed routine and that works great (not a precondition but closed with all window sensors triggers alexa to say all windows are closed. Its bugging me but i am determined to get this to work!!
Your flow chart looks ok, and your ST routine looks ok.
So I have 2 guesses:
- Is ST getting confused by too many “any conditions” in your routine. You could test by eliminate all by 2 contact sensors and test to see if it works. If that is the case you would need to break it up.
- You didn’t show you Alexa routines so there might be an issue there.
FYI: You can combine TSS1 and TSS2 into a single virtual device and it can be a virtual switch. It does not need to be a virtual contact sensor.
I’ve only skimmed this thread and have limited experience of Alexa routines. But a quick thought …
My approach would be to have a couple of Routines on SmartThings to open/close a contact based on the state of the windows and on the Alexa side use that contact to enable or disable the warning routine(s).
Then on the Alexa side do whatever is needed to trigger the warning routine(s) in your Good Night routine.
I haven’t looked into this deeply so I can imagine there may be practical issues.
So i tried dropping it to 2 devices…its still not happy and wont open WSS1.
At moment im considering a seperate automation for each window but sure there will be conflicts then when 2 windows are open.
The Alexa routine is dead simple…here it is
Hi Paul. Ive tried this now reducing to 2 devices. Still not working…the trigger switch wont open the 2nd sim switch at all. Bit stumped
When things quit down here tonight, I recreate your automations and see what happens.
That routine will turn on WSS1 if either window contact opens while TSS1 is already switched on.
I’ve not been following the thread but I think what you want is for WSS1 to be turned on if TSS1 is switched on when any contact is already open.
If you have a TSS2/WSS2 routine that looks for all windows being closed then you can do that with the windows being the pre-conditions amd TSS2 the condition, but for TSS1/WSS1 you need an extra routine.
I am assuming that TSS1/2 and WSS1/2 all start in the off state as SmartThings typically suppresses changes.
Ok, I figured this out using a clue from @orangebucket.
You need 2 routines.
- Use first 1 to combine all the contacts into a single contact. So if any contact is open then the Summery Contact is open. You also need a routine to reset the Summery Contact when all contacts are closed.
- Then use the Summery Contact as a precondition in the second routine. And then use your night time routine to trigger Alexa to speak.
FYI: All my virtual devices were created using @ygerlovin “vDev Controller” which creates virtual Edge devices with hidden contact sensors that can be used to trigger Alexa
You are a fricking genius it works!!! My dream was have Miss A tell me which window but I can live with this! Unless you can go one step futher a d get her to tell me which specific window, or list the windows that are left open…no worries if not tho dude Im over the moon to getthis working thank you!!!
You are welcome, happy to help.
It was @orangebucket clue about what was needed in the precondition that made it work.
To get a customized response for each window you would need a separate ST and Alexa Routine for each window and door. It would actually be easier.
Keep in mind that ST has a 200 routine limit and Alexa has a 100 routine limit.