[DEPRECATED] Ask Alexa 2.2.2

Announcing version 2.2.2 of Ask Alexa

I am pleased to announce the 2.2.2 version of Ask Alexa. In this version I continue (along with help from the community) to evolve the application to allow more conversational syntax, along with adding more functionality for existing and new devices. I also received a great addition to the utterances by @M3Rocket. This allows for even more natural requests for the devices you already have set up in your environment.

PLEASE NOTE: Now that this app is rather stable (It is now 1 year + old!) now I will be updating it less frequently except for bugs and new features. I am waiting for Amazon to release their ‘push’ notifications where some amazing stuff will happen with this app. Until then, if you do have a great feature idea for this app, just let me know.

Other additions to this new version include:

Bug Fixes - The normal things…silly misspellings, logic errors, bug reports. Thanks to @yvesracine & @M3Rocket for specific troubleshooting with a home with multi-thermostat types

Code Optimization - Always finding better ways to do things in a shorter about of code.

White Lights with Kelvin settings -For those with the next generation of white LED bulbs, you can set them to give different whites (Kelvin temperatures). Previously you had to ‘hack’ the system to get these to work with Ask Alexa. Now, however, you can call them out directly. You are given 4 setpoints ranging from “Soft White” (2700k), “Warm White” (3500k), “Cool White” (4500k) and “Daylight White” (6700k). Simply set up your bulb (Temperature (Kelvin) Lights), update your developer slots, and then use a command like “Alexa, tell SmartThings to Set {bulb name} to Soft White”. Thanks to @femwitjava for the extensive testing she did for me on these. Please note: The colors defined here only apply to the white bulbs. For example, “soft white” on these bulbs is different than “soft white” on RGB or Hue/Saturation bulbs. I have an active project to ensure the names of the colors match what you would expect (right now, some of the SmartThings defined colors are off from the description).

