New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding last_called #65
Conversation
On a related note I experimented with this in Node-RED for a few minutes this morning. It appears I was having trouble identifying the last Alexa device to be called, because every Echo that can hear my voice reports back to the Activity API. In the screenshot below you see that both my Kitchen Echo Show and my Family Room Echo both reported back. Unfortunately, the order in which these report back to our component is not consistent. Sometimes the last reported device is the one we want, and other times it reports back first. For now this feature is not going to do what we want it to. However, there is a lot of data reported back by the Activity API, such as the exact phrase recognized by the Echo (or in the case of a non-command it reports that as well). I am hopeful that I will be able to find something in that stack that will help me make this feature reliable. I am going to leave it alone for now so @alandtse can work on splitting them off. |
@brianhanifin LOL, that's going to be a problem. I have an Alexa in every room and some rooms have 3 devices. Is there any way to see what one took the command. Sometimes I have two respond with one saying cannot complete and the other actually responding. It would be great to have additional inputs to say last command or last phrase or last action. For example you can say Alexa |
@niemyjski I am hoping to use this feature myself. For example I'd like to say Goodbye to Alexa and have the Echo I spoke to respond with a random line from my Here is a link to a couple of quick tests of the Activity API. I think I can code it to ignore P.S. Where I sit in my TV Room, there is an Alexa 10 feet in front of me, an Alexa 4 feet away on the other side of the wall in the Kitchen, and 10 feet behind me in the den. Its anyone's guess as to which one will respond. Sometimes our den Echo starts a timer when we ask for one in the kitchen. LOL. |
OK, so after doing a few experiments... I came to the conclusion that ignoring the |
Awesome work! If you are in discord hit me up. I wonder if this last_called could also be used for room awareness too or if there is any events that are being submitted for audio activity (I usually keep it on mute) but would be good to trigger a binary_sensor for audio detected or audio playing :) If you are close and you say something it may give you a better idea of proximity even if it's |
EDIT: Sorry, have some code review edits. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you review my comments and test them? I took a closer look before to try to rewrite a docstring comment and had some questions. I may have just missed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I have removed the orphaned code and made the recommended change to get_last_device_serial()
. I have committed those changes.
Oops, I read this comment earlier on my iPhone on the GitHawk app. Unfortunately, it didn't show the review information so I didn't see them until just now. I apologize for the delay. |
No need to apologize. You're helping in your free time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Can you also update the Wiki with how to use this functionality?
I have added the following to the wiki page. Last called deviceEach device will report whether it is the last_called or not. This allows us to identify the device that was called according to the Alexa Activities API. Creating sensor.last_alexa
|
Do you mind sharing an export for your node red script above. |
Following these instructions I reset my repository, reapplied
git config core.filemode false
, then pasted my changes back into .gitignore + alexa.py.Hopefully this puts the repo in a better state for you to work with.