This. Made. My. Day.
I just saw Midge Ure in concert a few weeks ago in Denver.
This. Made. My. Day.
I just saw Midge Ure in concert a few weeks ago in Denver.
Happy to have helped
Ultravox is a band I’ve not managed to see (despite being an un-reconstructed 80s throwback) but I still play Quartet every so often
C
I may have to nick this bit about creating strings and passing them to the TTS. Would cut down a couple of lines in my creepy script (which works perfectly thanks to everyone’s help)!
C
Argh, Looks like my cookie expired tonight and now I’m getting OTP texts every time Vera tries to speak through Alexa.
Is there anyway to prevent this?
How long has it been active?
C
Not unless you turn off 2 stage verification.
attach the otp to your password in alex tts variables. (passwordotp)
start a tts scene.
Once working remove the otp from alaxa tts variables
@therealdb May be in future code you could add an otp variable that gets automatically added to the password variable, then deleted once the cookie is received. We could the use automate/tasker to update the otp variable in vera once received. Just a thought on a work around.
I’m on vacation, but if you can elaborate more, I can add it for sure.
Enjoy your vacation.
Ok when your amazon account uses 2 stage verification, amazon send a onetime passcode (otp) to your registered device, normally a text to a phone or an email.
You can refresh your cookie by adding the otp to the end of your password variable in AlexaTTS ( [your password][otp usually 6 numbers] ). Then execute a TTS via Luup. Once you have executed A TTS the cookie gets renewed. You can then remove this otp from the password variable.
Now if there was a variable say, OnetimePassCode in the alexaTTS variables, and AlexaTTS appended that to the end of the password and after next execution deleted the OneTimePassCode and removed the appended OTP from the password. ( may be, if contains(password, OneTimePassCode) then delete OneTimePassCode and remove its value from the password. else if OneTimePassCode var !null append OneTimePassCode to password.)
It would be possible to use automate/tasker or similar to update the OneTimePassCode, when we receive a otp text.
Hope thats clear.
It lasted for 2 weeks.
Hmm, pretty sure mine’s been longer than that !
C
Ok, it seems doable. I will add this feature after my break.
Ok i have had a go at adding this my self
heres what i changed.
local function buildCommand(settings)
local args = "export EMAIL=%q && export PASSWORD=%q && export SPEAKVOL=%s && export TTS_LOCALE=%s && export LANGUAGE=%s && export AMAZON=%s && export ALEXA=%s && export TMP=%q && %s/" .. SCRIPT_NAME .. " "
local username = getVar("Username", "", masterID, MYSID)
local password = getVar("Password", "", masterID, MYSID) .. getVar("OneTimePassCode", "", masterID, MYSID) --my edit
local volume = getVarNumeric("DefaultVolume", "", masterID, MYSID)
local defaultDevice = getVar("DefaultEcho", "", masterID, MYSID)
local alexaHost = getVar("AlexaHost", "", masterID, MYSID)
local amazonHost = getVar("AmazonHost", "", masterID, MYSID)
local language = getVar("Language", "", masterID, MYSID)
setVar(MYSID, "OneTimePassCode", "", masterID) -- my edit
local command = string.format(args, username, password,
(settings.Volume or volume),
(settings.Language or language), (settings.Language or language),
amazonHost, alexaHost,
BIN_PATH, BIN_PATH,
(settings.Text or "Test"),
(settings.GroupZones or defaultDevice))
return command
end
and
-- init default vars
initVar(MYSID, "DebugMode", 0, devNum)
initVar(MYSID, "Username", "******@gmail.com", devNum)
initVar(MYSID, "Password", "******", devNum)
initVar(MYSID, "DefaultEcho", "Lounge", devNum)
initVar(MYSID, "DefaultVolume", 50, devNum)
initVar(MYSID, "OneTimePassCode", "", devNum) -- my edit
-- init default values for US
initVar(MYSID, "Language", "en-uk", devNum)
initVar(MYSID, "AlexaHost", "layla.amazon.com", devNum)
initVar(MYSID, "AmazonHost", "amazon.co.uk", devNum)
The plugin still runs and has added the variable OnetimePassCode. Just waiting for otp to confirm that what i have done will work.
Let me know if i could have done it better
Yep, it seems correct. If you want, submit a pull request, or I will add it after my return.
Ok Pull request done. I popped my cherry!
I will fully test when my cookie expires, not wanting to delete cookie as its a pain. Will report back If it works as expected.
That works great, thank you.
I am not using two step authentication on my Amazon account, however the TTS stops working after a while this is the second time its stopped working for me today.
Looking in the Storage\Alexa folder I only have two files:
.alexa.login
alexa_remote_control_plain.sh.
Last time it stopped working I manually did the cookie thing in Firefox browser again and added my cookie file.
Why is it not automatically renewing the cookie file ?
Thanks
I still had the .alexa.cookie file on my laptop’s desktop that I generated last time a few weeks ago.
I just uploaded it in to the Storage/Alexa folder using WinSCP and now the TTS is working again.
I did not edit or update that .alexa.cookie file in anyway.
I now have these files showing up.
So should my question of been why does the .alexa.cookie file and the other files seem to vanish from the Vera unit ?
After copying up the .alexa.cookie file again these are the files that reappeared.
.alexa.devicelist.all
.alexa.devicelist.json
.alexa.devicelist.txt
And the .alexa.login file I could see initially has now gone.
Looking at the .alexa.cookie file that I had just hanging about on my desktop, it was modified on 21st January, so presumably that was the date I used the Firefox browser and plugin to generate it.
So the TTS has worked for nearly a month.
I’ve had this happen once only. And I have a copy of the cookie file in the alexa folder in case it happens again.
Probably should have looked in the login file to see what it said. May have been a one time captcha type thing if you’ve been behaving oddly.
C
I was browsing the Internet earlier on my laptop / Chrome browser, looking at shopping sites and I think I clicked on something in Google Search results to go to an Amazon webpage and it did ask me to enter a captcha to proceed.
Yep, you can get a captcha from time to time. Let me think about a backup feature of the cookie.
Best Home Automation shopping experience. Shop at Ezlo!
© 2024 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules