For those real noobs like me, don't forget to add a semicolon at the end of your string or the device list won't show your Alexa device(s)
Other than that, I had no issues
Rick
For those real noobs like me, don't forget to add a semicolon at the end of your string or the device list won't show your Alexa device(s)
Other than that, I had no issues
Rick
interesting... I have never added a semicolon to the end of the string.
All,
I have trapped the invalid data response coming from Amazon when the cookie is invalid. This will prevent the web page error that has been reported. Thank you all for helping to test this integration and make it better.
Grab the latest code from here.
It looks like if you copy the entire cookie from developer tools then the semicolon is required at the end so I updated my instructions.
I've re-generated the cookie multiple times and the copy from developer tools always works so there's no need to install that extension and manually build the cookie yourself.
Here are some quick instructions on getting the cookie from Chrome Developer tools. Hopefully it will help. @ogiewon is going to update his readme with them as well.
I am struggling with the cookie - instructions seem pretty clear. I now see an error in the log as follows:
2018-10-21 16:34:20.979:errorEncountered an error. http resp.status = '200'. http resp.contentType = 'text/html'. Should be '200' and 'application/json'. Check your cookie string!
Could the fact that I am in the uk be causing any issues - my cookie comes from alexa.amazon.co.uk (I tried changing the .coms in the app but did not help).
Yes I think this could be an issue. I have not looked at the code myself though. Seems like there were a few places in the original script that had to be adjusted for this.
@ogiewon will likely know better.
Yes, this is specifically for the US right now. I believe it could be made to work for the UK as the original code this is based on did seem to have support for it. I just haven't added that support yet, and will need someone, like yourself, to test it.
More than happy to do so and report back. I pretty sure there will be others who are willing. Is this the block that need to change or does it get more complex:
def params = [uri: "https://pitangui.amazon.co.uk/api/behaviors/preview", headers: ["Cookie":"""${alexaCookie}""", "Referer": "https://alexa.amazon.co.uk/spa/index.html", "Origin": "https://alexa.amazon.co.uk", "csrf": "${csrf}", "Connection": "keep-alive", "DNT":"1"],
It is these variables in the original script. There are likely several calls that need to be adjusted.
#LANGUAGE="en-GB"
LANGUAGE="en-US"
#AMAZON='amazon.de'
#AMAZON='amazon.co.uk'
AMAZON='amazon.com'
#ALEXA='layla.amazon.de'
#ALEXA='layla.amazon.co.uk'
ALEXA='pitangui.amazon.com'
There are at least two blocks like that. I am not sure if anything needs to change, or if your edits are correct though. The original source can be found at ha-alexa-tts/alexa_remote_control.sh at master · walthowd/ha-alexa-tts · GitHub
And @cwwilson08 has posted above what appears to be the required changes.
@Jim_UK, please let me know if these changes work for you and I will try to modify the App to allow a choice between the two contries.
Great thanks for pointers - will report back soon.
This is really cool @ogiewon.
It works well for the most part. It sends each device the request independently, which makes it rather slow, of course. I think nothing you can do about that. However, I get the following error on some of the requests pretty consistently.
This happens on a specific device whether bulk messaging or sending a test from the device property page.
error'speakMessage()': Error making Call (getMessage): Bad Request
error'speakMessage()': Error making Call (Status): 400
error'speakMessage()': Error making Call (Data): [message:null]
This happens when I'm sending messages to all 6 devices.
error'speakMessage()': Error making Call (getMessage): Bad Request
error'speakMessage()': Error making Call (Status): 400
error'speakMessage()': Error making Call (Data): [message:Rate exceeded]
I think you may be able to send one command to a group created in the alexa app. Just use the name of the group in place of the individual devices.
Groups don't show up in the list in HE.
Works north of the wall (Canada) as well
thank you!
Well it is still an early release. I am sure @ogiewon can look into it when he has times. I don't think it should be too hard to include groups in the list.
As to the errors you are getting, it looks like the app is sending too many requests all in a row and making amazon mad...
Yup, looks like 3 is the limit before she starts complaining and giving me the cold shoulder.
Agreed. I just tried to add a group of Alexa devices in th Alexa app, and it did not show up. I also removed the device filter from the Alexa TTS Manager App to expose the “Everywhere” device as a test. Unfortunately, it does not work either.
How does Spotify access individual echo's and "music" groups (vs device groups) as well as volume?