thorsten-gehrig/alexa-remote-control

Domoticz integration and quick sound & voice wrapper script

soif opened this issue · 3 comments

soif commented

First a big THANK YOU for your excellent script.

I've just made an integration for Domoticz as a dzVent script, that can speak any sentence or play any sound, when a device state changes. You can find it at:
https://github.com/soif/domoticz_scripts

BTW it use some (totally independant) bash scripts, that "wrap" your alexa-remote-control script to allow very short and fast command to play a sound or speak a sentence, examples:

  • soif_alexa_speak.sh "Hello, I'm happy to be here" (play this sentence, optionnally using the voice defined in the configuration file)
  • soif_alexa_sound.sh alarm (play the "alarm" shorcut to a sound from the Amazon library, defined in the configuration file)
  • soif_alexa_sound.sh https://xxx.com/yyy.mp3 (play this mp3 file)
  • soif_alexa_sound.sh human/amzn_sfx_crowd_boo_01 (play this sound, from the Amazon Library)

All theses script are played to the alexa device defined in the configuration file, but can be ovveriden, by simply adding the "-d" option at the end (all your orignial argument are also supported).

The configuration file also allow to pass all your variable (ie login,password, mfa, domains, etc...) directly to your script, without having to edit it, using the simple soif_alexa.sh wrapper.

I've also added a simple soif_alexa_2fa.sh that wraps the oathtool command ( using the MFA_SECRET as defined in the configuration file) to easily generate reponse codes...

HTH

adn77 commented

check out the latest feature which doesn't rely on username/password/mfa but uses the refresh_token returned by proper device registration: https://github.com/adn77/alexa-cookie-cli

or more on my blog: https://blog.loetzimmer.de/2021/09/alexa-remote-control-shell-script.html

soif commented

Thanks for the information, i just tested it and it worked like a charm.
Thanks too for the ready-to-use binaries.

BTW Please notice that the options use "-P" twice:

-P, --baseAmazonPage <amazon.com|amazon.co.jp>  optional: Change the Proxy Amazon Page - all "western countries" directly use amazon.com! Change to amazon.co.jp for Japan
-P, --proxyPort <port>                          optional: use this port for the proxy, default is 8080 (default: 8080)

HTH

adn77 commented

Thanks for noticing :)
I fixed it now