Coreflux Templates

Fuse Porto air, noise, and weather into a Comfort Index

Poll Porto Digital NGSI, score air with EAQI, blend noise and weather, publish HUB geopoints.

Dataflow

How it flows

Actions, models, routes and the topics that link them. Click a node to trace its flow.

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

  1. Install LoT Notebooks in VS Code: https://docs.coreflux.org/latest/lot-notebooks/usage

  2. Connect as root to your Coreflux broker (mqtt://localhost:1883 or wss://…/mqtt).

  3. Run cells top to bottom. One definition per LoT cell. The Python cell must run before the fusion Action.

  4. In HUB Data Viewer, pin porto/derived/comfort/point/0 — the payload has lat/lng so the card becomes a map.

The notebook

What’s inside

Browse the markdown and code cells before you download.

LoT Notebook:porto-zone-comfort-index.lotnb
Related use cases

Similar templates

Templates chosen for overlap in routes, tags, and category.

View all in Smart Cities

Get this template

1 file