MichaelS - This is amazing work. Your documentation and instructions are second to none.

I have one small feature request:
The easy version: Allow to override the keyword ‘security’ in SHM section. I have modified your code, but I would hate to hand patch every new release.

  • 2017.3.5 - Replaced keyword ‘security’ with ‘dummyalarm’ to prevent conflict with Smart Alarm
    (BTW - If you think this will screw something up, please let me know.)


The harder version: Please allow integration with Smart Alarm. The ‘entry/exit’ delays are a must and I just can’t switch to SHM.

1 Like


Let me look into a switch to remove ‘security’ from the list that goes into the slot…that is rather easy, but almost feel if I did I WOULD have to do it because of the later integration of Smart Alarm. Unfortunately, I don’t have this so if I were to add this you would have be my eyes and ear for testing.

Let’s start the conversation here with a list of requirements (how do you envision this working from a command structure), and then specifics on how Smart Alarm works.

We can have people contribute to the conversation and then take it private to get it tested.

Let me know if that will work for you.

Are you saying you plan to integrate ‘Smart Alarm’? Unfortunately, it is no longer supported. The development has stopped. I feel unfair encouraging you to spend a lot of effort on this for that reason. But it is a mature clean app and I do believe many users have installed it. The killer function is that it includes entry and exit delays without any special functions (from CoRE or the like).

So, let me better explain my issue. I have named a virtual switch ‘security’. This was my method to ‘arm’ my alarm using Alexa and skirting the Amazon restrictions (no lock or alarm interactions with Alexa). Worked fine. Then I installed ‘Ask Alexa’. My first status check was ,’ Alexa, ask smartthings status of security’… she responds ‘Smart Home Monitor is set to…’. Strange… I just wanted to hear ‘on’ or ‘off’. Thus my idea to exchange your keyword ‘security’ for ‘dummyalarm’. Now I can get feedback on my ‘security’ virtual switch without conflict. So, as you can see, this might be only a single user problem. But, it does bring up the question, ‘Does everyone use SHM?’

Maybe the better approach is just to allow any ‘Ask Alexa’ user to disable the SHM interface.
I picture in the ‘Ask Alexa’ menu, under ‘Modes/SHM/Routines’. In ‘smart home monitor options’, allow a toggle ‘Enable SMH integration’. (Like the Enable Flash Briefing toggle)

OK. I get it…While I might accomplish this another way ( I.e if you don’t choose any SHM functions the security words are not populated in the setup variables) I think this has merit. Consider this a feature in the next version! I will update the wiki with a note when I get the feature implemented.

Would this idea work, basically you want to ensure the word ‘security’ is no longer looked at as a resevered work…Correct?

I am pleased to announce yet another partnership for Ask Alexa. This time, it is the release of GCAL:

One time that is sorely missing in even the native Alexa is GOOD calendar notifications. Now, you can use Ask Alexa and GCal to have notifications sent to your Ask Alexa Message queue. This, coupled with the lastest version of Ask Alexa where you can have the notifications play in real time (on an external media device like Sonos), you can use Ask Alexa as the HUB of your home communications.

This is still just the beginning…The are more partnerships and apps that take advantage of the Ask Alexca Message queue (and other features) are coming soon.

Thanks @infofiend for re-releasing this ‘sleeper app’…I really believe this is a hidden gem the SmartThings community!



I will update the documentation about this, but thanks to @smoov for pointing this out. I have had my AWS account for over a year and recently received an e-mail that all of the ‘premium’ services have been turned off and that I could keep my ‘free’ tier (which is Lambda).

Well, today, looking at the billing tab (rooted under monitoring), I found this:

It appears that a rounding error $.01 cent per GB and a usage of .001 GB) brought this up to 1 cent. Looking at my payment methods I have no credit card set up so I assume Amazon will just eat this cost. However, this is rather concerning on the surface that the free tier lists a charge.

I would recommend any user of Ask Alexa (or any other skill based apps) take a look at their billing. This would be a good time to ensure you aren’t be charged for something you are not using(let’s say you were exploring around AWS and accidentally allocated some storage via S3). I would also be curious to hear of anyone that gets an actual charge of $0.01 on their credit card. Quite honestly, even if I have to pay 12 cents per year for using my app that is a good price, but would still rather pay $0.00.

Consider this FYI.


What is the syntax of ‘LIST_OF_MACROS’?

how are the windows? (Aliases: tell me about the windows, are the windows closed)
its bed time! (Aliases: i am going to bed, we are going to bed)


how are the windows?
tell me about the windows
are the windows closed
its bed time!
i am going to bed
we are going to bed

FYI: I can’t get either to work :slight_smile:

Hmm…If you were trying them last night about 9pm to 10pm the Alexa service appeared to be down.

However, if they still don’t work, let’s see if we can figure out why.

