Amazon Echo to trigger and announce a report via Sharptools


(Ernie) #1

I have setup two different types of reports that can be requested by the Echo and announced by the Echo. The set up is little different for each in the way the code is setup. My thermostat or temperature report uses Sharptools to collect the information. As Sharptools assigns the same “name” to the information gathered, I assign a new variable name for the information for each device. Then at the end I have one report with the variables plugged in. Please note that attributes vary between devices and device types used. Your thermostat and temperature sensors will likely have different attributes reported than mine. When subscribing to these attributes in Sharptools it will show you a list of what’s available.

The second report I setup checks the status of doors and locks. While I don’t use variables here, it is slightly more complicated because I link two tasks. The first task checks doors and locks, and transfers to the second task if it finds anything open. If nothing is open, the first task continues and will announce that everything is secure. The second task will announce each door that is open and end with the statement “End of report.”

The steps below are written for someone with limited Tasker experience. I am no Tasker expert and there maybe better ways to achieve the same result. This is what worked for me.

Before starting the steps below you need to have installed and setup Sharptools. Additionally, you need to have created a Momentary button tile for the Echo to activate. My activation phrase is “Alexa, turn on Thermostat Report.” Finally, the Echo needs to be paired to your device.

The first step is to setup a new task. In Tasker, select the Tasks tab at the top. Then select the plus sign at the bottom and name your Task. Below is what me completed Task looks like. The steps below match the Task numbers.

  1. In your new Task, press the plus sign on the bottom. Next select the box labeled Plugins. Now select Sharptools. This will open up a Sharptools dialog box. Select “Things: Get Attribute.” This will open an Action Edit screen in Tasker. Press the large pencil icon on the Configuration line. This opens the Sharptools selection screen seen below.

Select the device and attribute you want to monitor and hit Apply. This will take you back to the Action Edit screen. Tap on “Action Edit” at the top to go back to the Task screen. You should now see line 1 of your Task.

  1. Select the plus at the bottom. Select the box labeled Variables. Next select Variable Convert.

In the name field enter %st_attr_value. This is the value retrieved by Sharptools. On the Function line select the triangle at the end of the line. Scroll down and select “To Lower Case”. Next, on the Store Result line enter %”whatever text you want”. The Label line is optional and only provides a label in the Task screen. Click on Action Edit to return to Task Screen.

3 & 4. Repeat steps 1 and 2 for as many thermostats and temperature sensors you want in the report. Just make sure the names in the Store Result line is different each time.

5 & 7. These steps just set the volume on Echo for the report and after. Select the plus at the bottom. Select the Audio box. Next select Media Volume. Enter your choice of volume. Click on Action Edit to return to Task Screen.

  1. Select the plus on the bottom. Now select the Alert box. Next select Say. My setup is below.

For text enter what you want the Echo to say. Make sure you include the variable names you setup. Next select the Engine Voice. I used Ivona with the British accent. Then make sure to choose Media under Stream. The voice pitch and speed can be set to your taste. I don’t check any of the other boxes.

Now hit the play button at the bottom left to test your Task. Then hit the Task Edit at the top to save your Task.

Now you need to create the profile to trigger the Task. Click Profiles on the top tab. Next click the plus on the bottom right. Now click on Events. Select the Plugin box. Then select Sharptools. Select Thing State. Select the pencil on the Configuration line. Now write in the name of the Momentary Button Tile you created for this report. Leave the Attribute line empty. Hit Apply. Now hit Event Edit at the top. Now you will need to pick the Task you just created.

That should be it. Good luck.
If anybody would like a walk through for the other type of report I created please let me know.


Amazon Echo DOES Voice Notifications!
Speaking push notices from ST through Tasker?
Amazon Echo DOES Voice Notifications!
(Joshua Lyon (SharpTools.io Dashboard)) #2

Excellent write-up, Ernie! Thanks for sharing this!

The great thing about this approach is you can use it as a standalone announcer directly from your phone/tablet or you can pair your phone/tablet with the Echo or any other speaker. You could even take the concept you put together and use it to send an automated email report or pushbullet notification instead of using the “Say” command!

One minor edit suggestion: In the final step where the ‘Thing State’ event plugin is being created, the user will also need to subscribe to the attribute for the Momentary Button Tile from within the main SharpTools UI. To do this, the user will need to open SharpTools, long press on the Momentary Button card, and select 'Subscribe to momentary".


(IdahoPage) #3

Hi Ernie, I would like to thank you for doing a great job explaining how to set up Amazon Echo to announce a report. I’m new to SmartThings community but I have learned a lot from people like you that explain things so well. I have added some door open/close sensors to my smartthings hub so I’m really interested in how to set up the Door report. Can you send or post a walk through of how to set up this report? I would really appreciate it. Thank you.


