[APP][Pro] Alexa - Control your Amazon devices from Homey

New version is up, thanks for athom for not requiring it go through approval.

Where were you? :smiling_face_with_tear:

Ok,

So .. verion 8.0.0 - experimental version available, use at your own risk.

Connections

  • Updated the Amazon login library to the latest version and kept the fix that detects Amazon’s login page errors.
  • Renewed logins are saved straight away, so they survive app restarts.
  • A renewed login is only saved when it includes a refresh token, so a partial login can never replace a working one.
  • The settings page can no longer overwrite your saved Amazon login.
  • Connecting and reconnecting can no longer change the saved login by accident.
  • A successful login renewal happens silently in the background.
  • If renewal fails, the app drops the connection and tells you straight away. It never looks connected when it isn’t.
  • An invalid login is now treated as a sign-in error, so you’re prompted to repair rather than seeing a vague failure.
  • If the refresh token is rejected, the saved login is cleared, so the next restart takes you straight to repair.
  • Removed old code that converted logins from earlier app versions.
  • I found a place where the cookie was being overwritten, and this may help keep devices connected.

But in theory it should help with any connection issues.

Other

  • A failed command now shows an error, is never resent, and only drops the connection if Amazon really is down.
  • The app never stops reconnecting after a network drop.
  • Now playing, artist and album art work again, including Amazon Music.
  • New “Alexa heard” flows, with phrase, reply, device and person tags.
  • Every English flow card reads as a plain sentence, and existing flows keep working.
  • Whisper, “do not disturb on all devices”, daily alarms and special characters in speech all work properly.
  • Alexa lights pair again, and an offline light or plug shows an error.
  • The settings page has a proper loading screen and no longer gets stuck.
  • Log level changes apply straight away and survive a restart.
  • Crash reports no longer flood or crash the app.
  • Fixed up the settings connection screen, made it a bit nicer.
  • When changing logging using the secret menu - it no longer requires a restart.
  • I also fixed the album art which wasn’t showing due to a change on amazons end, it will now be super quick - tested on spotify and amazon music.\
  • I have updated all the flows to read more natural.
  • Athom are using a wildly out of date only logging library, this version tries to deal with that nicely to stop crash reportings.

Flows

Finally there is a new flow, which triggers when alexa hears something -

When alexa hears jamie say whats the time on rocket clock then …

It has tokens so you can set up so if its only heard on a certain device or if a specific person says it. (occurs about 3 seconds after you say it - as it has to wait for alexa to do its thing first).

I dont think I have nailed the user yet, I cant test it properly right now ill have another crack at it tomorrow when I can yell at alexa and not wake the family.

This app will be 8 years old in 2 months. :birthday_cake:

The only way I am aware that there is an issue with it, is if I have problems in my home - which is rare. Or I happen by the forums - but in the future if there is an issue hit me up on the athom slack and ill fix it. I still have a smart home and I still use Homey … its just everything is mature and stable for me.

Its been out now for 6 hours, no complaints so i’ve submitted version 8 for review by athom, if you havent tried the new test version : Alexa | Homey I suggest you do - it should fix many peoples connection issues.

TTFN

i am currently using test version. no issues so far. will continue to monitor for a week or so as previously it would randomly stop working within a few days or a week or so.

i had issues prior with disconnects and that red warning triangle to the point i ha to stop using this app. the other app of amazon echo had some issues also but the developer of the app made somee improvements which has made it very stable as i’ve been using it for the past month.

one thing to note is that with your app the text to speech is saying the word comma rather than point. for example when saying the temperature it will say 24 comma 3 degrees with your app whereas the other amazon echo app is now saying it as 24 point 3 degrees. its saying the value of the temperature sensor in one of the rooms. both your app as well as the amazon echo app both said comma. the recent updates of the other amazon echo app for homey is now saying ‘point’ rather than comma. i suspect it has to do with the language/location. im in australia so it sounds weird that its saying the temperature with a comma. not a big deal breaker but would be nice if it can be fixed.

i havent done enough testing but what i have noticed with your app as well as the amazon echo app is that it may say the ‘then’ card twice even though i have only one ‘then’ card to say something on my echo device. i suspect it may have started when i switched to the early access of Alexa+. will continue to monitor and see whether opting out of alexa+ stops it from repeating itself with the same ‘then’ card.

Hi Jamie @Jamie

I’m trying to find a way to connect/read data from the Amazon Smart Air Quality sensor. I read somewhere that the HA Echo integration can read its data readings, but so far I haven’t found a way to get it to work with Homey. It connects to your Amazon account in the same way Echo devices do, and is fully accessible from Echo devices, but I haven’t yet found a way to get this information in to Homey. This is what it looks like in the Alexa mobile app, but I was hoping to be able to create Flows with it:

I was hoping you might be able to offer some insights?

Much appreciated
Andy

So,

Currently I support switches and lights and general on/off, and yeah I figured out how to add support for other things, (One of my echo devices has a temp sensor I am able to get).

The reason why I havent is because I dont think there is a way to read the sensor data from the websocket, I just don’t think it exists.

