Automatiser sa maison et sa veille avec n8n : 6 workflows prêts à l'emploi

Automatiser sa maison et sa veille avec n8n : 6 workflows prêts à l'emploi
Photo by Rebecca R / Unsplash

Ce guide regroupe 6 automatisations n8n légères, gratuites et auto-hébergées pour centraliser ses alertes météo, environnementales, domotiques (TP-Link Tapo sur réseau IoT isolé) et musicales (Tidal / Last.fm) vers Discord — avec une passerelle finale pour basculer l'ensemble vers Rocket.Chat sans modifier les workflows.

Tous les fichiers JSON ci-dessous peuvent être copiés et collés directement sur le canevas de n8n (Ctrl + V).

1. Prérequis communs

  • Une instance n8n fonctionnelle (Docker ou installation native).
  • Un Webhook Discord : dans les paramètres de votre salon Discord → Intégrations → Webhooks → Nouveau webhook → Copier l'URL.
  • Dans chaque workflow importé, remplacez [https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN](https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN) dans le dernier nœud HTTP Request par votre URL de webhook, puis passez le workflow en Published.

2. Workflow 1 : Alerte Vigilance Météo-France (zéro bruit)

Interroge toutes les 3 heures le flux officiel MeteoAlarm France (alimenté par Météo-France). Si le département ciblé est en Vert, le workflow s'arrête silencieusement. Dès qu'une vigilance Jaune, Orange ou Rouge est activée, une alerte colorée est envoyée sur Discord.

Personnalisation

Dans le nœud Filtrer Département, modifiez les trois variables en haut du script (DEPT_REGEX, DEPT_LABEL, DEPT_URL) selon votre département (ex. Ille-et-Vilaine (35) par défaut ci-dessous).

JSON à importer dans n8n

