What this template does
A REST client route polls Porto Digital NGSI v2 (air, noise, weather). Python script ComfortIndex scores each named air station: EAQI hourly bands on PM2.5, PM10, NO₂, and O₃, air = worst pollutant. Noise uses the WHO night floor (45 dB → 100, 75 dB → 0). Weather penalises rain and distance from 21 °C. Blend is air 50% / noise 30% / weather 20%. Output is a GeoJSON FeatureCollection plus eight geopoints (lat/lng) for HUB Data Viewer maps.
When to use it
You have open city feeds (or the same NGSI shape) and want a Unified Namespace: raw arrays under porto/raw/*, derived comfort under porto/derived/comfort/#. Subscribers never parse NGSI.
How to run it
-
Install LoT Notebooks in VS Code: https://docs.coreflux.org/latest/lot-notebooks/usage
-
Connect as root to your Coreflux broker (mqtt://localhost:1883 or wss://…/mqtt).
-
Run cells top to bottom. One definition per LoT cell. The Python cell must run before the fusion Action.
-
In HUB Data Viewer, pin porto/derived/comfort/point/0 — the payload has lat/lng so the card becomes a map.
