r/Scriptable • u/SunsetScoreWidget • 1d ago
Tip/Guide How I score tonight's sunset (0–100) from Open-Meteo cloud layers — Scriptable widget
I wanted a single number for "is tonight's sunset worth going out for?", so I built a Scriptable widget that scores it 0–100.
The logic is simple:
- Mid/high clouds can provide a canvas for sunset colors — 40–60% coverage scores highest, using whichever layer (mid or high) has more cloud cover
- Low clouds block the horizon — the penalty increases with low-cloud coverage
- Rain probability over 30% brings the score down
- The widget switches to a "rain" mode when precipitation probability reaches 60% or higher, or when the weather code indicates rain, snow, or thunderstorms
It's a heuristic score, not a probability or a guarantee of a beautiful sunset.
It also shows the sunset time, a countdown, the likely sky color, and picks one song per day to match the sky. 30 minutes after sunset it switches to tomorrow's forecast.
The scoring approach above is free to steal for your own scripts. Happy to answer questions about the Open-Meteo fields used (cloud_cover_low/mid/high + precipitation_probability for the sunset hour and the preceding hour).

