Openmeteo forecast probability of precipitation is not returning an accurate value
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- backend
Research direction
The issue identifies openmeteo.js, the dailyParams definition around lines 71–89, and the precipitation probability calculation around line 424. Read those sections first and check how daily values from the Open-Meteo API are mapped into the weather result. Done means the reported probability uses the API's precipitation_probability_max value; run the relevant weather module tests if available.
Written by the indexing model from the issue text.
Description
Environment
MagicMirror² version: 2.38.0
Node version: 24.22.0
npm version: 11.21.0
Platform: docker
Which start option are you using?
node --run start
Are you using PM2?
I don't know
Module
weather
Have you tried disabling other modules?
- Yes
- No
Have you searched if someone else has already reported the issue on the forum or in the issues?
- Yes
What did you do?
The current version of openmeteo.js calculates probability of precipitation using daily hours of precipitation divided by 24 hours to arrive at a percentage.
Line 424: precipitationProbability: weather.precipitation_hours != null ? parseFloat(weather.precipitation_hours * 100 / 24) : null,
This calculation doesn't reflect the actual probability of precipitation.
What did you expect to happen?
I expected openmeteo.js to pull precipitation_probability_max from the openmeteo API and report that as the probability of precipitation.
What actually happened?
The current calculation of probability of precipitation as described above is is used and returns an inaccurate result.
Additional comments
Possible fix (that worked for me) would be to:
- Add "precipitation_probability_max" to dailyParams (Lines 71-89)
- Modify line 424 to:
precipitationProbability: weather.precipitation_probability_max != null ? parseFloat(weather.precipitation_probability_max) : null,
Here's a copy of openmeteo.js that I'm currently using.
Participation
- I am willing to submit a pull request for this change.
- Dominant language
- JavaScript
- Stars
- 24.1k
- Forks
- 4.6k
- Avg merge
- 5h 36m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicMirrorOrg/MagicMirror
-
bug
Difficulty 3/5 Half a day Newbie friendliness 69/100
MagicMirrorOrg/MagicMirror#4311 · 3 comments ·
Maintainers usually reply within 1 day
-
bug ready (coming with next release)
Difficulty 4/5 3-5 days Newbie friendliness 43/100
MagicMirrorOrg/MagicMirror#4287 · 16 comments · 3 reactions ·
Maintainers usually reply within 1 day
-
enhancement PR Welcome
Difficulty 5/5 Over a week Newbie friendliness 25/100
MagicMirrorOrg/MagicMirror#3808 · 23 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
dependencies not ours
Difficulty 3/5 1-2 days Newbie friendliness 48/100
MagicMirrorOrg/MagicMirror#3796 · 30 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Proposal: Wiki RestructureMay be free again @KristjanESPERANTO claimed this 152 days ago, and no pull request is open. Openunder development under investigation
MagicMirrorOrg/MagicMirror#2545 · 24 comments · 2 assignees ·
Maintainers usually reply within 1 day
All issues in MagicMirrorOrg/MagicMirror
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
uoftblueprint/canada-basketball#67 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
Fei2411/DeepSeek-Bot#456 ·
Maintainers usually reply within 1 day
-
área:app área:produto sem-fase tipo:decisão
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Varanda-org/varanda#91 ·
-
0️⃣ phase/new
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
auth0/express-openid-connect#901 ·
Maintainers usually reply within 1 day