{
  "name": "Vigilance Météo-France -> Discord",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 */3 * * *"
            }
          ]
        }
      },
      "id": "vig11111-1111-4111-8111-111111111101",
      "name": "Toutes les 3h",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-atom-france",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "User-Agent",
              "value": "n8n-Homelab-Vigilance/1.0"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          },
          "timeout": 10000
        }
      },
      "id": "vig11111-1111-4111-8111-111111111102",
      "name": "Flux Vigilance France",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// --- PERSONNALISATION DU DÉPARTEMENT ---\nconst DEPT_REGEX = /ille[-\\s]et[-\\s]vilaine/i;\nconst DEPT_LABEL = \"Ille-et-Vilaine (35)\";\nconst DEPT_URL = \"https://vigilance.meteofrance.fr/fr/ille-et-vilaine\";\n\nconst xml = typeof $input.first().json.data === 'string' ? $input.first().json.data : '';\nif (!xml) return [];\n\nconst entries = xml.match(/<entry>[\\s\\S]*?<\\/entry>/gi) || [];\nconst getTag = (block, tag) => {\n  const m = block.match(new RegExp(`<${tag}[^>]*>([\\\\s\\\\S]*?)<\\/${tag}>`, 'i'));\n  return m ? m[1].replace(/<!\\[CDATA\\[|\\]\\]>/g, '').replace(/<[^>]+>/g, '').trim() : '';\n};\n\nconst levelMap = {\n  'Moderate': { label: 'Jaune', icon: '🟡', rank: 2, color: 16766720 },\n  'Severe':   { label: 'Orange', icon: '🟠', rank: 3, color: 15105570 },\n  'Extreme':  { label: 'Rouge', icon: '🔴', rank: 4, color: 15158332 }\n};\n\nconst alerts = [];\nlet maxRank = 0;\nlet embedColor = 16766720;\n\nfor (const entry of entries) {\n  const area = getTag(entry, 'cap:areaDesc');\n  if (!DEPT_REGEX.test(area)) continue;\n\n  const severity = getTag(entry, 'cap:severity');\n  const lvl = levelMap[severity];\n  if (!lvl) continue;\n\n  const event = getTag(entry, 'cap:event') || getTag(entry, 'title');\n  const onset = getTag(entry, 'cap:onset');\n  const expires = getTag(entry, 'cap:expires');\n\n  const fmt = (iso) => iso ? new Date(iso).toLocaleString('fr-FR', {\n    day: '2-digit', month: '2-digit', hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Paris'\n  }).replace(':', 'h') : '?';\n\n  if (lvl.rank > maxRank) {\n    maxRank = lvl.rank;\n    embedColor = lvl.color;\n  }\n\n  alerts.push(`${lvl.icon} **${lvl.label} — ${event}**\\n└ Du ${fmt(onset)} au ${fmt(expires)}`);\n}\n\nif (alerts.length === 0) {\n  return [];\n}\n\nconst uniqueAlerts = [...new Set(alerts)];\nconst maxLabel = maxRank === 4 ? 'ROUGE' : (maxRank === 3 ? 'ORANGE' : 'JAUNE');\n\nreturn [\n  {\n    json: {\n      payload: {\n        username: \"Vigilance Météo-France\",\n        embeds: [\n          {\n            title: `⚠️ Vigilance ${maxLabel} — ${DEPT_LABEL}`,\n            description: uniqueAlerts.join('\\n\\n'),\n            url: DEPT_URL,\n            color: embedColor,\n            footer: {\n              text: \"Source officielle Météo-France (via MeteoAlarm)\"\n            },\n            timestamp: new Date().toISOString()\n          }\n        ]\n      }\n    }\n  }\n];"
      },
      "id": "vig11111-1111-4111-8111-111111111103",
      "name": "Filtrer Département",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}",
        "options": {}
      },
      "id": "vig11111-1111-4111-8111-111111111104",
      "name": "Envoyer Alerte Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        880,
        300
      ]
    }
  ],
  "connections": {
    "Toutes les 3h": {
      "main": [
        [
          {
            "node": "Flux Vigilance France",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flux Vigilance France": {
      "main": [
        [
          {
            "node": "Filtrer Département",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filtrer Département": {
      "main": [
        [
          {
            "node": "Envoyer Alerte Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}

3. Workflow 2 : Alerte « Ciel Clair & Aurores Boréales » (Astrophoto)

Chaque soir à 18h00, n8n croise la nébulosité nocturne (21h → 04h) via Open-Meteo (modèle Météo-France) et l'indice géomagnétique Kp via l'API publique de la NOAA. Une alerte est envoyée uniquement si le ciel est dégagé (< 20 % de nuages en moyenne) ou si l'activité solaire dépasse Kp 5.

Personnalisation

Remplacez latitude=48.8566 et longitude=2.3522 dans l'URL du nœud Météo Nuit (Open-Meteo) (ainsi que le nom de ville dans le nœud Évaluer Ciel & Aurores) par vos coordonnées GPS.

JSON à importer dans n8n

{
  "name": "Alerte Ciel Clair & Aurores 18h00 -> Discord",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 18 * * *"
            }
          ]
        }
      },
      "id": "ast11111-1111-4111-8111-111111111101",
      "name": "Tous les jours à 18h00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://api.open-meteo.com/v1/meteofrance?latitude=48.8566&longitude=2.3522&hourly=cloud_cover,temperature_2m,relative_humidity_2m&forecast_days=2&timezone=Europe%2FParis",
        "options": {
          "timeout": 10000
        }
      },
      "id": "ast11111-1111-4111-8111-111111111102",
      "name": "Météo Nuit (Open-Meteo)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        300
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "url": "https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          },
          "timeout": 10000
        }
      },
      "id": "ast11111-1111-4111-8111-111111111103",
      "name": "Indice Kp (NOAA SWPC)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        640,
        300
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "jsCode": "const CITY_NAME = \"Ma Ville\";\nconst meteo = $('Météo Nuit (Open-Meteo)').first().json || {};\nconst noaaRaw = $('Indice Kp (NOAA SWPC)').first().json || {};\n\n// 1. Analyse de la nuit (21h -> 04h)\nlet avgClouds = 100;\nlet minClouds = 100;\nlet minTemp = null;\nlet maxHum = null;\nlet nightSlots = [];\n\nif (meteo.hourly && Array.isArray(meteo.hourly.time) && meteo.hourly.time.length >= 29) {\n  const clouds = [];\n  const temps = [];\n  const hums = [];\n\n  for (let i = 21; i <= 28; i++) {\n    const t = meteo.hourly.time[i].slice(11, 13) + 'h';\n    const c = meteo.hourly.cloud_cover[i];\n    const temp = meteo.hourly.temperature_2m[i];\n    const hum = meteo.hourly.relative_humidity_2m[i];\n\n    if (typeof c === 'number') {\n      clouds.push(c);\n      nightSlots.push(`${t}: ${c}%`);\n    }\n    if (typeof temp === 'number') temps.push(temp);\n    if (typeof hum === 'number') hums.push(hum);\n  }\n\n  if (clouds.length > 0) {\n    avgClouds = Math.round(clouds.reduce((a, b) => a + b, 0) / clouds.length);\n    minClouds = Math.min(...clouds);\n  }\n  if (temps.length > 0) minTemp = Math.min(...temps);\n  if (hums.length > 0) maxHum = Math.max(...hums);\n}\n\n// 2. Analyse Indice Kp (NOAA, prochaines 12h)\nlet maxKp = 0;\nlet noaaScale = '';\n\ntry {\n  const text = typeof noaaRaw.data === 'string' ? noaaRaw.data : '';\n  const rows = text ? JSON.parse(text) : [];\n  const nowMs = Date.now();\n  const limitMs = nowMs + 12 * 3600 * 1000;\n\n  for (let i = 1; i < rows.length; i++) {\n    const [timeTag, kpStr, , scale] = rows[i];\n    const ts = Date.parse(timeTag.replace(' ', 'T') + 'Z');\n    const kp = parseFloat(kpStr);\n    if (!isNaN(ts) && ts >= nowMs - 3 * 3600 * 1000 && ts <= limitMs && !isNaN(kp)) {\n      if (kp > maxKp) {\n        maxKp = kp;\n        noaaScale = scale || '';\n      }\n    }\n  }\n} catch (e) {}\n\nconst isClearSky = avgClouds < 20;\nconst isAurora = maxKp >= 5;\n\nif (!isClearSky && !isAurora) {\n  return [];\n}\n\nlet title = '✨ Ciel clair prévu cette nuit !';\nlet color = 3447003;\nif (isAurora && isClearSky) {\n  title = '🌌 ALERTE AURORES + CIEL CLAIR cette nuit !';\n  color = 10181046;\n} else if (isAurora) {\n  title = '🟢 Activité Géomagnétique Forte (Aurores possibles)';\n  color = 3066993;\n}\n\nconst kpText = `**Kp ${maxKp.toFixed(1)}**${noaaScale ? ` (${noaaScale})` : ''}` +\n  (isAurora ? ' — 🔥 Tempête géomagnétique !' : ' (Calme)');\n\nconst meteoText = `☁️ Nuages (21h–04h) : **${avgClouds}%** en moyenne (min ${minClouds}%)\\n` +\n  `🌡️ Temp. min : **${minTemp !== null ? minTemp + ' °C' : '?'}** • 💧 Humidité max : **${maxHum !== null ? maxHum + '%' : '?'}**`;\n\nreturn [\n  {\n    json: {\n      payload: {\n        username: \"Astro & Aurores\",\n        embeds: [\n          {\n            title,\n            description: `Conditions favorables repérées pour l'observation nocturne (**${CITY_NAME}**).`,\n            color,\n            fields: [\n              {\n                name: \"🔭 Couverture nuageuse & Conditions\",\n                value: meteoText,\n                inline: false\n              },\n              {\n                name: \"🧲 Indice Géomagnétique (NOAA 12h)\",\n                value: kpText,\n                inline: false\n              },\n              {\n                name: \"⏱️ Nuages heure par heure\",\n                value: nightSlots.length > 0 ? nightSlots.join(' • ') : 'Indisponible',\n                inline: false\n              }\n            ],\n            footer: {\n              text: \"Open-Meteo (Météo-France) • NOAA SWPC\"\n            },\n            timestamp: new Date().toISOString()\n          }\n        ]\n      }\n    }\n  }\n];"
      },
      "id": "ast11111-1111-4111-8111-111111111104",
      "name": "Évaluer Ciel & Aurores",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        880,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}",
        "options": {}
      },
      "id": "ast11111-1111-4111-8111-111111111105",
      "name": "Envoyer Alerte Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        300
      ]
    }
  ],
  "connections": {
    "Tous les jours à 18h00": {
      "main": [
        [
          {
            "node": "Météo Nuit (Open-Meteo)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Météo Nuit (Open-Meteo)": {
      "main": [
        [
          {
            "node": "Indice Kp (NOAA SWPC)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Indice Kp (NOAA SWPC)": {
      "main": [
        [
          {
            "node": "Évaluer Ciel & Aurores",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Évaluer Ciel & Aurores": {
      "main": [
        [
          {
            "node": "Envoyer Alerte Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}

4. Workflow 3 : Alerte Qualité de l'Air & Pollens

Tous les matins à 07h45, vérifie l'indice européen de qualité de l'air (EAQI), les particules fines (PM2.5 / PM10) et les concentrations de 6 pollens (graminées, bouleau, aulne, armoise, olivier, ambroisie) sur la plage 07h → 21h. Silencieux tant que EAQI < 40 et que les pollens restent sous 20 grains/m³.

Personnalisation

Modifiez latitude et longitude dans l'URL du nœud Open-Meteo Air Quality & Pollens ainsi que CITY_NAME dans le nœud Évaluer Air & Pollens.

JSON à importer dans n8n

{
  "name": "Alerte Qualité de l'Air & Pollens 07h45 -> Discord",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "45 7 * * *"
            }
          ]
        }
      },
      "id": "air11111-1111-4111-8111-111111111101",
      "name": "Tous les jours à 07h45",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://air-quality-api.open-meteo.com/v1/air-quality?latitude=48.8566&longitude=2.3522&hourly=european_aqi,pm10,pm2_5,alder_pollen,birch_pollen,grass_pollen,mugwort_pollen,olive_pollen,ragweed_pollen&forecast_days=1&timezone=Europe%2FParis",
        "options": {
          "timeout": 10000
        }
      },
      "id": "air11111-1111-4111-8111-111111111102",
      "name": "Open-Meteo Air Quality & Pollens",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const CITY_NAME = \"Ma Ville\";\nconst data = $input.first().json || {};\nconst h = data.hourly;\nif (!h || !Array.isArray(h.time)) return [];\n\nconst maxInRange = (arr) => {\n  if (!Array.isArray(arr)) return 0;\n  const vals = arr.slice(7, 22).filter(v => typeof v === 'number' && !isNaN(v));\n  return vals.length > 0 ? Math.max(...vals) : 0;\n};\n\nconst maxAqi = Math.round(maxInRange(h.european_aqi));\nconst maxPm25 = Math.round(maxInRange(h.pm2_5));\nconst maxPm10 = Math.round(maxInRange(h.pm10));\n\nconst pollens = [\n  { name: 'Graminées', val: maxInRange(h.grass_pollen) },\n  { name: 'Bouleau',   val: maxInRange(h.birch_pollen) },\n  { name: 'Aulne',     val: maxInRange(h.alder_pollen) },\n  { name: 'Armoise',   val: maxInRange(h.mugwort_pollen) },\n  { name: 'Olivier',   val: maxInRange(h.olive_pollen) },\n  { name: 'Ambroisie', val: maxInRange(h.ragweed_pollen) }\n];\n\nconst activePollens = pollens\n  .filter(p => p.val >= 20)\n  .sort((a, b) => b.val - a.val);\n\nconst isAirAlert = maxAqi >= 40;\nconst isPollenAlert = activePollens.length > 0;\n\nif (!isAirAlert && !isPollenAlert) {\n  return [];\n}\n\nlet aqiLabel = 'Bon';\nlet aqiIcon = '🟢';\nif (maxAqi >= 100)      { aqiLabel = 'Extrêmement mauvais'; aqiIcon = '🟣'; }\nelse if (maxAqi >= 80)  { aqiLabel = 'Très mauvais';        aqiIcon = '🔴'; }\nelse if (maxAqi >= 60)  { aqiLabel = 'Mauvais';             aqiIcon = '🟠'; }\nelse if (maxAqi >= 40)  { aqiLabel = 'Modéré / Dégradé';    aqiIcon = '🟡'; }\nelse if (maxAqi >= 20)  { aqiLabel = 'Correct';             aqiIcon = '🟢'; }\n\nconst maxPollenVal = activePollens.length > 0 ? activePollens[0].val : 0;\nlet color = 16766720;\nif (maxAqi >= 80 || maxPollenVal >= 100) color = 15158332;\nelse if (maxAqi >= 60 || maxPollenVal >= 50) color = 15105570;\n\nconst airText = `${aqiIcon} Indice EAQI max : **${maxAqi}** (${aqiLabel})\\n` +\n  `🌫️ Particules fines : **PM2.5** ${maxPm25} µg/m³ • **PM10** ${maxPm10} µg/m³`;\n\nconst pollenText = isPollenAlert\n  ? activePollens.map(p => {\n      const lvl = p.val >= 100 ? '🔴 Très élevé' : (p.val >= 50 ? '🟠 Élevé' : '🟡 Modéré');\n      return `• **${p.name}** : ${Math.round(p.val)} grains/m³ (${lvl})`;\n    }).join('\\n')\n  : '🟢 Aucun pic pollinique détecté aujourd\\'hui.';\n\nlet title = `🌿 Alerte Air & Pollens — ${CITY_NAME}`;\nif (isAirAlert && !isPollenAlert) title = `🌫️ Qualité de l'air dégradée — ${CITY_NAME}`;\nelse if (!isAirAlert && isPollenAlert) title = `🌼 Pic de Pollens détecté — ${CITY_NAME}`;\n\nreturn [\n  {\n    json: {\n      payload: {\n        username: \"Air & Pollens\",\n        embeds: [\n          {\n            title,\n            color,\n            fields: [\n              {\n                name: \"💨 Qualité de l'air (Pic 07h–21h)\",\n                value: airText,\n                inline: false\n              },\n              {\n                name: \"🌼 Pollens actifs\",\n                value: pollenText,\n                inline: false\n              }\n            ],\n            footer: {\n              text: \"Open-Meteo Air Quality (CAMS Europe)\"\n            },\n            timestamp: new Date().toISOString()\n          }\n        ]\n      }\n    }\n  }\n];"
      },
      "id": "air11111-1111-4111-8111-111111111103",
      "name": "Évaluer Air & Pollens",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}",
        "options": {}
      },
      "id": "air11111-1111-4111-8111-111111111104",
      "name": "Envoyer Alerte Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        880,
        300
      ]
    }
  ],
  "connections": {
    "Tous les jours à 07h45": {
      "main": [
        [
          {
            "node": "Open-Meteo Air Quality & Pollens",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Open-Meteo Air Quality & Pollens": {
      "main": [
        [
          {
            "node": "Évaluer Air & Pollens",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Évaluer Air & Pollens": {
      "main": [
        [
          {
            "node": "Envoyer Alerte Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}

5. Domotique Tapo sur VLAN IoT isolé : déployer le pont tapo-bridge

Les prises connectées (P110 / P110M) et hubs (H100 avec sondes T310 / T315) utilisent le protocole local chiffré KLAP en TCP Unicast sur le port 80. Pour éviter d'exposer le réseau IoT vers le LAN principal tout en permettant à n8n de lire les capteurs localement, on déploie un micro-service Python (FastAPI + python-kasa) sur le même réseau Docker que n8n.

Étape 1 : Application Tapo et Pare-feu (UniFi / Routeur)

  1. Application Tapo : Moi → Services tiers → Compatibilité tierce → Activer.
  2. DHCP statique : Fixez l'adresse IP de votre Hub H100 et de chaque prise dans votre VLAN IoT (ex. 192.168.10.10 à 192.168.10.14).
  3. Règle de pare-feu unidirectionnelle :
    • Type : LAN Entrant (LAN In) — placé au-dessus des règles de blocage inter-VLAN.
    • Action : Accepter — Protocole : TCP.
    • Source : IP de l'hôte Docker (ex. 192.168.1.10) → Destination : IP des appareils Tapo — Port : 80.
    • Trafic retour : Assurez-vous qu'une règle LAN Entrant autorise les états Établi et Lié (Established & Related) de l'IoT vers le LAN.

Test depuis l'hôte Docker :

nc -zv -w 3 192.168.10.10 80

Étape 2 : Fichiers du conteneur tapo-bridge

Créez un dossier ~/tapo-bridge et ajoutez ces trois fichiers :

Dockerfile

FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir fastapi uvicorn python-kasa
COPY app.py .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]

app.py

import os
import asyncio
from fastapi import FastAPI
from kasa import Discover, Credentials

app = FastAPI()

TAPO_USER = os.getenv("TAPO_USER", "")
TAPO_PASS = os.getenv("TAPO_PASS", "")
TAPO_IPS = [ip.strip() for ip in os.getenv("TAPO_IPS", "").split(",") if ip.strip()]
KWH_PRICE = float(os.getenv("KWH_PRICE", "0.2016"))  # Tarif Base EDF (€/kWh)

def safe_get(obj, attr):
    if obj is None:
        return None
    try:
        return getattr(obj, attr)
    except Exception:
        return None

async def read_device(ip: str, creds: Credentials):
    try:
        dev = await Discover.discover_single(ip, credentials=creds, timeout=5)
        await dev.update()
        result = {"ip": ip, "name": dev.alias, "model": dev.model, "type": "unknown"}

        # Prises connectées (P110 / P110M)
        energy = dev.modules.get("Energy")
        if energy:
            month_kwh = round(float(safe_get(energy, "consumption_this_month") or 0), 3)
            today_kwh = round(float(safe_get(energy, "consumption_today") or 0), 3)
            power_w = round(float(safe_get(energy, "current_consumption") or 0), 1)
            result.update({
                "type": "plug",
                "is_on": dev.is_on,
                "power_w": power_w,
                "today_kwh": today_kwh,
                "month_kwh": month_kwh,
                "month_cost_eur": round(month_kwh * KWH_PRICE, 2),
            })

        # Hub H100 et sondes appairées (T310 / T315)
        if dev.children:
            sensors = []
            for child in dev.children:
                temp_mod = child.modules.get("TemperatureSensor")
                hum_mod = child.modules.get("HumiditySensor")
                bat_mod = child.modules.get("BatterySensor")
                if temp_mod or hum_mod:
                    sensors.append({
                        "name": child.alias,
                        "model": child.model,
                        "temperature_c": safe_get(temp_mod, "temperature"),
                        "humidity_pct": safe_get(hum_mod, "humidity"),
                        "battery_pct": safe_get(bat_mod, "battery"),
                        "battery_low": safe_get(bat_mod, "battery_low"),
                    })
            if sensors:
                result["type"] = "hub"
                result["sensors"] = sensors

        await dev.disconnect()
        return result
    except Exception as e:
        return {"ip": ip, "error": str(e)}

@app.get("/status")
async def get_status():
    creds = Credentials(TAPO_USER, TAPO_PASS)
    results = await asyncio.gather(*(read_device(ip, creds) for ip in TAPO_IPS))

    plugs = [r for r in results if r.get("type") == "plug"]
    sensors = [s for r in results if r.get("type") == "hub" for s in r.get("sensors", [])]
    errors = [r for r in results if "error" in r]

    total_month_kwh = round(sum(p["month_kwh"] for p in plugs), 3)
    return {
        "kwh_price_eur": KWH_PRICE,
        "total_month_kwh": total_month_kwh,
        "total_month_cost_eur": round(total_month_kwh * KWH_PRICE, 2),
        "plugs": plugs,
        "sensors": sensors,
        "errors": errors,
    }

docker-compose.yml

Repérez d'abord le nom exact du réseau Docker utilisé par n8n (docker network ls | grep -i n8n), puis adaptez n8n_default ci-dessous :

services:
  tapo-bridge:
    build: .
    container_name: tapo-bridge
    restart: unless-stopped
    environment:
      - TAPO_USER=votre_email_tplink@exemple.fr
      - TAPO_PASS=votre_mot_de_passe_tplink
      - TAPO_IPS=192.168.10.10,192.168.10.11,192.168.10.12
      - KWH_PRICE=0.2016
    ports:
      - "127.0.0.1:8000:8000"
    networks:
      - n8n_default

networks:
  n8n_default:
    external: true

Étape 3 : Démarrer et valider

docker compose up -d --build
curl -s http://127.0.0.1:8000/status | jq .

6. Workflow 4 : Bilan mensuel de consommation électrique (Tapo)

Tourne tous les jours à 23h50 et vérifie si le lendemain est le 1er du mois. Le dernier soir de chaque mois, juste avant la remise à zéro des compteurs internes des prises Tapo, il envoie sur Discord le classement de consommation (en kWh et en €) ainsi que le total mensuel.

JSON à importer dans n8n

{
  "name": "Bilan Mensuel Électricité (Tapo) -> Discord",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "50 23 * * *"
            }
          ]
        }
      },
      "id": "elec1111-1111-4111-8111-111111111101",
      "name": "Tous les jours à 23h50",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://tapo-bridge:8000/status",
        "options": {
          "timeout": 15000
        }
      },
      "id": "elec1111-1111-4111-8111-111111111102",
      "name": "Lire Tapo Bridge",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Vérifie si demain est le 1er du mois (commentez ce bloc if pour tester immédiatement)\nconst now = new Date();\nconst tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);\nif (tomorrow.getDate() !== 1) {\n  return [];\n}\n\nconst data = $input.first().json;\nconst plugs = (data.plugs || []).sort((a, b) => b.month_kwh - a.month_kwh);\nif (plugs.length === 0) return [];\n\nconst monthName = now.toLocaleDateString('fr-FR', {\n  month: 'long',\n  year: 'numeric',\n  timeZone: 'Europe/Paris'\n});\n\nconst lines = plugs.map(p => {\n  const name = p.name.trim();\n  const kwh = Number(p.month_kwh).toFixed(2).replace('.', ',');\n  const eur = Number(p.month_cost_eur).toFixed(2).replace('.', ',');\n  return `🔌 **${name}** : **${kwh} kWh** (${eur} €)`;\n});\n\nconst totalKwh = Number(data.total_month_kwh).toFixed(2).replace('.', ',');\nconst totalEur = Number(data.total_month_cost_eur).toFixed(2).replace('.', ',');\nconst priceStr = Number(data.kwh_price_eur).toFixed(4).replace('.', ',');\n\nreturn [\n  {\n    json: {\n      payload: {\n        username: \"Suivi Énergie • Maison\",\n        embeds: [\n          {\n            title: `⚡ Bilan Électrique — ${monthName}`,\n            color: 15844367,\n            fields: [\n              {\n                name: \"📊 Détail par prise (du + au - consommateur)\",\n                value: lines.join('\\n'),\n                inline: false\n              },\n              {\n                name: \"💶 Total du mois\",\n                value: `**${totalKwh} kWh** — soit **${totalEur} €** *(base ${priceStr} €/kWh)*`,\n                inline: false\n              }\n            ],\n            footer: {\n              text: \"Tapo P110 / P110M • Relevé local via tapo-bridge\"\n            },\n            timestamp: now.toISOString()\n          }\n        ]\n      }\n    }\n  }\n];"
      },
      "id": "elec1111-1111-4111-8111-111111111103",
      "name": "Formater Bilan Mensuel",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}",
        "options": {}
      },
      "id": "elec1111-1111-4111-8111-111111111104",
      "name": "Envoyer sur Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        880,
        300
      ]
    }
  ],
  "connections": {
    "Tous les jours à 23h50": {
      "main": [
        [
          {
            "node": "Lire Tapo Bridge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lire Tapo Bridge": {
      "main": [
        [
          {
            "node": "Formater Bilan Mensuel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Formater Bilan Mensuel": {
      "main": [
        [
          {
            "node": "Envoyer sur Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}

7. Workflow 5 : Suivi quotidien Température & Humidité Intérieur/Extérieur (Tapo)

Relève toutes les heures les températures et taux d'humidité des sondes appairées au Hub H100, mémorise les Min / Max de la journée via le stockage persistant interne de n8n ($getWorkflowStaticData), puis publie un récapitulatif complet à 20h00 sur Discord (avec alerte automatique si une pile est faible).

JSON à importer dans n8n

{
  "name": "Suivi Température & Humidité Maison (Tapo) -> Discord",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 * * * *"
            }
          ]
        }
      },
      "id": "temp1111-1111-4111-8111-111111111101",
      "name": "Toutes les heures",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://tapo-bridge:8000/status",
        "options": {
          "timeout": 15000
        }
      },
      "id": "temp1111-1111-4111-8111-111111111102",
      "name": "Lire Tapo Bridge",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json;\nconst sensors = data.sensors || [];\nif (sensors.length === 0) return [];\n\nconst now = new Date();\nconst parisDate = now.toLocaleDateString('fr-CA', { timeZone: 'Europe/Paris' });\nconst parisHour = parseInt(now.toLocaleTimeString('fr-FR', { hour: '2-digit', hour12: false, timeZone: 'Europe/Paris' }), 10);\n\n// Stockage persistant dans n8n pour suivre les Min/Max du jour\nconst store = $getWorkflowStaticData('global');\nif (store.date !== parisDate) {\n  store.date = parisDate;\n  store.stats = {};\n}\n\nfor (const s of sensors) {\n  const name = s.name.trim();\n  const t = s.temperature_c;\n  const h = s.humidity_pct;\n  if (typeof t !== 'number') continue;\n\n  if (!store.stats[name]) {\n    store.stats[name] = { minT: t, maxT: t, minH: h, maxH: h, firstT: t };\n  } else {\n    store.stats[name].minT = Math.min(store.stats[name].minT, t);\n    store.stats[name].maxT = Math.max(store.stats[name].maxT, t);\n    if (typeof h === 'number') {\n      store.stats[name].minH = Math.min(store.stats[name].minH, h);\n      store.stats[name].maxH = Math.max(store.stats[name].maxH, h);\n    }\n  }\n}\n\n// N'envoie le bilan sur Discord qu'à 20h00 (commentez ce bloc if pour tester immédiatement)\nif (parisHour !== 20) {\n  return [];\n}\n\nconst fmt = (n) => (typeof n === 'number' ? n.toFixed(1).replace('.', ',') : '?');\n\nconst fields = sensors.map(s => {\n  const name = s.name.trim();\n  const st = store.stats[name] || {};\n  const isExt = /ext/i.test(name);\n  const icon = isExt ? '🌳' : '🏠';\n  const diff = (typeof st.firstT === 'number') ? (s.temperature_c - st.firstT) : 0;\n  const trend = diff > 0.3 ? '↗️' : (diff < -0.3 ? '↘️' : '➡️');\n  const batAlert = s.battery_low ? ' ⚠️ *Pile faible*' : '';\n\n  return {\n    name: `${icon} ${name}${batAlert}`,\n    value: `🌡️ **${fmt(s.temperature_c)} °C** ${trend} *(Min ${fmt(st.minT)}° / Max ${fmt(st.maxT)}°)*\\n💧 **${s.humidity_pct ?? '?'} %** *(Min ${st.minH ?? '?'}% / Max ${st.maxH ?? '?'}%)*`,\n    inline: false\n  };\n});\n\nconst dateLabel = now.toLocaleDateString('fr-FR', {\n  weekday: 'long',\n  day: 'numeric',\n  month: 'long',\n  timeZone: 'Europe/Paris'\n});\n\nreturn [\n  {\n    json: {\n      payload: {\n        username: \"Climat Maison • Tapo\",\n        embeds: [\n          {\n            title: `🌡️ Évolution Température & Humidité — ${dateLabel}`,\n            color: 3447003,\n            fields,\n            footer: {\n              text: \"Tapo H100 / T310 / T315 • Relevé horaire local\"\n            },\n            timestamp: now.toISOString()\n          }\n        ]\n      }\n    }\n  }\n];"
      },
      "id": "temp1111-1111-4111-8111-111111111103",
      "name": "Mémoriser & Formater (20h)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}",
        "options": {}
      },
      "id": "temp1111-1111-4111-8111-111111111104",
      "name": "Envoyer sur Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        880,
        300
      ]
    }
  ],
  "connections": {
    "Toutes les heures": {
      "main": [
        [
          {
            "node": "Lire Tapo Bridge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lire Tapo Bridge": {
      "main": [
        [
          {
            "node": "Mémoriser & Formater (20h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mémoriser & Formater (20h)": {
      "main": [
        [
          {
            "node": "Envoyer sur Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}

8. Workflow 6 : Top 10 & Recommandations musicales Tidal × Last.fm

Ce workflow regroupe dans un même flux le bilan hebdomadaire (chaque dimanche à 20h00) et le bilan mensuel (le 1er du mois à 10h00). Il récupère le Top 10 titres, le Top 5 artistes et génère 6 recommandations d'artistes similaires (en excluant ceux déjà écoutés) accompagnées d'un lien de recherche direct vers Tidal.

Prérequis

  1. Activez le scrobbling Last.fm dans Tidal (Paramètres → Connecter → Last.fm).
  2. Créez une clé API gratuite surlast.fm/api/account/create.
  3. Vérifiez dans les paramètres de confidentialité de Last.fm que l'option Masquer les informations sur les écoutes récentes est décochée.
  4. Renseignez LASTFM_USER et LASTFM_API_KEY en haut du nœud Récupérer Top 10 & Recos (Last.fm).

JSON à importer dans n8n

{
  "name": "Tidal x Last.fm — Top 10 & Recommandations (Hebdo + Mensuel) -> Discord",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 20 * * 0"
            }
          ]
        }
      },
      "id": "mus11111-1111-4111-8111-111111111101",
      "name": "Hebdo (Dimanche 20h00)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        200
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 10 1 * *"
            }
          ]
        }
      },
      "id": "mus11111-1111-4111-8111-111111111102",
      "name": "Mensuel (1er du mois 10h00)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        420
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "p1",
              "name": "period",
              "value": "7day",
              "type": "string"
            },
            {
              "id": "p2",
              "name": "label",
              "value": "Hebdomadaire",
              "type": "string"
            },
            {
              "id": "p3",
              "name": "color",
              "value": 3447003,
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "id": "mus11111-1111-4111-8111-111111111103",
      "name": "Config Hebdo",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        400,
        200
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "m1",
              "name": "period",
              "value": "1month",
              "type": "string"
            },
            {
              "id": "m2",
              "name": "label",
              "value": "Mensuel",
              "type": "string"
            },
            {
              "id": "m3",
              "name": "color",
              "value": 10181046,
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "id": "mus11111-1111-4111-8111-111111111104",
      "name": "Config Mensuel",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        400,
        420
      ]
    },
    {
      "parameters": {
        "jsCode": "// --- CONFIGURATION LAST.FM ---\nconst LASTFM_USER = 'VOTRE_PSEUDO_LASTFM';\nconst LASTFM_API_KEY = 'VOTRE_CLE_API_LASTFM';\nconst SEND_IF_EMPTY = false; // Passez à true pour tester même avec 0 écoute récente\n\nconst { period = '7day', label = 'Hebdomadaire', color = 3447003 } = $input.first().json;\nconst baseUrl = 'https://ws.audioscrobbler.com/2.0/';\n\nconst fetchLfm = async (params) => {\n  const allParams = { ...params, api_key: LASTFM_API_KEY, format: 'json' };\n  const qs = Object.entries(allParams)\n    .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n    .join('&');\n  return await this.helpers.httpRequest({ method: 'GET', url: `${baseUrl}?${qs}`, json: true });\n};\n\n// 1. Top 10 titres et Top 15 artistes\nconst [tracksRes, artistsRes] = await Promise.all([\n  fetchLfm({ method: 'user.gettoptracks', user: LASTFM_USER, period, limit: '10' }),\n  fetchLfm({ method: 'user.gettopartists', user: LASTFM_USER, period, limit: '15' })\n]);\n\nif (tracksRes?.error) {\n  throw new Error(`Erreur Last.fm (${tracksRes.error}) : ${tracksRes.message}`);\n}\nif (artistsRes?.error) {\n  throw new Error(`Erreur Last.fm (${artistsRes.error}) : ${artistsRes.message}`);\n}\n\nconst topTracks = tracksRes?.toptracks?.track || [];\nconst topArtists = artistsRes?.topartists?.artist || [];\n\nif (topTracks.length === 0 && topArtists.length === 0 && !SEND_IF_EMPTY) {\n  return [];\n}\n\nconst knownArtists = new Set(topArtists.map(a => a.name.toLowerCase()));\n\n// 2. Recommandations basées sur le Top 3 artistes\nconst seeds = topArtists.slice(0, 3);\nconst similarMap = new Map();\n\nfor (const seed of seeds) {\n  try {\n    const simRes = await fetchLfm({ method: 'artist.getsimilar', artist: seed.name, limit: '8' });\n    const similars = simRes?.similarartists?.artist || [];\n    for (const s of similars) {\n      const key = s.name.toLowerCase();\n      if (knownArtists.has(key)) continue;\n      const score = parseFloat(s.match || '0');\n      const existing = similarMap.get(key);\n      if (!existing || score > existing.score) {\n        similarMap.set(key, { name: s.name, score, via: seed.name });\n      }\n    }\n  } catch (e) {}\n}\n\nconst recos = [...similarMap.values()]\n  .sort((a, b) => b.score - a.score)\n  .slice(0, 6);\n\n// 3. Formatage Discord sécurisé (< 1024 caractères par champ)\nconst tidalSearch = (q) => `https://listen.tidal.com/search?q=${encodeURIComponent(q)}`;\nconst clampField = (lines, fallback) => {\n  if (lines.length === 0) return fallback;\n  let out = '';\n  for (const line of lines) {\n    if ((out + '\\n' + line).length > 1000) break;\n    out = out ? `${out}\\n${line}` : line;\n  }\n  return out;\n};\n\nconst trackLines = topTracks.map((t, i) => {\n  const artist = t.artist?.name || '?';\n  const url = tidalSearch(`${artist} ${t.name}`);\n  return `**${i + 1}.** [${t.name}](${url}) — *${artist}* (${t.playcount} éc.)`;\n});\n\nconst artistLines = topArtists.slice(0, 5).map((a, i) => {\n  const url = tidalSearch(a.name);\n  return `**${i + 1}.** [${a.name}](${url}) (${a.playcount} éc.)`;\n});\n\nconst recoLines = recos.map(r => `✨ **[${r.name}](${tidalSearch(r.name)})** *(proche de ${r.via})*`);\n\nreturn [\n  {\n    json: {\n      payload: {\n        username: \"Tidal • Last.fm\",\n        embeds: [\n          {\n            title: `🎧 Bilan Musical ${label}`,\n            color,\n            fields: [\n              {\n                name: \"🔥 Top 10 Titres\",\n                value: clampField(trackLines, 'Aucun titre enregistré sur Last.fm pour cette période.'),\n                inline: false\n              },\n              {\n                name: \"🎤 Top 5 Artistes\",\n                value: clampField(artistLines, 'Aucun artiste enregistré sur cette période.'),\n                inline: false\n              },\n              {\n                name: \"🧭 Recommandations à écouter sur Tidal\",\n                value: clampField(recoLines, 'Pas assez d\\'historique pour générer des recommandations.'),\n                inline: false\n              }\n            ],\n            footer: {\n              text: `Last.fm (${LASTFM_USER}) • Période : ${period}`\n            },\n            timestamp: new Date().toISOString()\n          }\n        ]\n      }\n    }\n  }\n];"
      },
      "id": "mus11111-1111-4111-8111-111111111105",
      "name": "Récupérer Top 10 & Recos (Last.fm)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://discord.com/api/webhooks/VOTRE_ID/VOTRE_TOKEN",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}",
        "options": {}
      },
      "id": "mus11111-1111-4111-8111-111111111106",
      "name": "Envoyer sur Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        900,
        300
      ]
    }
  ],
  "connections": {
    "Hebdo (Dimanche 20h00)": {
      "main": [
        [
          {
            "node": "Config Hebdo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mensuel (1er du mois 10h00)": {
      "main": [
        [
          {
            "node": "Config Mensuel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config Hebdo": {
      "main": [
        [
          {
            "node": "Récupérer Top 10 & Recos (Last.fm)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config Mensuel": {
      "main": [
        [
          {
            "node": "Récupérer Top 10 & Recos (Last.fm)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Récupérer Top 10 & Recos (Last.fm)": {
      "main": [
        [
          {
            "node": "Envoyer sur Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}