[DEPRECATED] Ask Alexa 2.2.3


(Micheal ) #1

Announcing version 2.2.3 of Ask Alexa

I am pleased to announce the 2.2.3 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. This version is simply a code update (to the IDE), so those with GitHub integration can easily update. However, as always it is good practice to update your developer slots…I did make some changes to this area so I am interested to see if I missed something.

The next update will probably be a couple weeks (or more) away as I work with a few other developers and begin the next ‘big thing’ with Ask Alexa. However, I will push bug fixes out if you report them to me! And I will always be on the forum to harass :smiley:

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 @kinserc and @ImMrAwsome for some macro alias bugs that were squashed.

  • Code Optimization - Always finding better ways to do things in a shorter about of code. Also updated the interface (in the Settings area specifically) with icons for a more consistent experience.

  • Virtual Presence Sensors A great suggestion from @femwitjava and already implemented in other apps. The idea is that those without presence sensors may still have automations tied to their presence. Using a virtual presence sensor, you can accomplish this easily. You don’t even need a custom DTH! Simple go into your IDE and create a new device using the built in “Simulated Presence Sensor” (instructions can be found here: http://thingsthataresmart.wiki/index.php?title=Virtual_Presence_Sensor). Command structure is “Alexa, tell SmartThings to set Michael to Present” or other commands like “arrive”, “home”, “check in”, etc. Same for departing…This only operates on a per-device basis currently. If anyone needs a control macro to control these, just let me know…this is on the long-term road map but it can be moved up.

  • Message Queue Expansion - Because of the importance of the Message Queue in the future for not only Ask Alexa, but for the messaging from other SmartApps, the message queue is now enabled by default and not longer has an option to turn it off. This is non-intrusive and you still have various options for alerting, including the ability to append all of your interface queries with a note stating there are messages awaiting you; and of course, you have the option of hearing the messages as they arrive (in real time) from connected speakers like Sonos or synth devices. Please note that the references to the message queue are now referred to as “Primary Message Queue”. You can kind of guess where this is leading :slight_smile:

  • GUI Primary Message Queue Delete-If you choose to show the primary message queue messages in your main menu you now have the ability to delete them from there as well. No need to be near the Alexa Device to delete messages any longer.

  • Improved Cheat Sheet - Made significant improvement to the cheat sheet that is produced.

  • Updated Security Parameters - This will be useful for those that want to use the word ‘security’ as a device instead of referencing the SHM in SmartThings. Basically if you don’t choose to use SHM, then the ‘reserve’ status of that word is released and it can be used as a device (or virtual device name). Good suggestion by @kinserc

  • Flash Briefing-Message Queue - For those of you that use the Flash Briefing with Ask Alexa (http://thingsthataresmart.wiki/index.php?title=Ask_Alexa#Flash_Briefing), you now have the option to play the contents of the primary message queue via the flash briefing. As the message queue structure becomes a major part of the Ask Alexa experience (with the partnerships with other developers), this will allow an even EASIER way to get to your messages. Simply choose “Play Primary Message Queue Contents” as part of the pull down when selecting the type of output you want for the Flash Briefing in the Settings meny. Then, the voice command is simple “Alexa, flash briefing”. Notice there is no skill required…In addition, the Flash Briefing allows for news, weather, blogs or other content to be played in conjunction with the output of the Ask Alexa app…just configure this via the Alexa mobile app (not the SmartThings app). Instructions for setting up Flash Briefing with Ask Alexa is here: http://thingsthataresmart.wiki/index.php?title=Ask_Alexa#Flash_Briefing

  • More apps work with Ask Alexa! Continuing my collaboration with other developers and allowing your Ask Alexa to be the hub of your home automation and communication, I announced earlier in the week that the great app GCal (author @infofiend) is now supporting Ask Alexa’s message queue. With this implementation you can now get REAL TIME notifications of your upcoming calendar events. Please see the GCAL thread for more information: [UPDATED 3/27/17] GCal Search In addition, I am also announcing with Eric Luttmann (@ejluttmann) that his sports notification app is also compatible with Ask Alexa’s message queue. This app is great and is really up and coming in popularity on the community forums, so I welcome his app to the Ask Alexa family. See this link for more information (Sport Notifications SmatApp [BETA]) Again, apps like these already have their own notification system; however, when Amazon announces their push notification system all of these apps will be “Alexa enabled” using Ask Alexa!

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 over a year creating this document, I am open to it being improved; I know there are probably still 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. You 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 I partner with other application developers to ensure their strengths can be brought into the notification model of Ask Alexa . 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.


[RELEASE] Ask Alexa
[RELEASE] Lock Manager
[DEPRECATED] Ask Alexa 2.2.2
(Bobby) #2

Cannot wait to see what that entails to. The app is already amazing. If you ever want free text for your message queue, before Amazon announces the next big thing, EchoSistant is here to help. I am sure we can find ways to collaborate. Good luck!


(Andrea Bianco) #3

Your vision of growth with added feature sets is exemplary. Thank you for your dedication to the process and hearing the voices (requests) of this community.

With additions of such things as Gcal and presence sensors this moves into a feel of having Ask Alexa becoming our personal assistant, and the direction to more natural language is also welcomed.

Note to users who will begin to use other apps as a part of the integration with Ask Alexa, @MichaelS has provided links to those specific apps be sure to visit to visit those and explore or get support and advice from those threads that pertain. I have discovered some other powerful apps this way, and it has made the overall SMART HOME “smarter” and more customized. Other dev’s have been hard work on their individual smart apps and it is amazing to watch the collaborative effort and synchronicity at this stage.

I personally thank each and everyone of you, as it is the sum of all the moving parts that makes this so powerful, and exceptional. Thank you @MichaelS for the vision and ability to pull developers together for the common good of users, and @ethayer, @rayzurbock, @GarySpender (huge support with Gcal!), @infofiend, and @ejluttmann and all others I have missed that contributed!
Hats off to the community dev’s! Without you all we all just have connected devices - not a “smart home!”

Come on Amazon “PUSH” already! Those inclined to lean in on the AMAZON Visit:
https://forums.developer.amazon.com/search.html?f=&type=question+OR+kbentry+OR+idea&redirect=search%2Fsearch&sort=relevance&q=push


(Jason "The Enabler" as deemed so by @Smart) #5

Hey Michael,
Great job on what you’ve done with AA lately. I’m glad to see great new ideas being added in.

Let’s talk on the side, I’ve got an idea I think you might like.


(Micheal ) #6

I am going out of town in a moment so it may be later in the weekend before I respond…Not going to get Wifi on the plane…just going to watch a movie…

Will PM you when I am to a spot with wifi.


(Joey) #7

I don’t know what I’m doing wrong. I deleted my old version of AskAlexa from Lambda, Amazon Developer and Smartthings and re-installed all to update the version and now I just keep getting an error from Lambda.

{
“response”: {
“outputSpeech”: {
“type”: “PlainText”,
“text”: "There was an error with the Ask Alexa SmartApp execution. If this continues, please contact the author of the SmartApp. "
},
“card”: {
“content”: "There was an error with the Ask Alexa SmartApp execution. If this continues, please contact the author of the SmartApp. ",
“title”: “Lambda Error”,
“type”: “Simple”
},
“shouldEndSession”: true
},


(Micheal ) #8

Joey,

Typically, for a minor update (which 2.2.3 was) you only need to update the IDE code. However, if you did everything then it is considered a full install. In this case, I would start with the IDE live logging and see what is being heard by the device and what makes it back to SmartThings. Right off the bat I would check these items:

  • Go to “About Ask Alexa” and ensure you are seeing the Oauth and Setup Token
  • Ensure that you copied the correct Oauth and setup token are copied to Lambda (via Settings>>Setup Variables).
  • From that same item as the above step, ensure you created and copied all of the slots listed on that setup page.

I am out of town right now so won’t be able to respond quickly, but report back if this helps at all…If not, again, let’s start with the live logging.


(Joey) #9

Thanks for the fast response! Both Access Token and Application ID match the Ask Alexa app in the Lambda code but I don’t see Oauth. I’ll research why. The Smartthings logging shows no response when I ask alexa to do something. all I got was:

non-TV event zbjoin: {“dni”:“7916”,“d”:“24FD5B000101F299”,“capabilities”:“80”,“endpoints”:[{“simple”:“01 0104 0402 00 08 0000 0001 0003 000F 0020 0402 0500 FC02 01 0019”,“application”:“19”,“manufacturer”:“SmartThings”,“model”:“multiv4”}]}

Enjoy your time out of town and thanks again!


(Micheal ) #10

In that case, the ‘communication’ between SmartThings and Amazon is not happening, and that IS typically the Oauth. To be clear, I use “Oauth” a bit more generically than I should…In the help page it will actually say Access Token and Application ID.

In the output of Settings>>Setup Variables should be STappID and STtoken. Even though everything looks fine, might be a good idea to reset the token (on the Settings page) and then follow this items: http://thingsthataresmart.wiki/index.php?title=Ask_Alexa#Setup_Variables


(Joey) #11

I just re-copied and pasted all three lines in the Lambda code and it works! Thanks again for your assistance!


(Micheal ) #12

No problem…glad it is working!


(Micheal ) #13

I updated the code today to 2.2.3a…small fix that is not required for operation, but a misspelling that was bugging me :slight_smile:


(Micheal ) #14

For those that come by 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!


(Micheal ) #15

This Friday’s update is here: [RELEASE] Ask Alexa


(Micheal ) #16

Another Friday update…we are about a week away from another release:


#17

Just FYI–most of all the fancy colors are completely broken. Only the basic main colors seem to be working for me–like red, green, blue, purple, etc. Things like Sky Blue, Peru, Sea Green, etc doesn’t change the color of the bulbs at all and doesn’t seem to return any errors either. BTW–those same “exotic” colors used to work.

Here is the log for "Pale Violet Red"
1:26:20 PM: debug NO Update Needed for transitionTime.
1:26:20 PM: trace Hue B Smart Bulb: updateStatus ( transitiontime:4 )
1:26:19 PM: debug newHue = 62, newSat = 0
1:26:19 PM: debug colorData from XY = [hue:0.6154037886340992, saturation:3.0602159267618245E-4]
1:26:19 PM: debug HS from XY = [hue:0.6154037886340992, saturation:3.0602159267618245E-4]
1:26:19 PM: debug colorData = [hue:0.6154037886340992, saturation:3.0602159267618245E-4]
1:26:19 PM: trace getHSfromRGB ( 99.99217, 100.00159, 100.02278):
1:26:19 PM: debug RGB colorData = [red:72.27135992018889, green:72.27419726850489, blue:72.28058418098786]
1:26:19 PM: trace Hue B Smart Bulb: updateStatus ( xy:[0.3227, 0.3290] )
1:26:19 PM: debug NO Update Needed for transitionTime.
1:26:19 PM: trace Hue B Smart Bulb: updateStatus ( transitiontime:4 )
1:26:20 PM: debug NO Update Needed for switch.
1:26:20 PM: trace Hue B Smart Bulb: updateStatus ( on:true )
1:26:18 PM: debug Setting level to 254.
1:26:18 PM: trace Hue B Smart Bulb: setLevel ( 100 ):
1:26:18 PM: debug Sending [transitiontime:4, xy:[0.32272673, 0.3290229]]
1:26:18 PM: debug xy from HSB = 0.32272673 , 0.3290229 .
1:26:18 PM: debug red = 5.2494684E7 / r = 65025.0
1:26:18 PM: trace colorFromHSB ( 94, 60, 100): really h 338.40, s 0.6, v 1
1:26:18 PM: trace sendToHub: no XY values, so get from Hue & Saturation.
1:26:18 PM: trace Hue B Smart Bulb: sendToHub ( [hue:94, saturation:60] ):
1:26:18 PM: debug Hue B Smart Bulb: setColor( [hue:94, saturation:60] ).


[UPDATED 4/19/17] Hue B Smart (Smart and FAST Hue Lighting)
(Micheal ) #18

I will look into it…Thanks for the report.


(Micheal ) #19

Ok…just tested this and they work great on the Osram bulbs I have…every example you mentioned did not produce an error and change the color of the bulb to the values provided from the SmartThings API.

The copy and paste you put in your note…where did it come from (I know live logging), but the device itself? Are you using a hub to control your colored bulbs? And, when you say ‘they don’t work’…what exactly do you mean? Do the bulbs come come on? Are there any red messages in the live logging?

I got the following from Ask Alexa

1:43:27 PM: debug I am setting the color of the cabinet light 1 to sea green.
1:43:10 PM: debug I am setting the color of the cabinet light 1 to peru.
1:42:51 PM: debug I am setting the color of the cabinet light 1 to sky blue.

Let me get a bit more detail and we can see if it is Ask Alexa or something else…


#20

Quick Edit: Yes–logs from the device itself, not Ask Alexa.

I’ve tried them on various Hue bulbs–including Lightstrips Plus and BR30’s. Ask Alexa always seem to say it is changing the color, but the colors don’t change on the bulb. They stay whatever color they were before or change to white. No red lines in any of the logs for the bulbs. I do see odd debug colors in the log with “…5E-4” in the saturation when calling for these colors, whereas the main colors like blue or red works just fine.

Here is the log to red:
2:10:21 PM: debug NO Update Needed for level.
2:10:21 PM: trace Hue B Smart Bulb: updateStatus ( bri:0 )
2:10:21 PM: debug newHue = 100, newSat = 100
2:10:21 PM: debug colorData from XY = [hue:0.9999992660982069, saturation:0.99999773779223]
2:10:21 PM: debug HS from XY = [hue:0.9999992660982069, saturation:0.99999773779223]
2:10:21 PM: debug colorData = [hue:0.9999992660982069, saturation:0.99999773779223]
2:10:21 PM: trace getHSfromRGB ( 352.25726, 7.968791E-4, 0.002348009):
2:10:21 PM: debug RGB colorData = [red:122.17254245389466, green:0.4881140576697502, blue:0.7969924603139141]
2:10:21 PM: trace Hue B Smart Bulb: updateStatus ( xy:[0.7006, 0.2993] )
2:10:21 PM: debug NO Update Needed for switch.
2:10:21 PM: trace Hue B Smart Bulb: updateStatus ( on:true )
2:10:20 PM: debug Sending [transitiontime:4, xy:[0.7006062, 0.29930097]]
2:10:20 PM: debug xy from HSB = 0.7006062 , 0.29930097 .
2:10:20 PM: debug red = 5.2494684E7 / r = 65025.0
2:10:20 PM: trace colorFromHSB ( 0, 100, 100): really h 0, s 1, v 1
2:10:20 PM: trace sendToHub: no XY values, so get from Hue & Saturation.
2:10:20 PM: trace Hue B Smart Bulb: sendToHub ( [hue:0, saturation:100] ):
2:10:20 PM: debug Hue B Smart Bulb: setColor( [hue:0, saturation:100] ).

Here is the log for Sea Green:
2:12:37 PM: debug NO Update Needed for level.
2:12:37 PM: trace Hue B Smart Bulb: updateStatus ( bri:0 )
2:12:37 PM: debug NO Update Needed for switch.
2:12:37 PM: trace Hue B Smart Bulb: updateStatus ( on:true )
2:12:37 PM: debug NO Update Needed for transitionTime.
2:12:37 PM: trace Hue B Smart Bulb: updateStatus ( transitiontime:4 )
2:12:36 PM: debug newHue = 62, newSat = 0
2:12:36 PM: debug colorData from XY = [hue:0.6154037886340992, saturation:3.0602159267618245E-4]
2:12:36 PM: debug HS from XY = [hue:0.6154037886340992, saturation:3.0602159267618245E-4]
2:12:36 PM: debug colorData = [hue:0.6154037886340992, saturation:3.0602159267618245E-4]
2:12:36 PM: trace getHSfromRGB ( 99.99217, 100.00159, 100.02278):
2:12:36 PM: debug RGB colorData = [red:72.27135992018889, green:72.27419726850489, blue:72.28058418098786]
2:12:36 PM: trace Hue B Smart Bulb: updateStatus ( xy:[0.3227, 0.3290] )
2:12:36 PM: debug NO Update Needed for transitionTime.
2:12:36 PM: trace Hue B Smart Bulb: updateStatus ( transitiontime:4 )
2:12:36 PM: debug Setting level to 0.
2:12:36 PM: trace Hue B Smart Bulb: setLevel ( 0 ):
2:12:36 PM: debug Sending [transitiontime:4, xy:[0.32272673, 0.3290229]]
2:12:36 PM: debug xy from HSB = 0.32272673 , 0.3290229 .
2:12:36 PM: debug red = 5.2494684E7 / r = 65025.0
2:12:36 PM: trace colorFromHSB ( 41, 50, 100): really h 147.60, s 0.5, v 1
2:12:36 PM: trace sendToHub: no XY values, so get from Hue & Saturation.
2:12:35 PM: trace Hue B Smart Bulb: sendToHub ( [hue:41, saturation:50] ):
2:12:35 PM: debug Hue B Smart Bulb: setColor( [hue:41, saturation:50] ).

What I think is happening is something is off in the transform that puts saturation out of legal range, and the bulb defaults to white (saturation = 0) instead. So the sea green turns the bulb to white when asking for sea green and similar colors with transform errors.

I am using the Hue B Smart device handlers from @infofiend ([UPDATED 4/19/17] Hue B Smart (Smart and FAST Hue Lighting))


#21

I think this is the common problem because I see this on colors that don’t work like sea green and pale violet red. All those XY tranforms put the hue and saturation at the same numbers, but obviously “out of range.”