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


#1

So I’m looking to do something fairly basic, I think. I have a SmartThings multipurpose sensor on my garage door, and an LFM-20 Z-wave switch attached to the door opener. The switch is in virtual momentary pushbutton mode.

Today, I can say “Alexa, turn on the Garage Door opener” and it will momentary press and the door will move to the opposite of the position it’s in (open/closed)

What I’m looking to do is to be able to say “Alexa, close the garage door” and get a response of either “the door is already closed” (based on the multipurpose sensor’s position) or “ok, closing the door” (the latter followed by an action) - and of course, the inverse of this where I tell her to open the door and she detects if it’s open or closed and responds accordingly.

Has anyone seen an integration like this?


#2

Tagging @MichaelS


(Micheal ) #3

Thanks @JDRoberts!

@jawn101 Ask Alexa already does something like this with the integration garage door opener(like the Linear model). However when you do it with different devices I am not 100% sure it will work. I recommend trying my app and if it doesn’t work I can work with you to integrate it.


#4

Aha! I do have the Ask Alexa integration set up but I haven’t really used it for much, and am not entirely sure how to connect the dots here within it. Open to suggestions!


(Micheal ) #5

The actual Ask Alexa app or the native integration with SmartThings?


#6

Oh, I didn’t know there was an app other than the SmartApp I loaded into SmartThings.

This is what I have

28 PM


(Micheal ) #7

That is the one! Did you ever get it running or just installed it?


#8

It’s installed and works as far as I can tell - I can ask it the status of sensors and it appears to be providing responses. Though TBH I’m not sure if those responses are coming from your app or SmartThings natively :slight_smile:


(Micheal ) #9

Status is not supported by the native integration so if you are saying “Alexa, ask Smartthing about the Living Room” (Or something like that) then it is working.

I would then go into the doors area and see if you can control the garage door.


#10

OK, great! As a test I just asked Alexa “ask SmartThings about the office window” and she responded that it was open. So that means your app is functional?

So, again - forgive the noob questions. “Go into the doors area” - not sure how to do this. I can control the door via the SmartThings app natively, as I said (alexa, tell smartthings to turn on the garage door) but that’s not routed through your app I don’t think.


(Micheal ) #11

Yep…Very good…you have Ask Alexa working!

As for the question, there is a main menu item called “Doors/Windows/Locks” where you can add the sensors for your doors…If you start anything with “Alexa, Ask Smartthings…” it is going through Ask Alexa. So, that is working?


#12

Yep, same configuration for the door as a window: “Ask SmartThings about the Garage door” = “The garage door is currently closed”


(Micheal ) #13

So I guess I am unclear on your question as you can also control the door through the app as well.


#14

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.


(Micheal ) #15

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…


#16

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.


(Micheal ) #17

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:


#18

There are two ways to tie two devices together in this manner. The first is with webcore, but I don’t know how well that integrates with ask Alexa.

The second is to use Mike Maxwell’s universal virtual device type handler and have the switch report as a motion sensor, and then use his zone manager smartapp to combine the two motion sensors into one zone which would look like one motion sensor to askAlexa.

.

So it’s sort of a Rube Goldberg approach, but it should get you where you want to be in the end. :sunglasses:


(Micheal ) #19

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.


(Jason) #20

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.