Alexa alexa-remote-control script

Forum dédié aux questions concernant la configuration de votre serveur sous Linux
Abbij
Messages : 63
Inscription : 28 oct. 2019, 08:06

Re: Alexa alexa-remote-control script

Message par Abbij »

Je reviens vers vous car tout fonctionnait parfaitement mais depuis ce matin plus rien
J'ai un message d'erreur
Pour info j'utilise le MFA, j'ai bien installé jq et fait le chmod +x
2021-11-21 (1).png
2021-11-21 (1).png (47.41 Kio) Consulté 4007 fois
Quelqu'un aurai une idée? :|
Abbij
Messages : 63
Inscription : 28 oct. 2019, 08:06

Re: Alexa alexa-remote-control script

Message par Abbij »

Bonjour à tous

J'ai trouvé la solution, même si étant débutant je ne pense pas aider grand monde, on sait jamais ;)

Les 2 scripts se perturbent entre les fichiers temporaires d'où les erreurs

J'ai recommencé avec alexa_remote_control.sh les lignes de commandes fonctionnent toutes en effet dans la version plain il faut noté les noms d'appareils avec des "_" que la version normal c'est des espaces
jojomul1983
Messages : 74
Inscription : 23 févr. 2019, 18:22

Re: Alexa alexa-remote-control script

Message par jojomul1983 »

Code : Tout sélectionner

/home/pi/domoticz/scripts/alexa_remote_control.sh -a
/home/pi/domoticz/scripts/alexa_remote_control.sh: ligne 120: 
# something like:
#  1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG

# this can be obtained by doing the device registration login flow
#  e.g. from here: https://github.com/Apollon77/alexa-cookie/
#SET_REFRESH_TOKEN=

SET_LANGUAGE=fr-FR
#SET_LANGUAGE=en-US

SET_TTS_LOCALE=fr-FR

SET_AMAZON=amazon.fr
#SET_AMAZON=amazon.com

SET_ALEXA=alexa.amazon.fr
#SET_ALEXA=pitangui.amazon.com

# cURL binary
SET_CURL=/usr/bin/curl

# cURL options
#  -k : if your cURL cannot verify CA certificates, youll: Aucun fichier ou dossier de ce type
cookie does not exist. logging in ...
/home/pi/domoticz/scripts/alexa_remote_control.sh: ligne 526: -k : commande introuvable
grep: /tmp/.alexa.header: Aucun fichier ou dossier de ce type
/home/pi/domoticz/scripts/alexa_remote_control.sh: ligne 532: -k : commande introuvable
awk: cannot open /tmp/.alexa.cookie (No such file or directory)
/home/pi/domoticz/scripts/alexa_remote_control.sh: ligne 547: -k : commande introuvable
grep: /tmp/.alexa.header2: Aucun fichier ou dossier de ce type
ERROR: Amazon Login was unsuccessful. Possibly you get a captcha login screen.
 Try logging in to https://alexa. with your browser. In your browser
 make sure to have all Amazon related cookies deleted and Javascript disabled!

 (For more information have a look at /tmp/.alexa.login)

 To avoid issues with captcha, try using Multi-Factor Authentication.
 To do so, first set up Two-Step Verification on your Amazon account, then
 configure this script (or the environment) with your MFA secret.
 Support for Multi-Factor Authentication requires 'oathtool' to be installed.
Quelqu'un pourrait m'aider, j'ai vraiment du mal.
Darkneo
Messages : 68
Inscription : 16 déc. 2018, 08:50

Re: Alexa alexa-remote-control script

Message par Darkneo »

Hello!

Je viens filer un petit coup de main, si je peux...

Dans le fichier alexa_remote_control.sh, il faut que tu settes toutes les valeurs, sinon cela ne fonctionnera pas...

Code : Tout sélectionner

SET_EMAIL='email de ton compte Amazon'
SET_PASSWORD='Very_Secret_Amazon_Account_Password'
SET_MFA_SECRET='voir la procédure pour avoir la clé MFA sur github'
# something like:
#  1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG

# this can be obtained by doing the device registration login flow
#  e.g. from here: https://github.com/Apollon77/alexa-cookie/
SET_REFRESH_TOKEN=''

SET_LANGUAGE='fr-FR'
#SET_LANGUAGE='en-US'

SET_TTS_LOCALE='fr-FR'

SET_AMAZON='amazon.fr'
#SET_AMAZON='amazon.com'

SET_ALEXA='alexa.amazon.fr'
#SET_ALEXA='pitangui.amazon.com'
Et il faut que tu installes oathtool et jq:

Code : Tout sélectionner

apt-get install jq
apt-get install oathtool
jojomul1983
Messages : 74
Inscription : 23 févr. 2019, 18:22

Re: Alexa alexa-remote-control script

Message par jojomul1983 »

Merci, mais .....

En fait, j'avais déjà repris toute l'installation, c'est ok depuis un bon moment.

Le seul truc que je voudrais ajouter, c'est le volume entre "jour" et "nuit".

Mais modifier le script pour ça, j'en suis incapable, auriez-vous une idée ?
Abbij
Messages : 63
Inscription : 28 oct. 2019, 08:06

Re: Alexa alexa-remote-control script

Message par Abbij »

Bonjour à tous

Depuis ce matin impossible de créer la liste des cookies
Le scripts ne fonctionne plus

Avez vous le même soucis?
TroisSix
Messages : 175
Inscription : 11 janv. 2016, 09:33

Re: Alexa alexa-remote-control script

Message par TroisSix »

J'ai aussi le soucis des cookies malgré la méthode mfa/oathtool... :(

Edit: ça fonctionne en utilisant le cookie-cli, et plus besoin de login/pwd/mfa !
VM Debian, Domoticz stable 2023.1, RFXtrx433E, Z-Stick Gen5
- rts: dio, sondes oregon, volets somfy
- zwave: fibaro fgs212, aeotec smart switch gen5, vision ZG8101,CO, Fumée
- IO Homecontrol: Connexoon, Velux
- harmony hub, philips hue, géoloc. Pilot
Abbij
Messages : 63
Inscription : 28 oct. 2019, 08:06

Re: Alexa alexa-remote-control script

Message par Abbij »

Merci pour le retour

En effet j'ai fait la deuxième méthode qui n'utilise plus oathool et cela fonctionne ;)
AchilleTalon
Messages : 112
Inscription : 26 sept. 2020, 13:47

Re: Alexa alexa-remote-control script

Message par AchilleTalon »

Bonjour,

Tout fonctionnait très bien chez moi, jusqu'à ce qu'on me demande de me ré-authentifier.

J'essaie moi-aussi d'utiliser la méthode "cookie-cli", mais sans succès jusqu'ici.
Pourriez-vous détailler la façon dont vous avez procédé ? J'ai l'impression d'avoir suivi les indications, mais je n'arrive pas à faire fonctionner.

Merci d'avance


EDIT : à la dernière tentative, ça a marché (refresh_token dela forme "Atnr|..."). Donc tout va bien !
Domoticz 2025.1 sur Raspberry 5/Bookworm
+ 2 RFlink (std+RTS)
+ SonoffZigbee 3.0 (E)
+ KLF200
- Alexicz
- Shelly (1, 1L, 2.5, TRV, 1Plus, ...)
- thermomètres, capteurs
- SIM+EG25-G
- caméras Tapo
- ...
PHP-IP
Messages : 126
Inscription : 31 janv. 2017, 19:51

Re: Alexa alexa-remote-control script

Message par PHP-IP »

Bon ben moi ça ne fonctionne plus :(
J'ai essayé de refaire le MFA secret mais non ça ne veut pas... :roll:
Répondre