7 November 2026 · 665 words
Fog below, sun above: finding the fog line with open data
Every autumn the Swiss Plateau disappears under a lid of grey. Hochnebel: a fog sea that can sit for days between the Jura and the Alps, while a few hundred metres higher the sun shines on everything. FOMO Sun exists because of that lid. Where does it end, and how far do you have to go to get above it?
For a long time the app estimated that. This autumn it started reading it.
MeteoSwiss, directly
Until 1.25 the weather came from Open-Meteo. It’s a great free API, but the fog sea is exactly where general weather models struggle, and the free tier’s rate limits meant busy mornings ended in “Using cached forecast”.
MeteoSwiss publishes its own post-processed local forecasts as Open Government Data: hourly sunshine, temperature, cloud, precipitation and wind for about 5,600 points, including every postcode and many mountain points, updated every hour. No key, no quota, just static files.
The catch: one CSV per parameter, about 29 MB each. The app streams them (about 0.2 s per file), keeps the coming days in memory and matches each destination to a point by distance and altitude, so a summit uses the mountain point, not the valley postcode below it. Later, to make cold starts fast, one server packs each run into compact binary files that the CDN caches and every other server reads.
Open-Meteo is still there for places abroad and as a fallback.
Reading the fog top
1.26 added the piece I’d wanted from day one: the fog top, the Nebelobergrenze.
There’s no file with it in. But the point forecasts carry the answer. Take the roughly 2,000 MeteoSwiss points on the Plateau and its rims, each with its altitude. In the late morning, look at which are fogged and which are sunny. Somewhere there’s an altitude that separates the two groups: that’s the top of the fog sea. A check for a warm inversion confirms it. The result is a status for each day (fog, patchy, clear or overcast) and a height, for today and the next four days.
The same change stopped the model from counting the fog twice. The old corrections from the Open-Meteo days (a bonus for summits, a penalty for the Plateau) made sense when the forecast didn’t know about the fog. MeteoSwiss’s forecast already does, and applying both would have doubled the effect.
Keeping places abroad honest
About 140 of the 387 destinations are abroad: the Black Forest, Alsace, Vorarlberg, Lombardy and more. They still come from Open-Meteo, so I measured the models against MeteoSwiss on Swiss points first:
- The model used near the border gave about half of MeteoSwiss’s sunshine, and nothing at all after about 33 hours.
- The global “best match” gave about 1.8 times as much, and 3 to 4 times on days three to five.
- ICON-CH2 tracked MeteoSwiss best.
So the border places switched to ICON-CH2, and every forecast run now computes a live calibration (MeteoSwiss divided by the model, per day and altitude band) that puts foreign places on the same scale. A sunny afternoon in Freiburg and one in Lucerne now mean the same thing.
Showing the fog
Data only helps if it shows up where the decision happens. On fog days the hero now says it in plain words (“Up here: 1,450 m above the fog”) and draws a small slice through the fog sea, to scale: home inside the grey band, the fog top as a dashed line and your pick above it.
Since 1.43 the fog line also has a page of its own: fomosun.com/fog shows how high the fog reaches today and for the next four days, which cities are under it, and the nearest sun above it from Zurich, Basel and Bern.
What I learned
Open government data is underrated. The best forecast for Switzerland is free, keyless and hourly. It just comes as big CSV files instead of a friendly API.
Measure a model before you trust it. A model that returned nothing after 33 hours had been hiding behind a code comment that swapped two names.
Derive what isn’t published. Nobody publishes each morning’s fog top as data. 2,000 points with altitudes are enough to read it.