(Ernie) #4

The door report requires 2 tasks and a profile. The first task checks if anything is open and if nothing is open it will state that everything is secure. If any door or lock is open the 2nd task is called. The 2nd task checks what is open and will state each open door.When it gets to the end it states “End of the report.” I will go through task 2, then task 1 and finally the profile.

The example is showing a shortened version of the tasks. Certain steps will need to be repeated to include all the devices you want the status of.

Please create a Momentary button tile and setup Sharptools before starting the following steps.

Goto Tasks Tab. Hit the plus on the bottom and name your task.

  1. Set the media volume. Hit the plus on the bottom. Select the Audio box. Then select Media Volume. Set the volume to level you want. Hit Action Edit on the top right.

  2. Hit the plus on the bottom. Select plugins then select Sharptools. Then select Things: Get Attribute. Now select the pencil on the configuration line. Now pick the door, window or lock you want to monitor. Next select the attribute. For the lock choose lock. For doors and windows select contact. Hit apply. Hit Action Edit at the top.

  3. Select the plus on the bottom. Now choose the Task box. Now select If. On the left line enter “st_attr_value”. Select the “matches” operator symbol ~. On the right side enter “unlocked” for locks or “open” for contacts. Now hit Action Edit.

4 Select the plus on the bottom. Now select the Alert box. Next select Say. For text enter what you want the Echo to say. Make sure you include the variable names you setup. Next select the Engine Voice. I used Ivona with the British accent. Then make sure to choose Media under Stream. The voice pitch and speed can be set to your taste. I don’t check any of the other boxes.

5 Select plus at the bottom. Select Task box. Now select “End If”. Now hit Action Edit.

Repeat steps 2,3,4 and 5 for every device you want included in the report.

6 Follow the same procedure as step 4. I use this announcement so I know the report is done.

7 Reset the media volume as in step 1.

Hit Task Edit at the top.

Now for Task 1. As in Task 2, this example is showing a shortened version of the task. Certain steps will need to be repeated to include all the devices you want the status of.

Goto Tasks Tab. Hit the plus on the bottom and name your task.

  1. Hit the plus on the bottom. Select plugins then select Sharptools. Then select Things: Get Attribute. Now select the pencil on the configuration line. Now pick the door, window or lock you want to monitor. Next select the attribute. For the lock choose lock. For doors and windows select contact. Hit apply. Hit Action Edit at the top.

  2. Select the plus on the bottom. Now choose the Task box. Now select If. On the left line enter “st_attr_value”. Select the “matches” operator symbol ~. On the right side enter “unlocked” for locks or “open” for contacts. Now hit Action Edit.

  3. Hit the plus at the bottom. Select the Task box. Now select Perform Task. Now select the magnify glass on the name line. Now pick the task you previously created. Hit Action Edit.

4 Hit plus. Select the Task box. Now select Stop. Hit Action Edit.

5 Hit plus. Select the Task box. Now select Else. Hit Action Edit.

6 Hit plus. Select the Task box. Now select End If. Hit Action Edit.

Repeat steps 1 through 6 for device you want reported.

7 Set the media volume. Hit the plus on the bottom. Select the Audio box. Then select Media Volume. Set the volume to level you want. Hit Action Edit on the top right.

8 Select the plus on the bottom. Now select the Alert box. Next select Say. For text enter what you want the Echo to say. Make sure you include the variable names you setup. Next select the Engine Voice. I used Ivona with the British accent. Then make sure to choose Media under Stream. The voice pitch and speed can be set to your taste. I don’t check any of the other boxes.

9 Set media volume as in step 7.

Hit Task Edit at the top.

Now you need to create the profile to trigger the Task. Click Profiles on the top tab. Next click the plus on the bottom right. Now click on Events. Select the Plugin box. Then select Sharptools. Select Thing State. Select the pencil on the Configuration line. Now write in the name of the Momentary Button Tile you created for this report. Leave the Attribute line empty. Hit Apply. Now hit Event Edit at the top. Now you will need to pick the Task you just created.

Good luck.


(IdahoPage) #5

Ernie,Thank you so much. It works great :slight_smile:


#6

I’ve been looking for this post this since this morning lol :rage:. I thought I bookmarked it before… getting ready to try and get the ‘open contacts’ report.


#7

@ErnieG is there a delay of about 3 seconds before the first open report in your task?


(Ernie) #8

It ranges from 3 to 7 seconds for me.


#9

Got it. Just wanted to make sure that it’s normal.