[Deprecated] Amazon Alexa Text to Speech (TTS) v0.6.2 - Direct Integration (USA, Canada, UK, Italy, Australia, & Brazil)

All,

I had some time off work so I implemented set/get volume controls. I have branched, updated and submitted a pull request to @ogiewon's github repository. In the meantime, you can take a look at GITHUB Repository

Cheers.

This is a great enhancement! Thank you. I have accepted your pull request, and I made some minor tweaks to the Child Alexa TTS driver. Nothing significant, just added an importURL to make it simpler to keep the code up to date, and I added the Refresh Capability which simply calls your new "getVolume" command. This will allow users to use Rule Machine to "Refresh" the volume without need for a custom command.

I have tested both the updated App and Driver. The setVolume works great. However I cannot seem to make the getVolume work. I keep getting the following errors:

app:2942019-04-04 09:32:50.671 pm error'getVolume()': Error making Call (getMessage): Bad Request
app:2942019-04-04 09:32:50.670 pm error'getVolume()': Error making Call (Status): 400
app:2942019-04-04 09:32:50.669 pm error'getVolume()': Error making Call (Data): [message:null]
app:2942019-04-04 09:32:50.259 pm debugParams: [uri:https://alexa.amazon.com/api/np/player?...

Any idea what is going on? It appears that the version of the App in the PR does not send a 'body' for the getVolume command??? That seems a little odd. Also, even if a valid response was returned, the code doesn't appear to do anything with it except perform a log.debug. This data would need to be sent back to the child to update its attributes.

@thomas.c.howard - It appears that today, the setVolume feature is no longer working for me. I am getting the following response...

[app:294](http://192.168.1.143/logs#app294)2019-04-05 05:55:51.234 pm [error](http://192.168.1.143/installedapp/configure/294)'setVolume()': Error making Call (getMessage): Not Found

[app:294](http://192.168.1.143/logs#app294)2019-04-05 05:55:51.232 pm [error](http://192.168.1.143/installedapp/configure/294)'setVolume()': Error making Call (Status): 404

[app:294](http://192.168.1.143/logs#app294)2019-04-05 05:55:51.229 pm [error](http://192.168.1.143/installedapp/configure/294)'setVolume()': Error making Call (Data): {"message":"No routes found","userFacingMessage":null}

Is it still working for you? I'm not sure what has changed since last night.

@thomas.c.howard I have temporarily removed the "volume" feature from my GitHub repository as I can no longer make it work, whatsoever. If you find some time to debug the changes, I will happily look into adding them back in. I just don't have time right now to debug why it no longer works.

I am taking a look at it now. For some reason, playing music on that device “restores” the ability for a time. Strange.

Thanks for removing the functionality. I will investigate and see if there is a reliable path forward.

1 Like

@csteele have you tried this method for the Alexa cookie:

Hi everyone. First time user. Setup went like clockwork per documentation. When I initiate a 'speak' command from the child device, I get the following in the logs:

'speakMessage()': Error making Call (getMessage): Bad Request
'speakMessage()': Error making Call (Status): 400
'speakMessage()': Error making Call (Data): {"message":null}

I've seen references to this error in the past but the resolution is unclear to me. Can someone steer me in the right direction? Thanks!

Welcome to Hubitat! :smiley:

The 400 error means that you're not authenticated. Did you add your cookie to the app settings?

Yep. I copied the featureaccess-v3 request headers from Chrome per the docs. It accepts the cookie and displays a list of the echo devices associated with my account. Does that not indicate authentication?

Yeah, it does. Are you sending a speak command to an individual device or a group? The only time I've seen a 400 error is when I exceed the Amazon rate limit.

Individual Echo Dot. I have multiple on the account, but for testing purposes I've only enabled one for the app. It shows up on the device page as expected. I can enter a string in the text field but the "Speak" button doesn't result in the string being spoken, only the error I pasted above in the logs. Not sure if that helps...

Would it matter if the account is part of an Amazon Family? (mine is)

Technically it shouldn't matter. Mine is part of a family as well.

I'm going to throw this over to @ogiewon as I can't replicate the 400 error. I've tried speaking weird strings (with non-alpha characters) and also changing my cookie and still can't reproduce it. :frowning:

Cool. Thanks for the help. For what it's worth, the string I was putting in was "test". Nothing fancy going on here... :slight_smile:

I figured as much. Can you try with another device as well (if you haven't already)? Maybe it's something to do with just that Dot? I don't currently have any Dots on my account.

Is your account the Primary user account for the Amazon Echo/Dot/Spot/Show/etc... devices? I'm not saying that it needs to be, but that might be it...

It definitely seems strange that you can retrieve the list of Alexa devices, but then cannot get them to 'Speak'...

I got it to work finally, but the resolution is less than satisfying.

To rule out anything odd on the Amazon account side, I deregistered/reregistered the Dot I've been using for testing. Now everything is working properly. To answer your question, yes the Dot was registered to the Primary user account (mine). That didn't change when I de/re registered. shrug

I guess turning it off and back on again cleared the problem. lol

2 Likes

ok i been trying ot get the auto refresh working again. I am having no luck.

Using latest version. When i do the cookie via the browser it works great. Anyone have any ideas?

Here is the info i have:
refresh options in browser window:
{"loginCookie":"io=LG5mXDK0-rJXL3dMAAAA; frc=VeZ3bwjixDwBo4OljvkZBmCet5GU3EsNfIKGEUychzjDcFanxmSKn9i2drsosCYImZ8fkuakUO46TpeqeV83P/R+VNZb6uFjm++IfTyL4OnUp/CKB4EC4qNZg6SByubWJRD9ZFgaTNfVB7970a9fL3JVZO0XcUGpF48RLhUEOoIitKVrVkFxXkMRmRhobsLk5azxYHOCCfJWVyWT517Q/gFx8KMyaIlGkukoWmMuJz1M76uGdT8s+XI7g3l0auw+ZT7lTx2X+CID7ASo/DxcX1lKRQh/mF1Eo72p8C7NOPPU7zKJxN6qMo+PFzoawLsT26+fTzjkDHJGykiuP7vb3jiMYEaAA0EKQavqtBIYWwVPbfo9iS1XN+LsIEKKoUc8TJrU96eu2z5VU74DDGwMg2S8Cj9qpY7JhQ==; map-md=eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ==; session-id=137-4493612-8570936; session-id-time=2187125215l; csm-hit=tb:D1K9218E9RRE5QPR2QYZ+s-D1K9218E9RRE5QPR2QYZ|1556405217389&t:1556405217389&adb:adblk_yes; ubid-main=133-2095874-9288643; session-token="sh24B6x1xIeD32DkGeCZ886Sgznklkhhq9jgK825Al+B2lk3M+RO2loNTXXRDH/9nLbXsZPirjVsVwPFOpIEyL7HSh31uK/hJbYOpU66z+N+CU+9xBeiw0wJyxlyNNxHRt9zFwMi9d7PF+DguipYv6G1hCNVdI0NOW2Ec9uz2Ajpnm6HiQXaLNN4TonG4f71wFzKQYiwt+FrJ+40Q92AKFjNjRmG1V2Hr/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pbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ==","deviceId":"850768238548124736465503871617830872013175411314106517720886323523413249564c5635564d32573831","deviceSerial":"40f2ade2547bb0f7b5196cb9d731f0c0","refreshToken":"Atnr|EwICIPGNsdfGp2tUGjDfbuhq4FrJrKfJz3kzLHIUR4d_HKOPDDRnqj63ICY111KJD2o92oPi41wVOb3cGUcuBcYvMa20Gb0AFUSpiqIAl7XZnCV0StYXA-38TsnnlCtlLMw0_jSdoM_vIu3QW9yPrwrcUE7r1_HdNB549dMmXY3OrWAXMwe9UbL_4HXVwmMKRVIdCWoovXKwYbSnEgQ9kNnXGoGXDaeN5yzvi1s_6lTKO-FvRgNahiPkGnCd9ZlKLu_Sl7DZCQIdN-3VAt-JvahMwukxvuQlkswekcGuew2hzzFUvq5CU9ev-9DpoElx3O-jIiJ-NSCvj29fG-06xdsak1Yrb0QcxPET_dBDBsWhqHBdbGJolBRAfXCjwVbS06aaoPGIrU7M9F9e8WS47sYuYI_jMhS3WgiZNTsHUWDZrFwHfYvkan0WstMq54FbwUNTig0","tokenDate":1556405237882,"amazonPage":"amazon.com","localCookie":"session-id=145-5061037-2849804; session-id-time=2187125238l; ubid-main=132-4421658-7914967; x-main=kTBpwFQ309nurKesR3c9Znr2SmiISbrP; at-main=Atza|IwEBIHiui-RYGwQECKIo_lSGdP9NwbOtKNiM3DDeBHh-e0wf29ZEYkMjSHiuNdOR2Dt5duK7nf70M07r-HZ5DG2_fk6_LtDa2Z4xv7W-Sd4cd5uHE7fRGamB_LalR4Me8QL_gzW9boBTSYtShIxz47bhhpKYNbiHaTlUwrNqXDUNZ8xLR3rsYqW0ilkziG1pfXT48lfID8pvR3yskD_zXZg7bwCMlefIDandKwf4mLLuXOwvKGWPOhehdZMxlyPpKZQa4bySCl8oqyyUJsqTrsEjQO5i0RO1bqIl6qzFU_3b3cqNIzr8wQ6oLN4np7QpbtQQhNuUutkSP_Pq8FznS0fzpB5iO9ten8x5VGQ5sn9Va4FdPBDoClxhGf4b6zrqhKLseeRl1tGg2euNddmkiy_dmgk8VrqOyMDRyLBxWDKR7b7RdDg3j9FFzcacb0AVttCRDu6bW_Xjs0wMYUEI3yMqOKNo99seT39FDE31PbUIYh1j2w4M9kdBwDB8LljijFmXapIl2syjVCBJz46fhA2HUzMp; sess-at-main=TOkUlBpzsMylrrXZwrpLD/dlzskBQXfyXuv5EsIITsY=; csrf=-858471949","csrf":"-858471949"}

error i get:
app:4912019-04-27 05:47:49.323 pm error'refreshCookie()': Error making Call (getMessage): Bad Request
app:4912019-04-27 05:47:49.320 pm error'refreshCookie()': Error making Call (Status): 400
app:4912019-04-27 05:47:49.314 pm error'refreshCookie()': Error making Call (Data): ErrorSyntaxError: Unexpected token 5 in JSON at position 0 at JSON.parse () at createStrictSyntaxError (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\body-parser\lib\types\json.js:158:10) at parse (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\body-parser\lib\types\json.js:83:15) at C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\body-parser\lib\read.js:121:18 at invokeCallback (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\raw-body\index.js:224:16) at done (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\raw-body\index.js:213:7) at IncomingMessage.onEnd (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\raw-body\index.js:273:7) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1125:12) at process._tickCallback (internal/process/next_tick.js:63:19)
app:4912019-04-27 05:47:48.811 pm infoAlexa TTS: starting cookie refresh procedure

I just found out that my Zolo Halo will now work with this app! Not sure if it is already on this thread but I know that in the past only Alexa-made echos have worked!

1 Like

anyone have multiple dots and some dont speak sometimes? i have alexa annouce washer/dryer done and sometimes 1 out of 4 will and sometimes all will. its so random