OSRAM DTH Loop/Pulse Commands - Thanks to @bbmcgee for this suggestion. This allows those of us with OSRAM lights (and using this DTH: https://github.com/gkl-sf/SmartThings/blob/master/osram-bulb-HA.groovy) to create some interesting moods with the “Loop” and “Pulse” commands. Be sure to turn these additional commands on via the Settings>>Device Specific Commands and update your Amazon Developer Slots. Please Note “Loop” and “Pulse” are only available via Control Macros currently. If there is a demand please let me know and I can enable the command on a per device basis (I.e. “Alexa, tell SmartThings to loop Kitchen Lights” or something like that) Also…the “function” of the loop and pulse are from the Device Type Handler (DTH)…Not Ask Alexa. If you have feature requests please contact the author of the DTH (gkl-sf)

Expanded Utterances Thanks to @M3Rocket for submitting a LOT of new utterances…These are fantastic and allow Ask Alexa to expand what it understands. There are now over 400 utterances that allow for natural conversations with Alexa. This allows you to say “Alexa, Ask SmartThings how cold is it in {device}”. In my home the device is back patio, so it is a very conversational question that will be answered by “The back patio is reading 45 degrees”. Great work @M3Rocket

Macro Aliases - In 2.2.1 I added in more options for the Control Macros to allow for more conversational interactions with Alexa. This will allow you to make a statement: “Alexa, Tell SmartThings it is too dark” and it could incrementally raise the brightness in a room. However, this is limiting as that phase has to be spoken exactly as set up. Well now, you have the ability to have a number of aliases for each macro that all do the same thing. Now you can have variations in the intent, such as “it is dark” or “brighten the room” and all of these will react the same way. This is similar to the Google Home IFTTT channel and helps you by allowing YOU to express yourself to Alexa, and keeps me from having to update the code every time someone comes up with a new express. A WIN WIN! And for those creative the number of macro aliases can be expanded from the default three…However, the ‘do not duplicate names throughout the application’ still applies.

Increase/Decrease of thermostat (Control Macro) Continuing the evolution of the Ask Alexa to become more ‘aware’ and conversational, I have added the increase/decrease commands to the control macro thermostat control. Like the changes I made to the lighting, you can now create macros that feel more conversational…For example (using custom responses):

User: Alexa, tell SmartThings it is too cold
Alexa: Ok…I am increasing the temperature

Please note that currently you have to be in the correct mode to increase or decrease the temperature. For example, if you are in heating mode, you can’t set up a cooling setpoint. You will not hear an error, but one will be logged in the IDE Live Logging. The exception is when you are in ‘auto’ mode. However, ensure you test these features after you set up a macro…Different thermostats behave differently and improper settings could damage your home heating/cooling system. In addition, some cloud based thermostats don’t update in real time so the settings you see in SmartThings may not reflect what is on the actual device. This is not a function of Ask Alexa but the individual DTH you might be using with the thermostats…use with great care!

Message Queue-External Speakers-Expanding the capabilities of the Message Queue, you can now be alerted, in real time, when a message is received by the the message queue. This is preparation for the Alexa Push module (no ETA currently). However, until then, you can use an external speaker (Sonos) or a synth device, to alert you when you receive a message into your queue. For those creative type, if you have a synth device connected to your Echo, you now have a fully interactive system using Alexa! The incoming message will still be stored in Ask Alexa’s message queue and can be played back and deleted as normal from the Echo, but now apps that give real time alerts can heard in real time. For those of you who didn’t know, I have worked with numerous developers to allow the message queue to function with the following apps:

Nest Manager (Anthony Santilli)
CoRE (Adrian Caramaliu)
Zoned Heating/Cooling Solutions & MonitorAutomaticCar (Yves Racine)
Device Manager (Eric Maycock)

And just today, I am announcing a new partnership with two additional apps: First is Big Talker (@rayzurbock), the premiere notification app within SmartThings. While this app already has output capabilities, you can use the new integration to send notifications to the Message Queue. In the future, these will go DIRECTLY to the Alexa devices (push notification). Depending on the integration Amazon allows, I have also developed an interface strategy to allow you to direct WHICH Echo speaks.

Next, Erik (@ethayer) and I are working together to have Lock Manager send notifications to the message queue. This will be VERY helpful for real time alerting (or historical reference) on WHO is coming in and out of your home…

Finally, also regarding the message queue, you now have the option to see any message that are in your message queue on your main menu page. Eventually, you will be able to delete these messages as well.

The new Ask Alexa Message Queue options and framework will also allow me and other developers to also to create a whole suite of applications around messaging, using Ask Alexa as the ‘hub’ for your interactive experience . This includes home messaging services from Alexa to Alexa (or other speakers), along with the ability to leave messages in the message queues for other folks around your household.

Installation
For those with IDE integration with GitHub, simply update the repository and you will have the latest code for the SmartApp itself. However, for ALL aspects of the application follow the original instructions for installation to ensure you get everything updated properly:
The wiki for this app is here: http://thingsthataresmart.wiki/index.php?title=Ask_Alexa

Support
All of you have been great in asking very relevant questions and making suggestions that I end up using. Here are some helpful tips on usage and support:

  • Sometimes it works best if I can work real time with you. To facilitate this, I have created a Slack channel: https://askalexa.slack.com. Using this tool is easy and will allow for real-time collaboration to solve the problems faster. To use this feature, I must invite you to the Slack channel. This will not be for normal questions; please use this forum for that function.
  • The Echo, as it is designed currently, cannot react to switches opening or other actions within SmartThings. She will do things for you, but only at your direction and at the time of the request. The delay timer mentioned in the control macro happens at the SmartThings hub, not within the Amazon Alexa control. See the new Message Queue functions for similar functionality with Big Talker!
  • When evaluating new features I will typically ask for a valid use case. If it can be used by others to bring them value I will put it on my list of future revisions. Not all suggestions will be used and many times I add aspects of the request.
  • There are no dumb questions, but many of the questions you may have were probably answered in the year since the initial release. Please take some time to go through the forum and the wiki if you have issues. And don’t be offended if I give you the specific area of the manual that answers your question. I have spent almost as much time on the documentation as I have on the app. Finally, there are some big fans of Ask Alexa that know almost as much as I do. They can also help.
  • Feel free to send me forks of utterances or even code revisions. As mentioned above, if it adds value to the overall program I will try to include it. This also goes for the wiki documentation…while I have spent about 200+ hours creating that document, I am open to it being improved; I know there are grammatical errors or syntax issues…If you find them, fix them…I will include your name (if I can) in any fixes submitted.
  • If you find a bug or a consistent crash please help me track it down by giving me repeatable steps to reproduce it. A non-reproducible bug, many times, indicates other areas that may be at fault besides the app. If you watch the live logging and see a red error with a line number, that is very helpful to me! However, I will need a full screenshot and not a copy/paste of the text. But be careful about revealing your OAuth and AppToken in your public posts. People can control you house with that information. May want to blur that out.

As mentioned above, revisions will be less and less now. And with the code base now unified, I expect less and less additions…especially as we integrate CoRE more to do some of the heavy lifting of larger condition-base automations… Any and all suggestions are still on the table for addition.

As always, I appreciate any public accolades or even donations to my PayPal account: https://www.paypal.me/mstruck . And, if you are so inclined, I also will accept bitcoins (or fractions thereof) if you have any laying around. My wallet ID is: 1CMgaiKgBfojTBCLpHLfa9KvcrW3cNxVpm
Enjoy.

9 Likes

It is shocking how well this all works and it just keeps getting better! Thanks so much for the amazing work you and other developers are putting into this project.

1 Like

Gareth…Thanks! The app is now over a year old, and while mature, still continues to evolve! I was on a long drive yesterday and came up with a few ideas that will blow everyone away (I hope)…Stay tuned for more items and features!

1 Like

I am pleased to announce yet one more 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!

Everyone who uses Ask Alexa (or any other skill) needs to ensure they read this:

Thanks. This is great stuff.

Looks to me that SmartApp code, the Alexa skill Utterances list and then the list_of_device_types are the only updates. Sound right?

1 Like

Any time you update you should always update the slots using Settings>>setup variables. But yes…Groovy code and utterances are the items you need to update for sure.

Got it. So I’m clear, does executing the “setup variables” link in the app actually do anything other than take you to the URL of the setup page? I am just trying to understanding if initiating this from the app makes a difference vs. just checking the bookmarked page. Thanks, again.

Unfortunately, all this page does is give you the variables (and a link to the Developer’s page)…there is no automated way to update or compare the slots…I simply copy/paste them one at a time…typically takes less than a minute and in normal day-to-day use you shouldn’t normally need to do this step unless you add/remove devices…

Hope that helps!

Thanks for the great app!

I’m having trouble running macros. Whenever I try to run one, Alexa’s ring flashes like she’s thinking, then it stops and nothing happens. My log in the IDE says: “java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object @ line 1288”

What am I doing wrong?

What is the name of the macro or alias…I will look at this line number as it shouldn’t throw an error, but I have a feeling it will be in your macro name.

I assume you are using the 2.2.2a version?

Yea, it’s 2.2.2a

I have 3 macros that all get the same error: Arm Security, Door Status, and I Am Going To Bed

Ok.,…let’s take one macro first…what it’s primary name, and what are its aliases?

Actually, if you are savvy with the code, modify line 1288 to this:

if (it."macAlias${i}" && it."macAlias${i}".toLowerCase().replaceAll("[^a-zA-Z0-9 ]", "")==mac) {

I should have checked for a name present before checking its value…silly Groovy Code :slight_smile:

I think that did it. Thanks for all your hard work!

Which one…the code? I will push out 2.2.2b if that is the case! Thanks for bringing this to my attention.

Yea. Switching out that one line of code seemed to do it.

Cool…pushing the fix…Also tagging @kinserc as he originally called out the original issue.

Code is here: https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/smartapps/michaelstruck/ask-alexa.src/ask-alexa.groovy

Well, I’ve got another one that looks similar:
groovy.lang.MissingMethodException: No signature of method: script14890271186312086074392.toLowerCase() is applicable for argument types: () values: [] @ line 1297

The last fix got my “macro of macros” error free, but now this one pops up when I try to fire the underlying macros individually. They also don’t seem to fire when I do my “macro of macros”.

So, looking at my code that would only come up if you have no primary name for your macro and ONLY an alias name…can you confirm? I probably need to put in a check that you CAN’T add aliases without a primary name already entered.