SmartThings Community

Water leak sensor with alexa routine?


(Jamie Ashby) #1

Hi all, Not sure if this is possible. as i believe only contact sensors work within alexa routines?

Ive just bought one of the new water leak sensors and ideally id like to setup a routine in alexa so that when the sensor detects water i can have alexa announce this or play a audio file.

Can anyone tell me if this is possible?

Many thanks


#2

Fortunately, SmartThings allows you to create virtual contact sensors which Alexa will treat like real ones—and you can even turn them on and off like a switch. :sunglasses:

So assuming you have a Samsung SmartThings system, it becomes pretty straightforward.

  1. create a virtual contact sensor with switch capability.

  2. set up a SmartThings rule to switch that sensor on when the real sensor activates.

  3. create an Alexa routine (not a SmartThings routine) that runs when the virtual sensor activates. (Make sure you switch the virtual sensor off again so it will be ready for the next time.) :sunglasses:

Please read the following FAQ (this is a clickable link) and then we can discuss any further questions you still have.


(Jamie Ashby) #3

Ah great thankyou. Ive created a virtual switch but can you tell me how i go about creating a smarthings rule to switch that on when the real sensor activates.

Thanks


#4

Did you read the FAQ I Linked to?

It can’t be a virtual switch. It has to be a virtual sensor that has switch capabilities. And the code for that is in the FAQ.

Once you use that code, it will show up as a switch just like any other switch anywhere in SmartThings. But turning it on will also cause the virtual sensor part to be “open.“

As far as a rule, you just have to find one which would trigger a switch to come on when the real sensor triggers.

Usually that’s the official smart lights feature, but to be honest I don’t remember if that will trigger from a leak sensor. If it doesn’t, you should be able to set up a custom alert in smart home monitor that will do it. :sunglasses:


(Tony Fleisher) #5

You can. The trigger is called “Water Leak”


(Glen King) #6

Now ya see, this is exactly the reason I occasionally scan these forums.

Currently, I have ST making the announcement “bathtub is full” via Alexa Speaks when my Utilitech sensor detects it. Certainly it would be more efficient to simply have Alexa detect a simulated sensor open, and broadcast the message itself.


(Jamie Ashby) #7

Ok thanks guys, I’ll have to have a play and try and get it to work. Reading the FAQ I’ve installed Alexa helper but there’s so many options I’m unsure on what I’m doing.


#8

You shouldn’t need Alexa helper at all for this: It doesn’t create the right kind of virtual devices and you’re just going to use the built-in Alexa features.

The code for a virtual sensor which has switch capability is in post 97 of the FAQ I already gave you. That’s the one you want.

( I know that FAQ needs to be rewritten as an article in the community wiki, I just haven’t felt up to doing it last couple of weeks. It’s a lot to read through right now because it’s conversation as the features were being released. Sorry if it’s been confusing. )


(Glen King) #9

Update: doing it as I outlined a few posts go isn’t quite as awesome as I imagined. Unless I’m missing something, an Alexa routine is tied to only one Echo. It’s a PITA to write six routines to do the same ting on six echo devices… and the routines don’t play from ecobee devices


#10

You missing something. :wink:

If you want to have announcements from multiple devices at the same time, you use the “messaging” choice when you create the routine ( instead of the “Alexa says” choice). That let you pick all devices or multiple selected devices for the announcement. :sunglasses:


(Glen King) #11

Thanks JD - my 1st routine in Alexa, you’re a great help as always


(Jamie Ashby) #12

Sorry this maybe a daft question but where is post 97? I can’t see any device handler.

Could anyone do me a step by step I’m a tad confused. I just want Alexa to announce when waters detected. Can’t get my head around this.

Thanks


#13

Post 97 is the 97th post in the thread. The thread title is a clickable link.

FAQ: Using Contact and Motion Sensors to Trigger Alexa Routines (DTH in post 97) (Official Amazon Feature)

It was posted on August 31 by BJPierron…
.


(Jamie Ashby) #14

Apologies I’ve found them and added them in the smarthings IDE but now how do I use them?


#15

Sorry, I’m not feeling well and I’m not up to writing out the step by step for you. Someone else will need to do that.


(Jamie Ashby) #16

Ah ok no problem. Thanks for your help so far.

If anyone would do me a step by step that would be much appreciated. I’ve used ST’s a while back but for the life of me can’t get my head around this

Many thanks


(Jamie Ashby) #17

Just coming back to this. Ive now created a virtual simulated contact sensor using that device handler called water detected. I can see this on my smarthings dashboard as a contact sensor. {closed}

My amazon echo sees this and allows me to setup a routine when this is open itll tell me theirs a water leak. im still struggling to find a way to trigger this using the physical leak sensor i have. Ive tried the smart lighting app but this will only allow me to control a outlet or light bulb?

Can anyone tell me where im going wrong? I feel like im nearly there :slight_smile:

Thanks


(Jimmy) #18

The device hanlder JD linked you to should be exposed as a switch in smart lighting. So create a device using that handler and then create a smart lighting rule to turn on that device when moisture is detected by your leak sensor.


(Jamie Ashby) #19

Ok ive done that and its setup using the smartlighting app and it switches on when the leak sensor detects water.

Now its a switch though rather than contact sensor alexa wont allow me to use this within a routine. ill go the my alexa app it discovers it as a switch but if i go to routines and try and create one it will only allow me to select a sensor device (motion/contact) not a switch


(Jimmy) #20

It should show as both. you’re using the device handler with namespace: “bjpierron” right?