How can I make Alexa detect a sensor status and carry out an action based on it? (Garage Door use case)

What I’m looking to do is make a more natural language, state-aware integration. So instead of a two-stage “ask about the garage door” followed with “turn on garage door”, I’d like to actually say “close the garage door” and have Alexa check the state and respond accordingly.

That is currently what it does with a single device. For example, I have a Linear Garage Door opener that is both a control mechanism and a tilt sensor…If I ask Alexa to close the door and it is already closed it will respond back that it is already closed. The issue you are looking to solve is to tie the two control mechanisms together…right now SmartThings sees those two devices as separate…correct?

I could add a method that you could define a momentary switch and sensor as one device and control it…Quite honestly I thought there was already a DTH that did it and presented the two devices together as one…This would then allow apps to control them using the default method. Or you could purchase a Linear Garage Door opener :slight_smile:

Let me know if that sounds about right…

Yes, thats exactly right! They are two separate devices, as I retrofitted my existing door opener with a z-wave switch and a sensor, rather than replacing the whole unit. So the goal would be to combine them for the purposes of this integration.

Have you looked for a custom DTH that ties the two devices together as a single device. Selfishly, that would keep me from coding this in, but holistically, it is a more ‘supported’ way of doing it. I can certainly add something like this to Ask Alexa in the next version, but it is really a hack and I am almost positive a single DTH exists that combines two devices into a single unit.

@JDRoberts do you recall what I am referring to? Or am I hallucinating again :slight_smile:

The end goal is for a single ‘device’ to appear to Ask Alexa (and all other SmartThings apps) as a combined device like the linear garage door opener. @jawn101 If this does what you need it to, we are done and it should work in all standard apps…if you can’t get this to work let me know as this would indicate there is no other way to do this and a solution in Ask Alexa would be a good investment as I am sure you are not the only one with this setup. However, I REALLY recommend the Linear setup…it is clean, simple and has never once failed me. It also complies with 2017 standards of sounding an alarm if the door is about to make a movement on its own…something a simple relay and level sensor probably doesn’t give you.

1 Like

I have a Ecolink Tilt Sensor and a Remotec Zwave Relay to operate my garage door.

I use a modified simulated Garage Door DTH for the tilt sensor. I started with this below and modified it for appearance.

I then used this smart app to link the relay button to the tilt sensor that has the Simulated Garage Door DTH.

Then to make sure the relay turns back off I use webCoRE to turn it off 1 second after it turns on.

1 Like

Yeah, that’s the end goal here. I’m not aware of the Linear setup you speak of, but I know there are some limitations to how I’ve rigged it up. The door does have an electric eye that stops it moving if there are objects in the way, so I felt safe doing it the way I did.

I’m looking at that DTH whicih JDRoberts posted above but it appears the git repo is dead, I tried to add it and nothing pulls.

Ok…there is another post above that may help as well…again, let me know your results as I can certainly put in some code to get this to work.

Also, here is the linear device…it is inexpensive and works great.https://www.amazon.com/GoControl-Linear-GD00Z-4-Z-Wave-Controller/dp/B00M75TEIU/ref=sr_1_3?ie=UTF8&qid=1506980696&sr=8-3&keywords=linear+garage

Oh, neat. That is a nicely packaged solution, and would have even been cheaper than what I ended up doing with the two-device solution. Not sure I want to splurge on a replacement for it just yet, though - if I can’t make this work in software I’ll reconsider that. :slight_smile: Thanks for sharing!

Hey, another thing. I just noticed that it looks like I might have installed your Ask Alexa app from source rather than a Git repo. So I imagine it’s pretty outdated. Header of the file says the following:

Version 2.1.9a - 11/20/16 Copyright © 2016 Michael Struck

Is there a repo I can update from? :slight_smile:

Ouch…you ARE out of date…I have added a lot since then…I actually recommend you follow the direction to start over. If you have a lot of items already set up I think a PM would be a better way to go through an upgrade if you want to retain some items without orphaning others.

http://thingsthataresmart.wiki/index.php?title=Ask_Alexa

Hey, thanks for the tips here. I tried this but it doesn’t seem to be what I want…

Maybe I’m not thinking 4th dimensionally (I have a really hard time with that, Doc) - but after installing that DTH and SmartApp, it seems that it’s just a way to link a switch to a sensor, but I’m not sure how that helps me out. Plus, since it’s a SmartThings Multi-sensor, it now reads “open” no matter what since it’s set up in garage door mode, so no magnetic contact - rather it’s supposed to be in a vertical-vs-horizontal configuration to sense open vs closed.

So, that doesn’t seem to do what I’m after unless I’ve missed something else :slight_smile:

ok…have you decided yet on if you are purchasing the full unit? If not I can put it on my list to create a sort of integration within Ask Alexa.

I think it would be awesome to see it there - but it’s not like an urgent ask or anything!

I already mapped out how to do it…but not sure when I will implement it.

Did some research…see this:New smart app to link the virtual/simulated garage door device with two actual devices

Should allow it to work with Ask Alexa…you will need to also search virtual garage door…read through the thread.

1 Like

I actually set up this one: Ridiculously Simple Virtual Garage Door

And enabled it in Ask Alexa with no trouble at all. Worked perfectly! Thank you for your guidance today, it was much appreciated and very helpful

1 Like

Exact same problem as you. I’m trying to get this set up. Can you help?

What garage door opener are you using?
In your Things tab, does the garage door show an On & Off button?

If it shows the On & Off then you can do this…

In the Amazon Alexa app set up a Routine:
When Alexa hears: Open the garage door
Alexa will: Turn on garage door

Create a second one:
When Alexa hears: Close the garage door
Alexa will: Turn off the garage door

I’ve been using this for a long time and it works perfectly.

Also, if you are using EchoSistant you can do the same thing.

Thanks.

I already have this working. I’m using an LFM-20 relay switch, set as a Virtual Momentary Switch in the ST IDE. So, when it triggers, it turns on and off again. This opens the garage door. The next time it triggers it turns on and off again. This closes the door. Have the exact thing you suggested also set up in Alexa.

However, I want it to work where the door will only open/close after checking the door’s position. I have a contact switch on the garage door which will tell me if it’s open or closed. I want to set it where I can arrive home, for instance, and if the door is closed, it will open. If it’s already open, it does nothing.

Currently, if I arrived home, the door will simply change states.

This Ridiculously Simple Virtual Garage Door purports to do exactly what I’m wanting, but I"m having trouble setting it up. Any help?

Thanks.

I already have this working. I’m using an LFM-20 relay switch, set as a Virtual Momentary Switch in the ST IDE. So, when it triggers, it turns on and off again. This opens the garage door. The next time it triggers it turns on and off again. This closes the door. Have the exact thing you suggested also set up in Alexa.

However, I want it to work where the door will only open/close after checking the door’s position. I have a contact switch on the garage door which will tell me if it’s open or closed. I want to set it where I can arrive home, for instance, and if the door is closed, it will open. If it’s already open, it does nothing.

Currently, if I arrived home, the door will simply change states.

This Ridiculously Simple Virtual Garage Door purports to do exactly what I’m wanting, but I"m having trouble setting it up. Any help?