@ac-codeprod/n8n-nodes-alexa-remote 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.fr.md +300 -0
  3. package/README.md +300 -0
  4. package/dist/credentials/AlexaRemoteApi.credentials.d.ts +9 -0
  5. package/dist/credentials/AlexaRemoteApi.credentials.js +162 -0
  6. package/dist/credentials/AlexaRemoteApi.credentials.js.map +1 -0
  7. package/dist/credentials/alexa.svg +15 -0
  8. package/dist/nodes/AlexaRemote/AlexaRemote.node.d.ts +18 -0
  9. package/dist/nodes/AlexaRemote/AlexaRemote.node.js +330 -0
  10. package/dist/nodes/AlexaRemote/AlexaRemote.node.js.map +1 -0
  11. package/dist/nodes/AlexaRemote/AlexaRemote.node.json +18 -0
  12. package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.d.ts +5 -0
  13. package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.js +131 -0
  14. package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.js.map +1 -0
  15. package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.json +18 -0
  16. package/dist/nodes/AlexaRemote/alexa.svg +15 -0
  17. package/dist/nodes/AlexaRemote/lib/alexa-remote-ext.d.ts +57 -0
  18. package/dist/nodes/AlexaRemote/lib/alexa-remote-ext.js +667 -0
  19. package/dist/nodes/AlexaRemote/lib/alexa-remote-ext.js.map +1 -0
  20. package/dist/nodes/AlexaRemote/lib/cookie-crypto.d.ts +2 -0
  21. package/dist/nodes/AlexaRemote/lib/cookie-crypto.js +65 -0
  22. package/dist/nodes/AlexaRemote/lib/cookie-crypto.js.map +1 -0
  23. package/dist/nodes/AlexaRemote/lib/helpers.d.ts +14 -0
  24. package/dist/nodes/AlexaRemote/lib/helpers.js +174 -0
  25. package/dist/nodes/AlexaRemote/lib/helpers.js.map +1 -0
  26. package/dist/nodes/AlexaRemote/lib/types.d.ts +208 -0
  27. package/dist/nodes/AlexaRemote/lib/types.js +3 -0
  28. package/dist/nodes/AlexaRemote/lib/types.js.map +1 -0
  29. package/dist/nodes/AlexaRemote/properties/index.d.ts +14 -0
  30. package/dist/nodes/AlexaRemote/properties/index.js +90 -0
  31. package/dist/nodes/AlexaRemote/properties/index.js.map +1 -0
  32. package/dist/nodes/AlexaRemote/resources/account/index.d.ts +4 -0
  33. package/dist/nodes/AlexaRemote/resources/account/index.js +56 -0
  34. package/dist/nodes/AlexaRemote/resources/account/index.js.map +1 -0
  35. package/dist/nodes/AlexaRemote/resources/auth/index.d.ts +4 -0
  36. package/dist/nodes/AlexaRemote/resources/auth/index.js +108 -0
  37. package/dist/nodes/AlexaRemote/resources/auth/index.js.map +1 -0
  38. package/dist/nodes/AlexaRemote/resources/bluetooth/index.d.ts +4 -0
  39. package/dist/nodes/AlexaRemote/resources/bluetooth/index.js +108 -0
  40. package/dist/nodes/AlexaRemote/resources/bluetooth/index.js.map +1 -0
  41. package/dist/nodes/AlexaRemote/resources/conversation/index.d.ts +4 -0
  42. package/dist/nodes/AlexaRemote/resources/conversation/index.js +86 -0
  43. package/dist/nodes/AlexaRemote/resources/conversation/index.js.map +1 -0
  44. package/dist/nodes/AlexaRemote/resources/device/index.d.ts +4 -0
  45. package/dist/nodes/AlexaRemote/resources/device/index.js +164 -0
  46. package/dist/nodes/AlexaRemote/resources/device/index.js.map +1 -0
  47. package/dist/nodes/AlexaRemote/resources/interaction/index.d.ts +4 -0
  48. package/dist/nodes/AlexaRemote/resources/interaction/index.js +365 -0
  49. package/dist/nodes/AlexaRemote/resources/interaction/index.js.map +1 -0
  50. package/dist/nodes/AlexaRemote/resources/list/index.d.ts +4 -0
  51. package/dist/nodes/AlexaRemote/resources/list/index.js +142 -0
  52. package/dist/nodes/AlexaRemote/resources/list/index.js.map +1 -0
  53. package/dist/nodes/AlexaRemote/resources/notification/index.d.ts +4 -0
  54. package/dist/nodes/AlexaRemote/resources/notification/index.js +146 -0
  55. package/dist/nodes/AlexaRemote/resources/notification/index.js.map +1 -0
  56. package/dist/nodes/AlexaRemote/resources/routine/index.d.ts +4 -0
  57. package/dist/nodes/AlexaRemote/resources/routine/index.js +49 -0
  58. package/dist/nodes/AlexaRemote/resources/routine/index.js.map +1 -0
  59. package/dist/nodes/AlexaRemote/resources/smarthome/index.d.ts +4 -0
  60. package/dist/nodes/AlexaRemote/resources/smarthome/index.js +92 -0
  61. package/dist/nodes/AlexaRemote/resources/smarthome/index.js.map +1 -0
  62. package/dist/package.json +71 -0
  63. package/dist/tsconfig.tsbuildinfo +1 -0
  64. package/package.json +71 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alain Cajuste
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.fr.md ADDED
@@ -0,0 +1,300 @@
1
+ # @ac-codeprod/n8n-nodes-alexa-remote
2
+
3
+ [![n8n community node](https://img.shields.io/badge/n8n-community%20node-orange?logo=n8n)](https://docs.n8n.io/integrations/community-nodes/installation/)
4
+ [![npm version](https://img.shields.io/npm/v/@ac-codeprod/n8n-nodes-alexa-remote)](https://www.npmjs.com/package/@ac-codeprod/n8n-nodes-alexa-remote)
5
+ [![npm downloads](https://img.shields.io/npm/dm/@ac-codeprod/n8n-nodes-alexa-remote)](https://www.npmjs.com/package/@ac-codeprod/n8n-nodes-alexa-remote)
6
+ [![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
+
8
+ Ce package de nœuds communautaires n8n vous permet d'interagir avec l'API Amazon Alexa dans vos workflows n8n. Il fournit deux nœuds :
9
+
10
+ - **Alexa Remote** — nœud d'action pour contrôler des appareils, exécuter des routines, gérer des listes, des notifications, et bien plus.
11
+ - **Alexa Remote Trigger** — nœud déclencheur qui démarre un workflow lorsqu'un événement push WebSocket Alexa se produit.
12
+
13
+ Alexa Remote offre un accès programmatique pour contrôler les appareils Echo, exécuter des routines, gérer les appareils domotiques, et bien plus encore — sans avoir à dire « Alexa » !
14
+
15
+ [n8n](https://n8n.io/) est une plateforme d'automatisation de workflows sous [licence fair-code](https://docs.n8n.io/sustainable-use-license/).
16
+
17
+ ## Table des matières
18
+
19
+ - [Installation](#installation)
20
+ - [Nœuds](#nœuds)
21
+ - [Opérations](#opérations)
22
+ - [Événements déclencheurs](#événements-déclencheurs)
23
+ - [Identifiants](#identifiants)
24
+ - [Compatibilité](#compatibilité)
25
+ - [Utilisation](#utilisation)
26
+ - [Dépannage](#dépannage)
27
+ - [Ressources](#ressources)
28
+
29
+ ## Installation
30
+
31
+ Suivez le [guide d'installation](https://docs.n8n.io/integrations/community-nodes/installation/) dans la documentation des nœuds communautaires n8n.
32
+
33
+ ### Installation rapide
34
+
35
+ ```bash
36
+ npm install @ac-codeprod/n8n-nodes-alexa-remote
37
+ ```
38
+
39
+ ## Nœuds
40
+
41
+ ### Alexa Remote
42
+
43
+ Un nœud d'action pour interagir avec l'API Alexa. Prend en charge 10 ressources et peut également être utilisé comme outil IA.
44
+
45
+ ### Alexa Remote Trigger
46
+
47
+ Un nœud déclencheur qui écoute les événements push WebSocket Alexa en temps réel et démarre votre workflow lorsqu'ils se produisent.
48
+
49
+ ## Opérations
50
+
51
+ ### Account (Compte)
52
+ - **Get Accounts** — Obtenir les informations du compte
53
+ - **Get Contacts** — Récupérer vos contacts Alexa
54
+ - **Get Music Providers** — Lister les services de streaming musical disponibles
55
+ - **Get Routines** — Obtenir toutes les routines d'automatisation
56
+
57
+ ### Auth (Authentification)
58
+ - **Authenticate** — Démarrer le proxy et attendre la connexion Amazon. Ouvrez votre navigateur sur `http://[IP Proxy]:[Port Proxy]` lorsque le workflow est en cours d'exécution. Le paramètre **Login Timeout (Minutes)** contrôle le délai d'attente (défaut : 5 min).
59
+
60
+ ### Bluetooth ⚠️ Non testé
61
+
62
+ > **Avertissement** : Les opérations Bluetooth n'ont pas encore été testées. Elles sont disponibles dans le code mais leur fonctionnement n'est pas garanti.
63
+
64
+ - **Get State** — Obtenir les appareils Bluetooth appairés et l'état de connexion
65
+ - **Connect** — Se connecter à un appareil Bluetooth appairé (requiert l'adresse MAC)
66
+ - **Disconnect** — Déconnecter l'appareil Bluetooth actuel
67
+ - **Unpair** — Désappairer un appareil Bluetooth (requiert l'adresse MAC)
68
+
69
+ ### Conversation
70
+ - **Get Conversations** — Obtenir les conversations Alexa (filtre optionnel : non lues seulement)
71
+ - **Send Message** — Envoyer un message texte dans une conversation
72
+
73
+ ### Device (Appareil Echo)
74
+ - **Get Devices** — Lister tous vos appareils Echo
75
+ - **Get Device Info** — Obtenir les informations détaillées d'un appareil spécifique
76
+ - **Get Player Info** — Obtenir les informations du lecteur en cours (piste, état, volume…)
77
+ - **Get Player Queue** — Obtenir la file de lecture en cours
78
+ - **Send Command** — Envoyer une commande média à un appareil : `play`, `pause`, `next`, `previous`, `forward`, `rewind`, `repeat`, `shuffle`
79
+ - **Set Do Not Disturb** — Activer ou désactiver le mode Ne pas déranger
80
+
81
+ ### Interaction
82
+ - **Speak** — Faire parler Alexa (texte normal, SSML ou annonce)
83
+ - **Speak All (Multi-Device)** — Faire parler plusieurs appareils Echo en parallèle
84
+ - **Speak At Volume** — Faire parler Alexa à un volume spécifique
85
+ - **Text Command** — Envoyer une commande textuelle à Alexa (comme lui poser une question)
86
+ - **Stop** — Arrêter la lecture sur un appareil
87
+ - **Set Volume** — Modifier le volume d'un appareil (0–100)
88
+ - **Play Music** — Lire de la musique depuis un fournisseur (Amazon Music, Spotify, TuneIn, Cloud Player)
89
+ - **Builtin** — Lancer une action intégrée Alexa : Météo, Trafic, Flash Info, Bonjour, Fun Fact, Blague, Clean Up, Chanter une chanson, Raconter une histoire, Calendrier (Aujourd'hui / Demain / Prochain)
90
+ - **Sound** — Jouer un effet sonore par identifiant (ex. : `amzn1.ask.1p.sound/nature/crickets_01`)
91
+ - **Wait** — Attendre un nombre de secondes donné (utile dans les workflows séquentiels)
92
+
93
+ ### List (Liste)
94
+ - **Get Lists** — Obtenir toutes les listes Alexa (courses, tâches, personnalisées)
95
+ - **Add Item** — Ajouter un élément à une liste
96
+ - **Remove Item** — Supprimer un élément d'une liste
97
+ - **Create List** — Créer une nouvelle liste personnalisée
98
+ - **Delete List** — Supprimer une liste
99
+
100
+ ### Notification
101
+ - **Get Notifications** — Lister toutes les notifications (alarmes, rappels, minuteries)
102
+ - **Create Notification** — Créer une alarme, un rappel ou une minuterie
103
+ - **Delete Notification** — Supprimer une notification par ID
104
+
105
+ ### Routine
106
+ - **Execute Routine** — Exécuter une routine Alexa existante (sélectionnée dans une liste déroulante)
107
+
108
+ ### Smarthome (Domotique)
109
+ - **Get Devices** — Lister tous les appareils domotiques connectés
110
+ - **Control Device** — Contrôler un appareil domotique : Allumer, Éteindre, Définir la luminosité, Définir la couleur, Définir la température
111
+
112
+ ## Événements déclencheurs
113
+
114
+ Le nœud **Alexa Remote Trigger** écoute les événements push WebSocket suivants :
115
+
116
+ | Événement | Description |
117
+ |---|---|
118
+ | **All Messages** | Se déclenche sur chaque événement WebSocket reçu d'Alexa |
119
+ | **All Unknown Messages** | Se déclenche sur chaque message WebSocket non reconnu |
120
+ | **Audio Player State Change** | Se déclenche quand l'état de lecture change sur un appareil Echo |
121
+ | **Bluetooth State Change** | Se déclenche quand l'état d'une connexion Bluetooth change |
122
+ | **Device Activity** | Se déclenche quand un appareil Echo enregistre une activité (commande vocale, etc.) |
123
+ | **Device Connection Change** | Se déclenche quand un appareil Echo passe en ligne ou hors ligne |
124
+ | **Media Change** | Se déclenche quand le média en cours de lecture change |
125
+ | **Notification Change** | Se déclenche quand une notification Alexa (alarme, rappel) change |
126
+ | **Todo / List Change** | Se déclenche quand une liste de courses ou de tâches Alexa change |
127
+ | **Volume Change** | Se déclenche quand le volume d'un appareil Echo change |
128
+
129
+ Chaque déclencheur émet un payload JSON avec les champs `event`, `payload` et `timestamp`.
130
+
131
+ ## Identifiants
132
+
133
+ Pour utiliser ce nœud, vous devez configurer des identifiants **Alexa Remote API**.
134
+
135
+ ### Prérequis
136
+
137
+ 1. Un compte Amazon avec des appareils Alexa enregistrés
138
+ 2. Accès à l'adresse IP de votre serveur n8n (pour l'authentification par proxy)
139
+
140
+ ### Configuration
141
+
142
+ 1. Dans n8n, créez de nouveaux identifiants « Alexa Remote API »
143
+ 2. Configurez les paramètres suivants :
144
+ - **Proxy IP** : L'adresse IP de votre serveur n8n (ex. : `192.168.1.100`)
145
+ - **Proxy Port** : Port pour l'authentification (par défaut : `3456`)
146
+ - **Cookie File Path** : Chemin pour sauvegarder le cookie (par défaut : `$N8N_USER_FOLDER/.alexa-cookie.json`)
147
+ - **Amazon Service Host** : Sélectionnez votre région (ex. : `pitangui.amazon.com` pour les USA)
148
+ - **Amazon Page** : Sélectionnez votre domaine Amazon (ex. : `amazon.fr`)
149
+ - **Language** : Sélectionnez votre langue (ex. : `en-US`)
150
+ 3. Sauvegardez les identifiants et ajoutez un nœud **Alexa Remote** avec **Resource** : `Auth`, **Operation** : `Authenticate`
151
+ 4. Lancez le workflow — le proxy démarre et affiche une URL de connexion dans les logs
152
+ 5. Ouvrez l'URL dans votre navigateur et connectez-vous avec votre compte Amazon
153
+ 6. Une fois connecté, le cookie est sauvegardé et les identifiants sont prêts
154
+
155
+ Le cookie sera automatiquement renouvelé selon le paramètre **Refresh Interval**.
156
+
157
+ ### Tous les champs des identifiants
158
+
159
+ | Champ | Description | Défaut |
160
+ |---|---|---|
161
+ | **Proxy IP** | IP de votre serveur n8n | `localhost` |
162
+ | **Proxy Port** | Port du proxy | `3456` |
163
+ | **Cookie File Path** | Chemin pour sauvegarder/lire le fichier cookie JSON | `$N8N_USER_FOLDER/.alexa-cookie.json` |
164
+ | **Amazon Service Host** | Endpoint du service Alexa pour votre région | `pitangui.amazon.com` |
165
+ | **Amazon Page** | Domaine Amazon pour votre région | `amazon.com` |
166
+ | **Language** | Valeur du header Accept-Language | `en-US` |
167
+ | **Refresh Interval (Days)** | Intervalle de renouvellement automatique du cookie | `3` |
168
+
169
+ ### Régions supportées
170
+
171
+ | Région | Amazon Service Host | Amazon Page |
172
+ |---|---|---|
173
+ | USA | `pitangui.amazon.com` | `amazon.com` |
174
+ | UK | `alexa.amazon.co.uk` | `amazon.co.uk` |
175
+ | Allemagne | `layla.amazon.de` | `amazon.de` |
176
+ | France | `layla.amazon.de` | `amazon.fr` |
177
+ | Italie | `alexa.amazon.it` | `amazon.it` |
178
+ | Espagne | `alexa.amazon.es` | `amazon.es` |
179
+ | Australie | `alexa.amazon.com.au` | `amazon.com.au` |
180
+ | Brésil | `alexa.amazon.com.br` | `amazon.com.br` |
181
+
182
+ ## Compatibilité
183
+
184
+ - Version minimale de n8n : 1.0.0
185
+ - Testé avec n8n : 2.13.1
186
+ - Nécessite Node.js : ≥18.0.0
187
+
188
+ ## Utilisation
189
+
190
+ ### Exemple 1 : Première authentification
191
+
192
+ 1. Ajoutez un nœud **Alexa Remote**
193
+ 2. Sélectionnez **Resource** : `Auth`, **Operation** : `Authenticate`
194
+ 3. Définissez **Login Timeout** (minutes) — défaut : 5
195
+ 4. Lancez le workflow et ouvrez l'URL affichée dans les logs
196
+ 5. Connectez-vous avec votre compte Amazon
197
+ 6. Le cookie est sauvegardé — vous n'aurez pas besoin de recommencer sauf si la session expire
198
+
199
+ ### Exemple 2 : Faire parler Alexa
200
+
201
+ 1. Ajoutez un nœud **Alexa Remote**
202
+ 2. Sélectionnez **Resource** : `Interaction`, **Operation** : `Speak`
203
+ 3. Sélectionnez votre appareil dans la liste déroulante
204
+ 4. Entrez le texte : `Bonjour depuis n8n !`
205
+ 5. Exécutez le workflow
206
+
207
+ ### Exemple 3 : Faire parler plusieurs appareils simultanément
208
+
209
+ 1. Ajoutez un nœud **Alexa Remote**
210
+ 2. Sélectionnez **Resource** : `Interaction`, **Operation** : `Speak All (Multi-Device)`
211
+ 3. Sélectionnez plusieurs appareils dans la liste déroulante
212
+ 4. Entrez le texte et le type de parole
213
+ 5. Exécutez
214
+
215
+ ### Exemple 4 : Lire de la musique
216
+
217
+ 1. Ajoutez un nœud **Alexa Remote**
218
+ 2. Sélectionnez **Resource** : `Interaction`, **Operation** : `Play Music`
219
+ 3. Sélectionnez votre appareil
220
+ 4. Sélectionnez **Music Provider** : `Amazon Music`
221
+ 5. Entrez **Search Query** : `jazz relaxant`
222
+ 6. Exécutez
223
+
224
+ ### Exemple 5 : Contrôler un appareil domotique
225
+
226
+ 1. Ajoutez un nœud **Alexa Remote**
227
+ 2. Sélectionnez **Resource** : `Smarthome`, **Operation** : `Control Device`
228
+ 3. Sélectionnez l'entité dans la liste déroulante (ex. : `Lampe Salon`)
229
+ 4. Sélectionnez **Action** : `Set Brightness`
230
+ 5. Entrez **Value** : `75`
231
+ 6. Exécutez
232
+
233
+ ### Exemple 6 : Créer un rappel
234
+
235
+ 1. Ajoutez un nœud **Alexa Remote**
236
+ 2. Sélectionnez **Resource** : `Notification`, **Operation** : `Create Notification`
237
+ 3. Sélectionnez votre appareil
238
+ 4. Sélectionnez **Type** : `Reminder`
239
+ 5. Entrez **Label** : `Sortir les poubelles`
240
+ 6. Entrez **Time** : `2026-03-20T18:00:00.000` (format ISO 8601)
241
+ 7. Exécutez
242
+
243
+ ### Exemple 7 : Déclencher sur une activité vocale
244
+
245
+ 1. Ajoutez un nœud **Alexa Remote Trigger**
246
+ 2. Sélectionnez **Event** : `Device Activity`
247
+ 3. Activez le workflow
248
+ 4. Chaque fois qu'une commande vocale est enregistrée sur un appareil Echo, le workflow se lance
249
+
250
+ ### Exemple 8 : Exécuter une routine existante
251
+
252
+ 1. Ajoutez un nœud **Alexa Remote**
253
+ 2. Sélectionnez **Resource** : `Routine`, **Operation** : `Execute Routine`
254
+ 3. Sélectionnez votre routine dans la liste déroulante
255
+ 4. Exécutez
256
+
257
+ ## Dépannage
258
+
259
+ ### Problèmes d'authentification
260
+
261
+ - **Fichier cookie introuvable** : Exécutez d'abord l'opération `Auth → Authenticate` pour compléter la connexion Amazon
262
+ - **Le fichier cookie n'est pas un JSON valide** : Le fichier cookie est corrompu — relancez l'authentification
263
+ - **Erreur "no csrf"** : La session a expiré, relancez `Auth → Authenticate`
264
+ - **"401 Unauthorized"** : Cookie invalide ou expiré
265
+ - **Le proxy ne démarre pas** : Vérifiez que le port configuré n'est pas déjà utilisé
266
+
267
+ ### Appareil introuvable
268
+
269
+ - Les appareils sont chargés dynamiquement depuis votre compte — exécutez d'abord `Auth → Authenticate`
270
+ - Utilisez le numéro de série directement via une expression n8n si la liste déroulante est vide
271
+ - Obtenez les numéros de série via l'opération `Device → Get Devices`
272
+
273
+ ### Les commandes ne fonctionnent pas
274
+
275
+ - Vérifiez que l'appareil est en ligne et connecté
276
+ - Certaines commandes (ex. : `next`, `previous`) nécessitent que l'appareil soit en cours de lecture
277
+ - Vérifiez que votre compte Amazon a accès à l'appareil
278
+
279
+ ### Le déclencheur ne se lance pas
280
+
281
+ - Vérifiez que la connexion WebSocket est établie (consultez les logs n8n)
282
+ - L'événement `All Messages` peut être utilisé pour déboguer — il se déclenche sur chaque événement entrant
283
+
284
+ ## Ressources
285
+
286
+ - [Documentation des nœuds communautaires n8n](https://docs.n8n.io/integrations/#community-nodes)
287
+ - [Bibliothèque Alexa Remote 2](https://www.npmjs.com/package/alexa-remote2)
288
+ - [Implémentation Node-RED originale](https://github.com/bbindreiter/node-red-contrib-alexa-remote2-applestrudel)
289
+
290
+ ## Crédits
291
+
292
+ Ce projet est inspiré de l'excellent projet [node-red-contrib-alexa-remote2-applestrudel](https://github.com/bbindreiter/node-red-contrib-alexa-remote2-applestrudel) de bbindreiter, qui utilise la bibliothèque [alexa-remote2](https://www.npmjs.com/package/alexa-remote2).
293
+
294
+ ## Licence
295
+
296
+ [MIT](LICENSE)
297
+
298
+ ## Auteur
299
+
300
+ **Développé avec ❤️ par [AC-CodeProd](https://github.com/AC-CodeProd)**
package/README.md ADDED
@@ -0,0 +1,300 @@
1
+ # @ac-codeprod/n8n-nodes-alexa-remote
2
+
3
+ [![n8n community node](https://img.shields.io/badge/n8n-community%20node-orange?logo=n8n)](https://docs.n8n.io/integrations/community-nodes/installation/)
4
+ [![npm version](https://img.shields.io/npm/v/@ac-codeprod/n8n-nodes-alexa-remote)](https://www.npmjs.com/package/@ac-codeprod/n8n-nodes-alexa-remote)
5
+ [![npm downloads](https://img.shields.io/npm/dm/@ac-codeprod/n8n-nodes-alexa-remote)](https://www.npmjs.com/package/@ac-codeprod/n8n-nodes-alexa-remote)
6
+ [![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
+
8
+ This is an n8n community node package that lets you interact with the Amazon Alexa API in your n8n workflows. It provides two nodes:
9
+
10
+ - **Alexa Remote** — action node to control devices, execute routines, manage lists, notifications, and more.
11
+ - **Alexa Remote Trigger** — trigger node that starts a workflow when an Alexa WebSocket push event occurs.
12
+
13
+ Alexa Remote provides programmatic access to control Echo devices, execute routines, manage smart home devices, and more — all without saying "Alexa"!
14
+
15
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
16
+
17
+ ## Table of Contents
18
+
19
+ - [Installation](#installation)
20
+ - [Nodes](#nodes)
21
+ - [Operations](#operations)
22
+ - [Trigger Events](#trigger-events)
23
+ - [Credentials](#credentials)
24
+ - [Compatibility](#compatibility)
25
+ - [Usage](#usage)
26
+ - [Troubleshooting](#troubleshooting)
27
+ - [Resources](#resources)
28
+
29
+ ## Installation
30
+
31
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
32
+
33
+ ### Quick Installation
34
+
35
+ ```bash
36
+ npm install @ac-codeprod/n8n-nodes-alexa-remote
37
+ ```
38
+
39
+ ## Nodes
40
+
41
+ ### Alexa Remote
42
+
43
+ An action node to interact with the Alexa API. Supports 10 resources and can also be used as an AI tool.
44
+
45
+ ### Alexa Remote Trigger
46
+
47
+ A trigger node that listens for real-time Alexa WebSocket push events and starts your workflow when they occur.
48
+
49
+ ## Operations
50
+
51
+ ### Account
52
+ - **Get Accounts** — Get account information
53
+ - **Get Contacts** — Get your Alexa contacts
54
+ - **Get Music Providers** — List available music streaming services
55
+ - **Get Routines** — Get all automation routines
56
+
57
+ ### Auth
58
+ - **Authenticate** — Start the proxy and wait for Amazon login. Open your browser at `http://[Proxy IP]:[Proxy Port]` when the workflow is running. A **Login Timeout (Minutes)** parameter controls how long to wait (default: 5 min).
59
+
60
+ ### Bluetooth ⚠️ Untested
61
+
62
+ > **Warning**: Bluetooth operations have not been tested yet. They are available in the code but their behavior is not guaranteed.
63
+
64
+ - **Get State** — Get paired Bluetooth devices and connection state
65
+ - **Connect** — Connect to a paired Bluetooth device (requires MAC address)
66
+ - **Disconnect** — Disconnect the current Bluetooth device
67
+ - **Unpair** — Unpair a Bluetooth device (requires MAC address)
68
+
69
+ ### Conversation
70
+ - **Get Conversations** — Get Alexa conversations (optionally filter unread only)
71
+ - **Send Message** — Send a text message to a conversation
72
+
73
+ ### Device (Echo)
74
+ - **Get Devices** — List all your Echo devices
75
+ - **Get Device Info** — Get detailed information about a specific device
76
+ - **Get Player Info** — Get current player info (track, state, volume…)
77
+ - **Get Player Queue** — Get the current playback queue
78
+ - **Send Command** — Send a media command to a device: `play`, `pause`, `next`, `previous`, `forward`, `rewind`, `repeat`, `shuffle`
79
+ - **Set Do Not Disturb** — Enable or disable Do Not Disturb mode
80
+
81
+ ### Interaction
82
+ - **Speak** — Make Alexa speak text (regular, SSML, or announcement)
83
+ - **Speak All (Multi-Device)** — Make multiple Echo devices speak in parallel
84
+ - **Speak At Volume** — Make Alexa speak at a specific volume level
85
+ - **Text Command** — Send a text command to Alexa (like asking her something)
86
+ - **Stop** — Stop playback on a device
87
+ - **Set Volume** — Change device volume (0–100)
88
+ - **Play Music** — Play music from a provider (Amazon Music, Spotify, TuneIn, Cloud Player)
89
+ - **Builtin** — Play a built-in Alexa action: Weather, Traffic, Flash Briefing, Good Morning, Fun Fact, Joke, Clean Up, Sing a Song, Tell Story, Calendar (Today / Tomorrow / Next)
90
+ - **Sound** — Play a sound effect by sound string ID (e.g., `amzn1.ask.1p.sound/nature/crickets_01`)
91
+ - **Wait** — Wait a given number of seconds (useful in sequence workflows)
92
+
93
+ ### List
94
+ - **Get Lists** — Get all Alexa lists (shopping, to-do, and custom)
95
+ - **Add Item** — Add an item to a list
96
+ - **Remove Item** — Remove an item from a list
97
+ - **Create List** — Create a new custom list
98
+ - **Delete List** — Delete a list
99
+
100
+ ### Notification
101
+ - **Get Notifications** — List all notifications (alarms, reminders, timers)
102
+ - **Create Notification** — Create an alarm, reminder, or timer
103
+ - **Delete Notification** — Remove a notification by ID
104
+
105
+ ### Routine
106
+ - **Execute Routine** — Run an existing Alexa automation routine (selected from a dropdown)
107
+
108
+ ### Smarthome
109
+ - **Get Devices** — List all connected smart home devices
110
+ - **Control Device** — Control a smart home device: Turn On, Turn Off, Set Brightness, Set Color, Set Temperature
111
+
112
+ ## Trigger Events
113
+
114
+ The **Alexa Remote Trigger** node listens for the following WebSocket push events:
115
+
116
+ | Event | Description |
117
+ |---|---|
118
+ | **All Messages** | Fires on every WebSocket event received from Alexa |
119
+ | **All Unknown Messages** | Fires on every unrecognized WebSocket message |
120
+ | **Audio Player State Change** | Fires when media playback state changes on an Echo device |
121
+ | **Bluetooth State Change** | Fires when a Bluetooth connection state changes |
122
+ | **Device Activity** | Fires when an Echo device registers an activity (voice command, etc.) |
123
+ | **Device Connection Change** | Fires when an Echo device goes online or offline |
124
+ | **Media Change** | Fires when the currently playing media changes |
125
+ | **Notification Change** | Fires when an Alexa notification (alarm, reminder) changes |
126
+ | **Todo / List Change** | Fires when an Alexa shopping or to-do list changes |
127
+ | **Volume Change** | Fires when the volume of an Echo device changes |
128
+
129
+ Each trigger emits a JSON payload with `event`, `payload`, and `timestamp` fields.
130
+
131
+ ## Credentials
132
+
133
+ To use this node, you need to configure **Alexa Remote API** credentials.
134
+
135
+ ### Prerequisites
136
+
137
+ 1. An Amazon account with Alexa devices registered
138
+ 2. Access to your n8n server's IP address (for proxy authentication)
139
+
140
+ ### Setup
141
+
142
+ 1. In n8n, create new "Alexa Remote API" credentials
143
+ 2. Configure the following:
144
+ - **Proxy IP**: Your n8n server's IP address (e.g., `192.168.1.100`)
145
+ - **Proxy Port**: Port for authentication (default: `3456`)
146
+ - **Cookie File Path**: Path to save authentication cookie (defaults to `$N8N_USER_FOLDER/.alexa-cookie.json`)
147
+ - **Amazon Service Host**: Select your region (e.g., `pitangui.amazon.com` for USA)
148
+ - **Amazon Page**: Select your Amazon domain (e.g., `amazon.com`)
149
+ - **Language**: Select your language (e.g., `en-US`)
150
+ 3. Save credentials and add an **Alexa Remote** node with **Resource**: `Auth`, **Operation**: `Authenticate`
151
+ 4. Run the workflow — the proxy will start and display a login URL in the logs
152
+ 5. Open the URL in your browser and log in with your Amazon account
153
+ 6. Once login is complete, the cookie is saved and credentials are ready
154
+
155
+ The cookie will be automatically refreshed according to the **Refresh Interval** setting.
156
+
157
+ ### All Credential Fields
158
+
159
+ | Field | Description | Default |
160
+ |---|---|---|
161
+ | **Proxy IP** | IP of your n8n server | `localhost` |
162
+ | **Proxy Port** | Proxy port | `3456` |
163
+ | **Cookie File Path** | Path to save/read the cookie JSON file | `$N8N_USER_FOLDER/.alexa-cookie.json` |
164
+ | **Amazon Service Host** | Alexa service endpoint for your region | `pitangui.amazon.com` |
165
+ | **Amazon Page** | Amazon domain for your region | `amazon.com` |
166
+ | **Language** | Accept-Language header value | `en-US` |
167
+ | **Refresh Interval (Days)** | Auto-refresh cookie interval | `3` |
168
+
169
+ ### Supported Regions
170
+
171
+ | Region | Amazon Service Host | Amazon Page |
172
+ |---|---|---|
173
+ | USA | `pitangui.amazon.com` | `amazon.com` |
174
+ | UK | `alexa.amazon.co.uk` | `amazon.co.uk` |
175
+ | Germany | `layla.amazon.de` | `amazon.de` |
176
+ | France | `layla.amazon.de` | `amazon.fr` |
177
+ | Italy | `alexa.amazon.it` | `amazon.it` |
178
+ | Spain | `alexa.amazon.es` | `amazon.es` |
179
+ | Australia | `alexa.amazon.com.au` | `amazon.com.au` |
180
+ | Brazil | `alexa.amazon.com.br` | `amazon.com.br` |
181
+
182
+ ## Compatibility
183
+
184
+ - Minimum n8n version: 1.0.0
185
+ - Tested with n8n: 2.13.1
186
+ - Requires Node.js: ≥18.0.0
187
+
188
+ ## Usage
189
+
190
+ ### Example 1: First-time Authentication
191
+
192
+ 1. Add an **Alexa Remote** node
193
+ 2. Select **Resource**: `Auth`, **Operation**: `Authenticate`
194
+ 3. Set **Login Timeout** (minutes) — default is 5
195
+ 4. Run the workflow and open the URL shown in the logs
196
+ 5. Log in with your Amazon account
197
+ 6. The cookie is saved — you won't need to redo this unless the session expires
198
+
199
+ ### Example 2: Make Alexa Speak
200
+
201
+ 1. Add an **Alexa Remote** node
202
+ 2. Select **Resource**: `Interaction`, **Operation**: `Speak`
203
+ 3. Select your device from the dropdown
204
+ 4. Enter text: `Hello from n8n!`
205
+ 5. Execute the workflow
206
+
207
+ ### Example 3: Speak on Multiple Devices Simultaneously
208
+
209
+ 1. Add an **Alexa Remote** node
210
+ 2. Select **Resource**: `Interaction`, **Operation**: `Speak All (Multi-Device)`
211
+ 3. Select multiple devices from the dropdown
212
+ 4. Enter text and speak type
213
+ 5. Execute
214
+
215
+ ### Example 4: Play Music
216
+
217
+ 1. Add an **Alexa Remote** node
218
+ 2. Select **Resource**: `Interaction`, **Operation**: `Play Music`
219
+ 3. Select your device
220
+ 4. Select **Music Provider**: `Amazon Music`
221
+ 5. Enter **Search Query**: `relaxing jazz`
222
+ 6. Execute
223
+
224
+ ### Example 5: Control a Smart Home Device
225
+
226
+ 1. Add an **Alexa Remote** node
227
+ 2. Select **Resource**: `Smarthome`, **Operation**: `Control Device`
228
+ 3. Select the entity from the dropdown (e.g., `Living Room Lights`)
229
+ 4. Select **Action**: `Set Brightness`
230
+ 5. Enter **Value**: `75`
231
+ 6. Execute
232
+
233
+ ### Example 6: Create a Reminder
234
+
235
+ 1. Add an **Alexa Remote** node
236
+ 2. Select **Resource**: `Notification`, **Operation**: `Create Notification`
237
+ 3. Select your device
238
+ 4. Select **Type**: `Reminder`
239
+ 5. Enter **Label**: `Take out trash`
240
+ 6. Enter **Time**: `2026-03-20T18:00:00.000` (ISO 8601 format)
241
+ 7. Execute
242
+
243
+ ### Example 7: Trigger on Device Activity
244
+
245
+ 1. Add an **Alexa Remote Trigger** node
246
+ 2. Select **Event**: `Device Activity`
247
+ 3. Activate the workflow
248
+ 4. Every time a voice command is registered on any Echo device, the workflow runs
249
+
250
+ ### Example 8: Execute an Existing Routine
251
+
252
+ 1. Add an **Alexa Remote** node
253
+ 2. Select **Resource**: `Routine`, **Operation**: `Execute Routine`
254
+ 3. Select your routine from the dropdown
255
+ 4. Execute
256
+
257
+ ## Troubleshooting
258
+
259
+ ### Authentication Issues
260
+
261
+ - **Cookie file not found**: Run the `Auth → Authenticate` operation first to complete Amazon login
262
+ - **Cookie file is not valid JSON**: The cookie file was corrupted — re-run authentication
263
+ - **"no csrf" error**: Session expired, re-run `Auth → Authenticate`
264
+ - **"401 Unauthorized"**: Invalid or expired cookie
265
+ - **Proxy doesn't start**: Check that the configured port is not already in use
266
+
267
+ ### Device Not Found
268
+
269
+ - Devices are loaded dynamically from your account — run `Auth → Authenticate` first
270
+ - Use the serial number directly via an n8n expression if the dropdown is empty
271
+ - Get serial numbers using the `Device → Get Devices` operation
272
+
273
+ ### Commands Don't Work
274
+
275
+ - Ensure the device is online and connected
276
+ - Some commands (e.g., `next`, `previous`) require the device to be actively playing media
277
+ - Check that your Amazon account has access to the device
278
+
279
+ ### Trigger Not Firing
280
+
281
+ - Verify the WebSocket connection is established (check n8n logs)
282
+ - The `All Messages` event can be used to debug — it fires on every incoming event
283
+
284
+ ## Resources
285
+
286
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
287
+ - [Alexa Remote 2 Library](https://www.npmjs.com/package/alexa-remote2)
288
+ - [Original Node-RED Implementation](https://github.com/bbindreiter/node-red-contrib-alexa-remote2-applestrudel)
289
+
290
+ ## Credits
291
+
292
+ This project is inspired by the excellent [node-red-contrib-alexa-remote2-applestrudel](https://github.com/bbindreiter/node-red-contrib-alexa-remote2-applestrudel) project by bbindreiter, which uses the [alexa-remote2](https://www.npmjs.com/package/alexa-remote2) library.
293
+
294
+ ## License
295
+
296
+ [MIT](LICENSE)
297
+
298
+ ## Author
299
+
300
+ **Developed with ❤️ by [AC-CodeProd](https://github.com/AC-CodeProd)**
@@ -0,0 +1,9 @@
1
+ import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class AlexaRemoteApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ testedBy: string;
6
+ icon: "file:alexa.svg";
7
+ documentationUrl: string;
8
+ properties: INodeProperties[];
9
+ }