Alexa alexa-remote-control script

Forum dédié aux questions concernant la configuration de votre serveur sous Linux
PHP-IP
Messages : 126
Inscription : 31 janv. 2017, 19:51

Re: Alexa alexa-remote-control script

Message par PHP-IP »

Merci pour la réponse.
En fait maintenant ça me lance bien sur un groupe avec l'option -d :shock:
Donc j'ai pas compris pourquoi ça ne le lançait pas au moment ou j'ai posé la question....
Abbij
Messages : 63
Inscription : 28 oct. 2019, 08:06

Re: Alexa alexa-remote-control script

Message par Abbij »

mulot35 a écrit : 05 sept. 2020, 19:52 salut après quelque galères pour installer le script (en double autentification) voici mon mémo:

Sur mon PC:
-Sur https://www.amazon.fr/
-Je me log
-Connexion et paramètres de sécurité/paramètres de vérification en deux étapes(2sv)/marche a suivre
-Puis "application d'authentification" puis sous le QR Code je clic sur "impossible de scanner le code-barre"
-J'obtient "aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa"

Je repasse sur mon raspberry:
je lance sudo apt-get install oathtool
oathtool -b --totp "aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa"
et j'obtient le code 123456

Sur mon PC:
-je rentre mon code 123456 puis clic sur verifier le code OTP avant de continuer
-je valide
-Via filezilla je dépose le script "alexa_remote_control.sh " dans /home/pi/domoticz/scripts/alexa_remote_control.sh
-Via filezilla je fait editer le fichier

Code : Tout sélectionner

SET_EMAIL='mail de connexion@chezamazon.fr'
SET_PASSWORD='mdp de connexion@chezamazon.fr'
SET_MFA_SECRET='aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa'
# something like:
#  1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG
#123456

SET_LANGUAGE='fr-FR;q=0.7,en;q=0.3'
#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'
-j'enregistre et je valide la modification puis envoie sur le pi
-je fait un : sudo chmod +x /home/pi/domoticz/scripts/alexa_remote_control.sh
-Je reboot le pi
-et lance un : sudo /home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:"bonjour"

j'obtient:
cookie does not exist. logging in ...
device list does not exist. downloading ...
setting default device to:
/home/pi/domoticz/scripts/alexa_remote_control.sh: 599: /home/pi/domoticz/scripts/alexa_remote_control.sh: jq: not found

/home/pi/domoticz/scripts/alexa_remote_control.sh: 603: /home/pi/domoticz/scripts/alexa_remote_control.sh: jq: not found
/home/pi/domoticz/scripts/alexa_remote_control.sh: 604: /home/pi/domoticz/scripts/alexa_remote_control.sh: jq: not found
/home/pi/domoticz/scripts/alexa_remote_control.sh: 605: /home/pi/domoticz/scripts/alexa_remote_control.sh: jq: not found
ERROR: unkown device dev:
Donc sur le pi je lance:
sudo apt-get install jq
et relance un : sudo /home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:"bonjour"

et bingo
Bonjour, Merci pour le tuto
C'est mon premier script, j'ai peut être pas choisi le plus simple :shock:
J'ai bien suivi les différents conseil de chacun
Dans domoticz j'ai une erreur 32256
de ce fait j'ai essayé de lancer dans la console, de debian, j'ai bien fait chmod +x
Et pourtant j'ai toujours en code retour commande introuvable
que je lance la ligne: sudo ./alexa_remote_control.sh -e speak:"bonjour" ; ./alexa_remote_control.sh -e speak:"bonjour"
ou avec le chemin complet
Si quelqu'un aurait une astuce?
TroisSix
Messages : 175
Inscription : 11 janv. 2016, 09:33

Re: Alexa alexa-remote-control script

Message par TroisSix »

Tu dois préciser l’appareil sur lequel tu veux que la phrase soit lue


Envoyé de mon iPhone en utilisant Tapatalk
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 la réponse que je nomme l'appareil ou que j'utilise -d"ALL" même souci :oops:
Dernière modification par Keros le 16 nov. 2021, 12:33, modifié 1 fois.
Raison : Merci de ne pas citer le message précédent lors d'une réponse directe
TroisSix
Messages : 175
Inscription : 11 janv. 2016, 09:33

Re: Alexa alexa-remote-control script

Message par TroisSix »

Regarde aussi ton message d'erreur, il te manque le package jq à priori?
Et ensuite fais un ./alexa_remote_control.sh -a, il devrait te lister tes appareils.
Attention aux accents dans le nom de tes appareils, ./alexa_remote_control.sh -d Sejour -e speak:"essai" (Sejour est différent de Séjour)
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 la réponse
J'ai bien installé jq

Malheureusement même résultat même avec la commande -a
2021-11-17.png
2021-11-17.png (44.9 Kio) Consulté 4183 fois
J'ai peut être mal activé quelque chose...
TroisSix
Messages : 175
Inscription : 11 janv. 2016, 09:33

Re: Alexa alexa-remote-control script

Message par TroisSix »

Mmmmh, pb d'interpréteur, tu as fait un copier coller du contenu du script vers ton éditeur vi ou nano?
Fais un dos2unix alexa_remote_control.sh et re-executes-le
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 la réponse

J'ai fait le script en nano
Je viens de refaire l'essai après avoir fait dos2unix
En effet ça avance un peu car je n'ai plus la même erreur

Et voici le message:
2021-11-17 (2).png
2021-11-17 (2).png (70 Kio) Consulté 4154 fois
TroisSix
Messages : 175
Inscription : 11 janv. 2016, 09:33

Re: Alexa alexa-remote-control script

Message par TroisSix »

Vraiment bizarre toutes ces erreurs… Repars depuis zéro: télécharge plutôt le script (avec wget par exemple), ajoute tes credentials dans le fichier et les droits d’exécution et tente un simple ./alexa_remote_control.sh —help, puis un -a
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 »

Super

En effet j'ai redémarré de 0 et ca fonctionne!
Merci pour votre aide et patience ;)
J'ai juste encore une erreur mais la commande fonctionne:
2021-11-17 (4).png
2021-11-17 (4).png (20.79 Kio) Consulté 4132 fois
Répondre