tonesto7 / echo-speaks

Integrate your Amazon Echo devices into your Hubitat environment to create virtual Echo Devices. These virtual devices will allow you to speak text, make announcements, control media playback including volume, and many other Alexa features.
https://tonesto7.github.io/echo-speaks-docs/
110 stars 178 forks source link

(BUG) Cannot get Amazon cookie #1126

Closed flesh420x closed 10 months ago

flesh420x commented 10 months ago

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!


About Your Setup

Expected Behavior

When I click the login button to get the amazon cookie for the server it should get my login and say "authentication good."

Current Behavior

When signing in it refreshed back to the server page as it's supposed to but does not show a login cookie nor does it show in the Hubitat settings that I've been logged in.

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. can share video with you, tell me how.

Context

**How has this issue affected you? What are you trying to accomplish? I cannot use echo speaks atm. It used to work until my Heroku was shutdown (I'm not paying them). It worked a little when I first set it up on Docker but was slow to respond after the first attempt to send commands.

Providing context helps us come up with a solution that is most useful in the real world Help me understand what the problem may be, if it's me, the code, or hubitat. Get signed in and continue using EchoSpeaks


Please include a copy of any relevant log output to assist in tracking down the bug

  |   -- | -- diagDt | "Wed Sep 06 10:29:52 EDT 2023" app |   version | "4.2.3.0" installed | "Tue Sep 05 17:53:08 EDT 2023" updated | "Tue Sep 05 18:37:47 EDT 2023" timeZone | "US/Eastern" lastVersionUpdDt | "Wed Sep 06 10:14:12 EDT 2023" config | "4.0" flags |   pollBlocked | false resumeConfig | false serviceConfigured | true deviceRefreshInProgress | false noAuthActive | true missPollRepair | false pushTested | null updateAvailable | false devices |   addEchoNamePrefix | true autoCreateDevices | true autoRenameDevices | true bypassDeviceBlocks | false createOtherDevices | true createTablets | false createWHA | true echoDeviceFilters | 0 stateUsage | "2%" warnings |   0 |   dt | "Wed Sep 06 04:01:52 EDT 2023" gt | 1693987312941 message | "401 getBluetoothResp" 1 |   dt | "Wed Sep 06 04:01:52 EDT 2023" gt | 1693987312983 message | "401 DnDResp" 2 |   dt | "Wed Sep 06 04:01:53 EDT 2023" gt | 1693987313558 message | "Cookie Data has been cleared and Device Data Refreshes have been suspended..." 3 |   dt | "Wed Sep 06 04:01:53 EDT 2023" gt | 1693987313647 message | "Amazon Cookie Has Expired or is Missing!!! Please login again using the Local Server Web Config page..." 4 |   dt | "Wed Sep 06 07:37:53 EDT 2023" gt | 1694000273227 message | " The Amazon login info has expired! Please open the heroku amazon authentication page and login again to restore normal operation." errors |   0 |   dt | "Wed Sep 06 04:01:53 EDT 2023" gt | 1693987313035 message | "getMusicProviders \| Stack Trace: groovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized\n at user_app_tonesto7_Echo_Speaks_358.getMusicProviders(user_app_tonesto7_Echo_Speaks_358.groovy:2593)\n at user_app_tonesto7_Echo_Speaks_358.getMusicProviders(user_app_tonesto7_Echo_Speaks_358.groovy)\n at user_app_tonesto7_Echo_Speaks_358.getOtherData(user_app_tonesto7_Echo_Speaks_358.groovy:2618)\n at user_app_tonesto7_Echo_Speaks_358.initialize(user_app_tonesto7_Echo_Speaks_358.groovy:1547)\n at user_app_tonesto7_Echo_Speaks_358.missPollNotify(user_app_tonesto7_Echo_Speaks_358.groovy:4984)\n at user_app_tonesto7_Echo_Speaks_358.healthCheck(user_app_tonesto7_Echo_Speaks_358.groovy:4826)" 1 |   dt | "Wed Sep 06 04:01:53 EDT 2023" gt | 1693987313102 message | "The last 3 Authentication Validations have failed \| Clearing Stored Auth Data \| Please login again using the Echo Speaks service..." 2 |   dt | "Wed Sep 06 04:01:53 EDT 2023" gt | 1693987313196 message | "cookieRefresh: Required Registration data is missing for Cookie Refresh [:]" actions |   version | null count | 0 warnings | [] errors | [] zones |   version | null count | 0 warnings | [] errors | [] devices |   version | null count | 0 lastDataUpdDt | "Wed Sep 06 03:45:15 EDT 2023" models | {} zoneDevs | [] warnings | [] errors | [] speech | [] hub |   platform | "Hubitat" firmware | "2.3.5.152" type | "PHYSICAL" authStatus |   cookieValidationState | false cookieValidDate | null cookieValidDur | null cookieValidHistory |   0 | false 1 | false 2 | false cookieLastRefreshDate | null cookieLastRefreshDur | null cookieInvalidReason | null cookieRefreshDays | 5 cookieItems |   hasLocalCookie | false hasCSRF | false hasDeviceId | false hasDeviceSerial | false hasLoginCookie | false hasRefreshToken | false hasFrc | false amazonPage | null refreshDt | null tokenDate | null cookieData | "Not Shared" alexaGuard |   supported | null status | null dataSrc | null lastSupportCheck | null lastStateCheck | null lastStateUpd | null stRespLimit | null server |   version | "2.8.0" amazonDomain | "amazon.com" amazonLocale | "en-US" lastServerWakeDt | "Wed Sep 06 10:07:53 EDT 2023" lastServerWakeDur | "21 mins, 59 secs ago" serverPlatform | "Local" hostUrl | "http://LocalIP:8091" randomName | null versionChecks |   minVersionUpdates |   updRequired | false updItems | [] updateItemsOther | [] bluetoothData | null dndData | null
diagDt "Wed Sep 06 10:29:52 EDT 2023" app version "4.2.3.0" installed "Tue Sep 05 17:53:08 EDT 2023" updated "Tue Sep 05 18:37:47 EDT 2023" timeZone "US/Eastern" lastVersionUpdDt "Wed Sep 06 10:14:12 EDT 2023" config "4.0" flags pollBlocked false resumeConfig false serviceConfigured true deviceRefreshInProgress false noAuthActive true missPollRepair false pushTested null updateAvailable false devices addEchoNamePrefix true autoCreateDevices true autoRenameDevices true bypassDeviceBlocks false createOtherDevices true createTablets false createWHA true echoDeviceFilters 0 stateUsage "2%" warnings 0 dt "Wed Sep 06 04:01:52 EDT 2023" gt 1693987312941 message "401 getBluetoothResp" 1 dt "Wed Sep 06 04:01:52 EDT 2023" gt 1693987312983 message "401 DnDResp" 2 dt "Wed Sep 06 04:01:53 EDT 2023" gt 1693987313558 message "Cookie Data has been cleared and Device Data Refreshes have been suspended..." 3 dt "Wed Sep 06 04:01:53 EDT 2023" gt 1693987313647 message "Amazon Cookie Has Expired or is Missing!!! Please login again using the Local Server Web Config page..." 4 dt "Wed Sep 06 07:37:53 EDT 2023" gt 1694000273227 message " The Amazon login info has expired! Please open the heroku amazon authentication page and login again to restore normal operation." errors 0 dt "Wed Sep 06 04:01:53 EDT 2023" gt 1693987313035 message "getMusicProviders | Stack Trace: groovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized\n at user_app_tonesto7_Echo_Speaks_358.getMusicProviders(user_app_tonesto7_Echo_Speaks_358.groovy:2593)\n at user_app_tonesto7_Echo_Speaks_358.getMusicProviders(user_app_tonesto7_Echo_Speaks_358.groovy)\n at user_app_tonesto7_Echo_Speaks_358.getOtherData(user_app_tonesto7_Echo_Speaks_358.groovy:2618)\n at user_app_tonesto7_Echo_Speaks_358.initialize(user_app_tonesto7_Echo_Speaks_358.groovy:1547)\n at user_app_tonesto7_Echo_Speaks_358.missPollNotify(user_app_tonesto7_Echo_Speaks_358.groovy:4984)\n at user_app_tonesto7_Echo_Speaks_358.healthCheck(user_app_tonesto7_Echo_Speaks_358.groovy:4826)" 1 dt "Wed Sep 06 04:01:53 EDT 2023" gt 1693987313102 message "The last 3 Authentication Validations have failed | Clearing Stored Auth Data | Please login again using the Echo Speaks service..." 2 dt "Wed Sep 06 04:01:53 EDT 2023" gt 1693987313196 message "cookieRefresh: Required Registration data is missing for Cookie Refresh [:]" actions version null count 0 warnings [] errors [] zones version null count 0 warnings [] errors [] devices version null count 0 lastDataUpdDt "Wed Sep 06 03:45:15 EDT 2023" models {} zoneDevs [] warnings [] errors [] speech [] hub platform "Hubitat" firmware "2.3.5.152" type "PHYSICAL" authStatus cookieValidationState false cookieValidDate null cookieValidDur null cookieValidHistory 0 false 1 false 2 false cookieLastRefreshDate null cookieLastRefreshDur null cookieInvalidReason null cookieRefreshDays 5 cookieItems hasLocalCookie false hasCSRF false hasDeviceId false hasDeviceSerial false hasLoginCookie false hasRefreshToken false hasFrc false amazonPage null refreshDt null tokenDate null cookieData "Not Shared" alexaGuard supported null status null dataSrc null lastSupportCheck null lastStateCheck null lastStateUpd null stRespLimit null server version "2.8.0" amazonDomain "amazon.com" amazonLocale "en-US" lastServerWakeDt "Wed Sep 06 10:07:53 EDT 2023" lastServerWakeDur "21 mins, 59 secs ago" serverPlatform "Local" hostUrl "http://LocalIP:8091/" randomName null versionChecks minVersionUpdates updRequired false updItems [] updateItemsOther [] bluetoothData null dndData null
flesh420x commented 10 months ago

I was able to get this figured out. Turns out you HAVE to use the ipAddress variable when using bridge mode in docker. You also need to use the cloud.hubitat.com/api line for the callback URL or it will not work. For some weird reason I also had to delete and re-add the port mappings for it to show up. I now have it deployed and working as quick as it did when using Heroku