Hubitat caches the audio clips once, and uses that cached version from then on as long as the text requested does not change, and you have not changed the Polly Voice for the Hubitat Hub in the Settings menu. The only other thing that could cause the cache to need to be refreshed is if the cache runs out of disk space on the hub.
@ogiewon:
We just got a number of Alexa devices, so I'm trying (very late to the party), to get this working.
I seem to be having some difficulty in putting in my initial cookie data, and I get the following error message in my log:
oops sorry. I will be using a pi zero w. I suppose before I get into this I should ask if this is a good alternative to Echo Speaks. I only use ES for the virtual devices and I see that it is a very busy app when I look at my logs.
And...if your goal is to simply use Echos for a few standard, canned announcements, I would even say you'd be better off simply using a Hubitat Virtual Contact sensor to trigger an Alexa Routine to play an announcement. The downside is you need a virtual contact sensor for each announcement, and those announcements cannot be changed at runtime. But, you do not require any custom code on your Hubitat hub to achieve this!
I'd want to be able to do a little more customization than that but I don't need any of the extra stuff that ES has. I think this is the way for me to go I just need to get a little help with the nodejs part.
Just having some issues refreshing my cookie with the automatic method with nodejs
The server is up and running. I can hit the url etc.
Thoughts?
Thanks
Mike
app:5962021-02-19 09:45:51.916 am error'getCookie()': Error making Call (getMessage): Internal Server Error
app:5962021-02-19 09:45:51.913 am error'getCookie()': Error making Call (Status): 500
app:5962021-02-19 09:45:51.909 am error'getCookie()': Error making Call (Data): Error refreshing cookie => ERROR: getaddrinfo EAI_AGAIN api.amazon.com
app:5962021-02-19 09:45:51.874 am infoAlexa TTS: starting cookie download procedure
app:5962021-02-19 09:40:51.784 am infoAlexa TTS: Request for new cookie sent succesfully, guid: 91a3c179-9ccf-4976-ab0d-337f7c81d841
app:5962021-02-19 09:40:51.729 am infoAlexa TTS: starting cookie refresh procedure
@ogiewon I'm not sure why, but every couple of weeks I get the "Check cookie" msg and I need to manually refresh the cookie - I don't even need to touch my AlexaCookie Server.
Is there any way you can automate the refresh cookie process so when it expires it just auto-refreshes itself?
You could easily modify this to change the number of days between refreshes, or the time of day that the refresh is attempted.
The problem with attempting to automatically refresh the cookie whenever there is an error, is that we aren't 100% sure what causes the errors, and we want to avoid creating an infinite loop.
As you can see in the code... it pretty much always defaults to "Check your Cookie" for all unhandled errors that are thrown by the Amazon servers. Thus, we'd need more details about the very specific circumstances of your failure mechanism, to try and trap the error for the very specific scenario you're experiencing.
I try to keep this integration as simple as possible...and I did not write the automatic cookie refresh piece of it at all... Perhaps @gabriele might have some ideas, as he wrote the AlexaCookie portion?
Could you please make the Refresh time & Frequency user-configurable so if I change the time, and the driver gets updated, I don't lose the setting?
EDIT: one other option that springs to mind is having the HE App refresh the cookie once on error and if that fails, then ping the user (and dont keep retrying).