External integration: Meteo France

The temperature difference would be an issue of a decimal not displayed by the widget. For example, I receive the value 16.9°C and instead of rounding to 17°C, the decimal is simply removed.

I just deployed a fix to the integration (from Besançon). Could you update and test it?
I’m rounding the decimal values received from the API and I’ve fixed the snowflake issue.

I just did the update and can confirm that the snowflake issue is fixed :wink:

@prohand You will have a new update in 1.0.3 because I forgot to add the category.

I also have differences (version 1.0.3)

No snowflake displayed for now but red thermometers, present in 1.0.1 and 1.0.3

Some info that should help with debugging:

Same here:

Thanks @mutmut and @Jluc for the screenshots, they helped find the culprit quickly :folded_hands:

The problem: the red thermometer, that’s the icon the widget displays when it doesn’t recognize the weather condition (« Unavailable »). When querying the Météo France API on about thirty cities, I found the description in question: « Variable ». It’s a fairly ordinary mixed sky, but this label wasn’t in my list of matches — hence the default icon.

Surprise bonus: the API sometimes returns descriptions in English (« Cloudy », « Storms », « Slight showers ») in the middle of a French bulletin, even though I explicitly ask for French. They weren’t recognized either.

What I fixed:

  • « Variable » and English labels are now recognized;
  • most importantly, I added a safety net: if Météo France ever invents a label I don’t know, the integration falls back to the icon family instead of displaying a thermometer. This should close the subject for good;
  • incidentally, two icons that were inaccurate: « Thunderstorm with hail » displayed a simple thunderstorm, and « Very cloudy » displayed a sun behind a cloud when it’s actually an overcast sky.

Verified on 12 cities, mainland and overseas: no more thermometers, neither on the current hour, nor on the next hours, nor on the next days.

@Chris75 I’ve looked into the discrepancies with meteofrance.com, and the good news is: it’s not a bug. There are two causes, both upstream of the integration.

  1. It’s not exactly the same location

The API I use responds for the exact GPS point of your house. The meteofrance.com website, on the other hand, displays the forecast for the commune (its official reference point). As soon as there’s elevation, it shows.

A small demonstration around Besançon, over just 4 km:

Point interrogé Lieu renvoyé Altitude Mini prévu
centre Besançon 261 m 17,2 °C
ouest Besançon 307 m 16,1 °C
sud Beure 252 m 15,6 °C
est Montfaucon 488 m 13,6 °C

3.6 °C difference between two points in the same town. The reported 1-degree differences fit very well within this. And it’s no coincidence that they mainly concern the minimums: nighttime temperatures are what depend most on altitude and the basin effect. Besançon, a city in a valley, is the textbook case :slightly_smiling_face:

Note that the integration is more accurate for you than the website: it describes your house, not the city center.

  1. The wind: the API loses precision before I do

The API only returns wind speed in whole m/s. Once converted to km/h, only certain values can be displayed:

1, 2, 3, 4, 5, 6 m/s → 4, 7, 11, 14, 18, 22 km/h

When the website displays 15 km/h (i.e., 4.17 m/s), the API gives me a round 4 m/s, which gives back 14 km/h. It’s impossible to display 15, 10, or 5 — these values don’t exist in what I receive. That’s exactly the series of discrepancies in your screenshot, @Chris75 (15→14, 10→11, 5→7).

There’s nothing I can do about this: you can’t reconstruct a decimal that the API doesn’t send.

Clear explanation :+1:

Thanks @Will_71 for all these corrections.

Do you know if it would be possible to keep yesterday’s page displayed?

What do you mean? You want to keep yesterday’s weather forecast, is that it?
What for?

Yes, that’s it, as often the forecasts do not match the actual situation, this would allow us to identify the delta.

But I don’t know if this could interest anyone

I created a house located at the official reference point and here is the result:

  • for temperatures: it’s ok
  • for icons: there are differences
  • for wind: the 10 km/h from Meteo France gives 14 km/h for Monday, August 24