Which means in order for this to work - It ‘polls’ to find out if it has changed … imagine someone ringing your door bell every 90 seconds to see if you home.

With polling comes a whole bunch of other issues like … am I flooding, is there a small chance I will draw attention to myself and they will try and block my app (again).

So short answer is yes I could do that, and have done in the past (the lights and switches) but not really a priority for me, I dont have any sensors in my house where I need to go via alexa cause its not available in homey.

New version 8 of the app has been running with the testers for 2 days now, 0 reconnects 0 crashes.

By far much much more stable then the hotfix I did, releasing to the main channel - have fun.

Well, I’m currently using the Echo app—the one for Alexa—since the other version stopped working. Now that it’s up and running again, I’ve noticed it’s picking up these “ghost” devices—which actually turn out to be groups. It would be a good idea to rename them; otherwise, how are you supposed to know what they refer to? Also, it would be really helpful if the app could import these groups properly—especially since there are certain actions you

might want to trigger for an entire group rather than for individual devices. It’s a bit like how the other Amazon Echo app handles things.

Yeah I don’t think they are groups mate.

They look to be virtual connections created by the echo app.

You can go on the Amazon website go to your devices and remove them if you need to but best to talk to the other author about why it’s created multiple devices …

Fyi I purposefully hide groups cause when I had them in the app there were a lot of issues with out of sync announcements and music messing about - that was a couple years ago I haven’t tested it since.

Having an in issue configuring this app on a self hosted homey installation. After installing the app and clicking on configure, the webpage opens on my local address http://192.168.25.15:3086 and I type in my email address for Amazon/Alexa. I then receive this:

The connection for this site is not secure
192.168.25.15 sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

I’ve tried uninstall and reinstalling several times. I’ve reinstalled Homey SHS and restored from a backup, same issue. I’ve tried privileged and unprivileged container settings. Any additional advice? Thanks.

I’ve just tried a brand new SHS installation in Proxmox and I’m getting the same error. This is on a different subnet and my computer is on that same subnet just to remove some variables, but it doesn’t appear to be a dns, routing, acl or firewall issue to me.

Was going to try out the app, but having the same issue.

Sorry you’re having trouble and thanks for trying and reporting here. I’ve tried a few more attempts including on a Homey Pro Mini (on the same subnet) and I’m receiving the same results. I get a similar error in the other Alexa/Echo related app as well, though that might be different. That one seems to crash immediately after installation.

Homey SHS, worked y’day. Today I can’t connect to Amazon. Sent his report: b5664389-39d1-4650-bf82-70154dfd96d1

Alexa App v8.0.0 – Voice ID / Person tag is always empty

Hi Jamie,

I’m using your Alexa app v8.0.0 on a Homey Pro 2023.

First of all, the new “Alexa heard a phrase” trigger works great! I’ve successfully created flows to start and cancel Alexa timers, including flashing Philips Hue lights when a timer expires.

However, I’m having a problem with the Person tag (Voice ID).

My partner Priska and I both have separate Alexa Voice IDs configured under the same Amazon account.

  • Both Voice IDs are enabled.

  • “Personalize Skills” is enabled for both profiles.

  • Alexa correctly recognizes both of us.

  • When I ask “Alexa, who am I?”, Alexa identifies me as Roger.

  • When Priska asks the same question, Alexa identifies her as Priska.

The problem:

When using the “Alexa heard a phrase” trigger in Homey, the Person tag is always empty, regardless of who speaks.

I’ve tested different commands, including:

  • “Alexa, set a timer for 10 seconds.”

  • “Alexa, who am I?”

The flow is triggered correctly, and the spoken phrase is received.

The Device tag also works and correctly returns “Alexa Wohnung”.

However, the Person tag is always an empty string for both Roger and Priska.

I’ve verified this by saving the Person tag into a Homey Logic text variable.

My question:

Is Voice ID recognition supposed to work with the new “Alexa heard a phrase” trigger in v8.0.0?

Is this a known issue, an Amazon API limitation, or is there an additional setting required?

I’d love to create different Homey actions depending on whether Roger or Priska is speaking.

Thanks for your help and for developing this great app!

Best regards,
Roger

Hello Jamie,
I had to restart my Homey Pro (2023) today. Now, when I try to connect to Amazon (the Alexa app), I get the following message: “This website cannot provide a secure connection. 192.168.2.92 has sent an invalid response. ERR_SSL_PROTOCOL_ERROR.” The app is currently running version 7.01.
The cause is likely that Amazon has recently added a Content Security Policy header with upgrade-insecure-requests to its login page.
Do you know yet when there will be an update for your Alexa app?
(I´m from Germany and use config from EU and India)

Thanks a lot
Eckhard

This is the same error I’ve been receiving.

Troubleshooting this particular problem, this is apparently what’s happening, with kudos for Homey support help.

Login helper on port 3086 serves plain HTTP (the response is proxied from amazon.com), but the login URL opened in the browser is https://:3086/ax/claim?…, so browsers fail with ERR_SSL_PROTOCOL_ERROR / SSL_ERROR_RX_RECORD_TOO_LONG. Reproduced on SHS (LXC), Pro Mini and a fresh SHS on macOS.