First, since you mention List of Macros, I assume after you set up these names that you put them in this slot area?
Did any of them have punctuation when you put them into the slots?
Do they work using the Developer Simulator (you don’t have to type “Alexa, Tell SmartThings…” Just type the command (if you have numbers in them you must spell out the numbers).
During execution, what do you see in the live logging?

Amazon recommends commands of three syllables. While that is a general guideline, you should probably create a macro called “report” and put that into the slots and see if it works…Other items might be that Windows is a reserved word…again, start simple and work your way from there.

Anyway, try those tests and see what you come up with…

  1. Right… I put them in the slot area but I wasn’t sure of the format.
  2. I did use punctuation at first - like ‘I’m going to bed’ - then I removed it.
  3. I haven’t tried the simulator.
  4. Again, I didn’t watch the live logging. (Sorry… a little lazy here)

To further explain the symptoms, I was able to get macros to work. But, ‘Ask Alexa’ will only respond to the primary ‘macro name’ and not any of the aliases. Does this help? In my example, ‘its bed time’ worked, but not ‘I am going to bed’.

So, should I leave punctuation out of the ‘macro names’?
And, do I just list the phases in ‘List of Macros’? or is there a parentheses syntax?

Ah. I will look into it but the macro should react properly to any of the names. Primary or the aliases…I will check this again but it is imperative the aliases are in you list of macros as well.

Also, Ask Alexa generates the proper items to put into the slots. You simply copy and paste them and you are guaranteed to have the correct format. Go to Settings and then Setup Variables to see that list. Watch live logging to get the address so you can copy/paste from a PC.

Let me know if that helps.

Ok…I just tested this and it appears there is a mistake in the code…will straighten this up and publish a new version to fix this.

Thanks for pointing this out :slight_smile:

Edit: I tested this and pushed a fix…https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/smartapps/michaelstruck/ask-alexa.src/ask-alexa.groovy

You should be able to update your IDE directly. Thanks again for pointing this out.

My bad… I went to “About Ask Alexa” - “Display Cheat Sheet” and the format is different. This caused me to question my setup. But now I know… ''Setup Variables" with the big Amazon logo… duh.

No worries…but to be clear, you DID find a bug that I have since fixed…

Guys, fairly new to the Ask Alexa user group, and I’ve looked for this answer in the forum and release notes but haven’t found precisely what I’m looking for. I’m hoping someone can point me to a direct answer.

I’d like to be able to Ask Alexa to perform a ST automation after a variable interval of time, essentially creating a timer. I know she can’t trigger based on a timer, but curious if she can trigger a ST function that waits first, then continues execution (like you can do with a CoRE piston).

Example Utterances:
“Alexa, Ask SmartThings to turn off the Front Porch Lights after 15 minutes”
“Alexa, Ask SmartThings to turn off the Front Porch Lights in 15 minutes”
“Alexa, Ask SmartThings to wait 10 minutes and then turn off the Front Porch Lights”
“Alexa, Ask SmartThings to turn off the Front Porch Lights at 11:00PM”

Are these kind of constructions possible natively or through the use of macros? If so, can you point me towards some examples or documentation to help me implement? Thanks in advance!


If you think of Ask Alexa as two parts it will hopefully explain how to do this…

For individual devices you really can’t set timers for their action. Alexa is based around real time interactions. There are two reasons for this…first, Alexa will ONLY give feedback to a response…if you set a timer you can’t have her say in 10 minutes (I turned off this light)…In addition, SmartThings has a limit to the number of ‘timers’ that can be set. Right now it is 6 and all programs abide by it, but Ask Alexa creatively gets around it using macros, but more about that in a second. So, for INDIVIDUAL item that are listed in the main menu, you can set those in real time.

However, you do have options…First, you mentioned Core…Ask Alexa integrates with Core nicely. You can run a Core “DO” piston from the Core Macro…Simply create a Core Piston that has a delay as a DO macro. Then, go into Ask Alexa and you will see a list of your Core Pistons in Ask Alexa. You choose the name (or alias) of the macro, and when you trigger it the app will run the macro. If the piston is delayed, then it will be delayed. You can even set a feedback message saying "I am setting the lights in 10 minutes). Since the timers are set in core, you can have MORE than 6 scheduled events.

If you don’t want to use Core for this, a Control Macro in Ask Alexa will also allow you to do the same thing…This one gives you a bit more control over the execution time. Simply build a control macro. This will allow you to initiate a routine, or control groups of devices (including lights). Then you simply say “Alexa, tell SmartThings to run {macro name} in x minutes:”. You can even set a time limit in the macro in case you forget to set a time verbally. And, since a macro is technically a separate program (a child app), you are NOT limited to 6 scheduled events for Ask Alexa…Just create a new macro for every timer item you want.

Let me know if this answers your question. Ask Alexa is VERY powerful and I have found very few use cases that can’t be solved with it.

I have released a great update, which builds on the features of last time, along with adding the framework for some great stuff going forward:

1 Like

Thanks for the details Micheal. I’ve successfully implemented using the Control Macro option. Last question. Is there a way in the feedback message to use a variable to read back the delay time, such as “I will run the macro in X minutes” where X is the time you requested for the delay. If so, what is the variable syntax?

Thanks again for all your help! My wife is very happy with her new timer.

1 Like

WAF (wife acceptance factor) is VERY important. I am glad you got this working.

Funny you should mention the variables…something I put in and wasn’t sure people were going to use it:



1 Like

I updated the code today to 2.2.3a…small deletion of code that shouldn’t have been in there and fixed an all too obvious misspelling error…so it was bugging me :slight_smile:

1 Like

For those that come by this thread on Friday’s to see if there is a new update to Ask Alexa, per the release notes for 2.2.3, there won’t be one for a few weeks. However, I have reached a milestone in the development, so we are well on our way for another version release soon. For those of you that use the message queue you will find you have a LOT more options to choose from as we prep for Amazon releasing their push notification feature (no ETA yet).

I will be reaching out to my partner community developers before the release so they may prep for using the new features of the message queues. This will include directing messages to specific speakers and customizing the notification methods. Once this structure is in place, it will only be a little work before we can have speaker to speaker communications!

Thanks for your patience and encouragement (and donations!) for keeping this project going!