# Intégrations externes : Pouvoir créer des intégrations de type "météo"

**URL:** <https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424>\
**Category:** Demandes livrées\
**Tags:** feature-core, in-progress\
**Created:** [Août 1, 2026, 1:48 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424 "2026-08-01T13:48:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Août 1, 2026, 1:48 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424/1 "2026-08-01T13:48:08Z")

</div>

Pouvoir créer des intégrations externes de type météo (Openweather, météo France, etc…)

Le widget et l’API doit-être le plus générique possible pour ne pas s’enfermer dans la spec d’un fournisseur de météo.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Août 3, 2026, 2:50 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424/2 "2026-08-03T14:50:12Z")

</div>

La PR côté Gladys :

> <https://github.com/GladysAssistant/Gladys/pull/2738>
>
> \### Description
> 
> Implements phase 2 workstream B.18: external weather integratio…ns. This allows third-party weather providers to be installed as external integrations and automatically takes precedence over the built-in OpenWeather service.
> 
> \*\*Key changes:\*\*
> 
> 1. \*\*Weather provider interface\*\*: External integrations with \`type: 'weather'\` in their manifest now expose a \`weather.get(options)\` capability that mirrors the internal OpenWeather service interface, enabling duck-typed provider switching.
> 
> 2. \*\*Payload normalization\*\*: Added \`externalIntegration.normalizeWeather()\` that validates and bounds weather payloads from unaudited external code:
> - Whitelists all fields (unknown fields dropped)
> - Coerces numbers to finite values, dates to valid Date objects
> - Caps arrays (24 hours, 8 days, 10 alerts) and string lengths
> - Coerces unknown weather conditions to 'unknown'
> - Enforces CAP-style alert severities (minor/moderate/severe/extreme)
> 
> 3. \*\*Provider selection logic\*\*: Updated \`weather.get()\` to iterate through all available weather providers (external + internal) sorted by name, with \`ext-\*\` selectors taking precedence over \`openweather\`. Falls back gracefully when a provider fails, distinguishing between "not configured" and real errors.
> 
> 4. \*\*UI enhancements\*\*:
> - Weather box now displays alerts with severity-based color coding (blue/yellow/orange/red)
> - Shows sunrise/sunset times and UV index when available
> - Updated error messages to reference generic weather configuration rather than OpenWeather specifically
> - Added weather icon mappings for drizzle and thunderstorm conditions
> 
> 5. \*\*Manifest schema\*\*: Extended to accept \`type: 'weather'\` for external integrations.
> 
> 6. \*\*WebSocket protocol\*\*: Added \`WEATHER\_GET\` message type with 15s timeout (matching camera image freshness requirement).
> 
> All changes are covered by comprehensive unit tests validating normalization edge cases, provider fallback behavior, and integration with the proxy service system.
> 
> \### Checklist
> 
> \- \[x\] Tests pass: Added 262 lines of test coverage for weather normalization and provider selection
> \- \[x\] Linter and prettier pass
> \- \[x\] No breaking changes: Weather provider selection is backward compatible; existing OpenWeather setups continue to work
> 
> https://claude.ai/code/session\_01FuafgHvr5244RxZ5KKTN3a
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Added support for weather-provider integrations alongside device and communication integrations.
> \* Weather retrieval supports provider fallback and location, language, and unit options.
> \* Enhanced weather dashboards with alerts, sunrise/sunset times, humidity, wind, UV index, and additional forecast icons.
> \* Added weather-specific installation guidance and localized messaging.
> 
> \* \*\*Bug Fixes\*\*
> \* Improved handling of incomplete forecasts, unavailable icons, future dates, and missing weather details.
> \* Added validation and limits for weather data to support reliable display.

La PR côté SDK :

> <https://github.com/GladysAssistant/integration-sdk-js/pull/19>
>
> Implements SDK support for the \*\*"weather" integration type\*\* shipped in Gladys …core by GladysAssistant/Gladys#2738 (spec \*\*B.18\*\*): a weather provider (Météo France, Open-Meteo…) installs from the store and feeds the dashboard weather widget, the assistant and the weather-alert scene triggers, with no provider-specific code in the core.
> 
> \## What the SDK adds
> 
> \- \*\*\`WEATHER\_GET\` WebSocket message type\*\* (\`external-integration.weather.get\`), routed like every command and auto-acked.
> \- \*\*\`gladys.onWeatherGet(callback)\`\*\* — \`(options) =\> Promise\<pivot weather\>\` with \`options = { latitude, longitude, language, units }\`. The resolved object is acked back as \`data.weather\` (the core awaits it under \*\*15 s\*\*, the same exception to the 5 s rule as \`camera.get-image\`); throwing acks the command as failed so the core's provider loop falls through to the next provider. This is exactly the SDK surface the B.18 spec documents in its contract C.8 table.
> \- \*\*\`gladys.onWeatherGetImage(callback)\`\*\* — \`(key) =\> Promise\<string\>\` (B.18 point 6, provider images: vigilance map, rain radar…). The pivot payload only declares \*\*metadata\*\* (\`images\`, ≤ 3 entries of \`{ key, label? }\`); the bytes travel on demand over \`external-integration.weather.get-image\`: resolve the raw base64 (no data-URI prefix) of a PNG/JPEG ≤ 500 KB decoded, acked as \`data.image\` under 15 s — validated (magic numbers + size) and cached 10 min by the core, served to the browser from the Gladys origin.
> \- \*\*\`gladys.requestWeatherRefresh()\`\*\* — fire-and-forget freshness nudge (B.18 point 5, "trigger, not data") over \`external-integration.weather.refresh\`: "re-pull me now and re-evaluate the weather-alert scene triggers". No payload, no ack; rate-limited core-side (1/min per integration, silently dropped beyond) and dropped silently while disconnected.
> \- \*\*Constants\*\* exported from CJS and ESM entry points:
> - \`WEATHER\_CONDITIONS\` — the pivot condition enum (\`clear\` | \`partly-cloudy\` | \`cloud\` | \`fog\` | \`drizzle\` | \`rain\` | \`pouring\` | \`sleet\` | \`hail\` | \`snow\` | \`thunderstorm\` | \`wind\` | \`night\` | \`unknown\`; anything else is coerced to \`unknown\` by the core; \`night\` is deprecated for providers — send the real condition plus \`is\_day: false\`);
> - \`WEATHER\_ALERT\_SEVERITIES\` — the CAP-style alert severities (\`minor\` | \`moderate\` | \`severe\` | \`extreme\`);
> - \`WEATHER\_ALERT\_TYPES\` — the alert phenomenon types (\`wind\` | \`rain\` | \`flood\` | \`thunderstorm\` | \`snow\` | \`heat\` | \`cold\` | \`avalanche\` | \`coastal\` | \`fog\`; optional metadata — an invalid type is dropped by the core, the alert is kept);
> - internal mirror of the core-side bounds (≤ 24 hours, ≤ 8 days, ≤ 10 alerts, ≤ 3 images, event ≤ 100 chars, description ≤ 5000 chars, image ≤ 500 KB decoded, label ≤ 50 chars).
> \- \*\*TypeScript typings\*\* of the whole pivot format: \`WeatherGetOptions\`, \`WeatherUnits\` (\`'metric' | 'us'\`), \`WeatherCondition\`, \`WeatherPayload\` (including the \`is\_day\` strict boolean on the current conditions and each \`hours\` entry, and the \`images\` metadata), \`WeatherHourForecast\`, \`WeatherDayForecast\`, \`WeatherAlert\` (with the optional \`type\`), \`WeatherAlertSeverity\`, \`WeatherAlertType\`, \`WeatherImage\`, plus the \`onWeatherGet\`/\`onWeatherGetImage\`/\`requestWeatherRefresh\` members and the \`WEATHER\_GET\`/\`WEATHER\_GET\_IMAGE\`/\`WEATHER\_REFRESH\` message types.
> \- \*\*README\*\*: \`onWeatherGet(cb)\`/\`onWeatherGetImage(cb)\` rows in the Handlers table, \`requestWeatherRefresh()\` row in the Methods table, and a dedicated \*\*"Weather providers"\*\* section (manifest \`type: "weather"\`, unit systems, condition mapping, \`is\_day\` day/night signal, typed alerts, provider images, freshness nudge, 15 s ack, core-side normalization and bounds), mirroring the existing "Communication channels" section.
> 
> \## Design notes
> 
> The SDK passes the resolved payloads through as-is (like \`onGetImage\`): per B.18 they are \*\*never trusted\*\* and are normalized/bounded by the Gladys core (\`normalizeWeather\`/\`normalizeWeatherImage\` — whitelisted fields, finite numbers, clamped percentages, capped arrays, strict-boolean \`is\_day\`, magic-number image checks, \`units\` stamped from the request). The SDK documents the contract thoroughly (typings + README) instead of duplicating the normalization.
> 
> The weather-alert scene trigger of B.18 point 4 is \*\*core-owned\*\* (a gated 30-min scheduled diff on the normalized alerts) — the integration has nothing to implement for it; \`requestWeatherRefresh()\` is the optional cooperation path that beats the 30-min floor.
> 
> Kept in sync with the latest revision of the Gladys PR (extended condition enum with \`partly-cloudy\`/\`pouring\`/\`hail\`, \`is\_day\` day/night signal, typed alerts, provider images, freshness nudge, alert description bound raised to 5000).
> 
> \## Tests
> 
> \- \`test/weather.test.js\` — WS command acks against the fake Gladys server: \`weather.get\` success with a full pivot payload (current + hours + days + typed alerts + \`is\_day\` + \`images\` metadata), \`us\` unit system pass-through, handler failure → \`success:false\` with the error message, no handler → \`"not implemented"\`; \`weather.get-image\` success/failure/not-implemented acks; \`weather.refresh\` emission (empty payload) and silent drop while disconnected; plus the exported constants and message types.
> \- \`test/types/api.test-d.ts\` — compile-time check of the new typings.
> \- Full suite: \*\*193 tests pass\*\*, ESLint, \`tsc\` and Prettier clean.
> 
> 🤖 Generated with \[Claude Code\](https://claude.com/claude-code)
> 
> https://claude.ai/code/session\_01BPXiFG8AQAUprvrRNCtaKF
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Added weather data and weather image retrieval handlers.
> \* Added refresh requests for updating weather information.
> \* Added standardized forecasts, alerts, conditions, units, day/night details, and normalized responses.
> \* Added weather messaging and exported condition, alert severity, and alert type constants.
> \* Added TypeScript definitions for weather requests, forecasts, alerts, images, and responses.
> 
> \* \*\*Documentation\*\*
> \* Documented provider fallback, validation, payload limits, errors, timeouts, image handling, caching, and supported versions.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Août 4, 2026, 7:48 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424/3 "2026-08-04T19:48:14Z")

</div>

@pierre-gilles , tu me diras quand ce sera merge.  
De mon coté l’integration Meteo France est presque prête.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Août 7, 2026, 2:19 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424/4 "2026-08-07T14:19:17Z")

</div>

Disponible dans Gladys Assistant 4.85 :

> [@Gladys Assistant 4.85.0 : widget Photo, navigation dans les graphiques, chauffe-eau & HomeKit](https://community.gladysassistant.com/t/gladys-assistant-4-85-0-widget-photo-navigation-dans-les-graphiques-chauffe-eau-homekit/10483):
>
> Salut à tous ! Voici la 4.85.0 : une version riche côté tableau de bord, appareils, intégrations externes et HomeKit. Tableau de bord : widget Photo Nouveau widget Photo pour afficher des images sur le dashboard (idéal sur une tablette murale). Les photos ne sont pas stockées dans Gladys : on configure des URLs Gladys les récupère en local (proxy), donc ça marche aussi avec un NAS et à distance via Gladys Plus Redimensionnement côté serveur pour garder le dashboard fluide Diaporama configur…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Août 7, 2026, 2:19 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-meteo/10424/5 "2026-08-07T14:19:21Z")

</div>


