Door Sensor + Google Home + IFTTT

Morning,

I just recently got a SmartThings hub, a Google Home and a door sensor. My plan when buying the sensor was to set IFTTT to tell the Home to play an audio clip (ie; “front door open” at wake hours or alarm sound at night). After some digging around I haven’t had any success finding a way to do this. Does anybody have any input that might help me out? I greatly appreciate it!

Google Home and Amazon Echos don’t initiate other than perhaps an alarm timer…like for waking up in the morning. You have to start the conversation, before they say anything. Unless something changes, you need another device. Wifi Speakers, VLC with VLC Thing, and send the audio you want through them instead.

You might try this Use this hack to get voice notifications with the Google Home. I ran across it the other day and thought it would be cool to get notifications from Home. I plan to test it later today hopefully.

1 Like

Update:

I was somewhat successful in getting this to work. I used a Multi Sensor, SharpTools, Tasker and Autocast (latest beta). SharpTools monitored the Multi Sensor contact and when opened or closed it would react in Tasker to launch AutoCast, which then played an audio file to Google Home announcing a change in status of the Multi Sensor.

It does fail on occasion but successful in about 9 out 10 times. I am trying to figure out the reason for the failures now.

1 Like

Thanks for the reply. Would you mind taking a screenshot of your settings for this setup? I have all 3 apps installed but I’m new to Tasker and it’s a bit confusing to me.

Sure, I’ll try my best to walk you through it. However, bear in mind I am no expert in Tasker either. I just followed some examples and did a lot of trial and error. I use 2 tasks in the Profile: a visual notification task (so I can tell if the event triggered) and the AutoCast task.

Best to use this example by SharpTools for an Event: Thing State as a guide for setting up SharpTools and Tasker. Here are some screenshots:

Tasker Profile


In the screenshot above for Thing State, you will want to enter the name of your “Thing.” The Attribute may be “contact” like mine or it could be something else depending on your Thing.

Tasker Tasks


Your variable in the If statements may be %st_attr_value or it may be something else, double check. Note: I am not 100% sure that the If statements are needed, but it is working as is so I’ll leave them in for now.

AutoCast


Cast Device = your Google Home name, select to set.
Under Screen, select Full Screen Media Screen, back, then go to Full Screen Media elements

Select Audio, then Audio (Song to Play) and select the audio file you want to use. Click OK, back and back.


Before you click the check mark, go to Advanced and select Wait For Result.

Go back, click check mark, click back, back and back to exit Tasker and save the Profile/Task(s).

Next test the action by opening and closing the contact. You should get a visual notification at least and hopefully a Google Home announcement. You can also monitor the logs under AutoCast to see if that part is working. If it fails, try rebooting your device and Google Home.

8 Likes

You are the real MVP! Thank you so much. I’m going to try this out this evening.

Thanks for this!

What type of delays are you seeing with this setup? (ST trigger to GH sound output)

I tried the BubbleUPnP server and it was anywhere from 6-10 seconds delay from ST trigger to GH sound output.

Normally about 2 seconds. As I had mentioned above it does fail on occasion and I have not figured that out yet. I say “fail” but it might actually be a delay for several seconds and I impatiently try, try again. From observing the logs, it appears it may be due to ST and a delay there. I’ll keep trying to nail it down.

I’m trying to get this to work with the latest AutoCast that has the SPEAK command that does text-to-speech. set it up to respond to an open status on my door but no luck so far getting anything to play from GH. odd thing is that when I select a cast device my only option is “first available device” not the name of my google home. however the casting works fine from google play music, etc…

2 Likes

Well I got the AutoCast Speak plugin working, so now I am getting text-to-speech notification of smart things events without having to make a prerecorded sound file for each event.
The Autocast plugin is still a little weird with letting me choose the correct cast device but it seems to be casting notifications to my chromecast.
I actually used the tasker code made by @ZebraBlinds for voice control profiles to get the variable names for all my things (found in this thread Tasker + Autovoice + Sharptools Android ST Voice Control Profiles )

3 Likes

@smpatel2 Can you share how you do this?

Have you tried setting the cast devices in the Autocast app itself? I believe you have to set them in the app first before they will show up in the plugin.

Now, off to to replicate what you did with the variables.

ohhhhh! duh. that fixed it, thanks[quote=“bne, post:13, topic:65797, full:true”]

Have you tried setting the cast devices in the Autocast app itself? I believe you have to set them in the app first before they will show up in the plugin.

[/quote]

@emersonvier
not sure how in-depth you need? Have you got sharptools and tasker going?
I installed the AutoCast plugin for tasker. I stole /repurposed a tasker script from the link I posted that monitors your “things” and relays state to tasker variables.
Then using the AutoCast plugin there is a tasker action “Autocast Speak”, in the options for the Autocast speak action you can place text or variables
so you can set up a tasker action that states IF %st_thing_state = open then autocast %st_thing_name %st_thing_state
therefore if any “thing” has a status change to = open, it will announce something like “front door open”

sorry if that is confusing, I barely know what I am doing

1 Like

The variables are working good. My GH now informs me when the temperature on the back patio changes and announces the current temperature. Well done.

@smpatel2, Yes I have all the app installed, I made some test, I need help about “text-to-speech notification” I made this in other way, I made files like open.mp3/close.mp3,

Using very simple, one-syllable words (like if you were speaking to a cave man) can you tell me how you used the Tasker code from @ZebraBlinds to get the variable names for your things? :slight_smile:

I have his tasker profiles installed (Recognize Devices & Voice Action), and am using them to control my devices by voice from my phone, but would love to enable some of these voice notifications.

Thanks for any help.

@Danabw @emersonvier

I’m still pretty new at tasker but here goes

ok if youre already got Recognize Devices running then you’re almost there
EDIT: I think I was wrong, you just need the the Thing State Thing profile and the Fetch All Devices task, Recognize devices I think is just for voice control? I might have misunderstood what it does. anyway continue as below

Just set up the below example and you will start to figure it out

You need to get the AutoCast tasker plugin from the play store. Run the Autocast app and select your google Cast device that will be playing your notifications.

In tasker, create a new task
in your task go to “Plugin”, Select AutoCast, Select Speak
In Configuration select your Device you want cast to
Click on “Text”, write the following: %st_thing_name open
Click your little checkbox in the upper right to approve
now under the IF command put in %st_attr_value ~ open as your IF command

ok now when any of your devices has a event state change to “open”, you will a voice notification saying " thing open "

thats as far as I’ve gotten so far. theoretically you can use any attribute (look under the smarthings IDE at one of your Devices under States) for example you could use IF %st_attr_value = active for a motion sensor going active.

3 Likes

@smpatel2 Thank you, works here, now I will test other thing :smile: