WangDaYeeeeee / GeometricWeather

A Material Design Weather Application
GNU Lesser General Public License v3.0
2.44k stars 186 forks source link

[Feature request] Use accuweather datas for meteo france missing datas #188

Closed RemyL closed 3 years ago

RemyL commented 3 years ago

Hi,

First thank you for all your work and this great app.

Recently, a commit made by @papjul added meteo france provider as weather source. As he said it in the commits, this provider doesn't have all the info that accuweather has.

What i want to ask is if it's possible to create a provider that will mix datas from meteo france and accuweather. (For exemple: get all datas from acvuweather then get datas from meteo france) -> that would allow users to have all infos in 1 page only with shared datas from mete france and the datas that meteo france doesn't will be provided by accuweather.

I hope and guess that this is possible.

Thank you in advance for your answer, Rémy

papjul commented 3 years ago

Hi, it's more complicated than this.

We will take the issue the other way around: what kind of information, that you need at least once a day, do you miss in this provider? We need to put aside the information that we need every once in a while: for this purpose, you can add an AccuWeather location and have a look at it every once in a while.

Because I believe that — although it's not as complete as AccuWeather — it provides the most essential features of a weather app… and actually, if you install the official Météo France app, you won't have more data than this.

RemyL commented 3 years ago

Actually, that's what i did, i added accuweather to take a look sometime. What we have in meteo france app and not here is chance of rain in percent (hourly and daily). I find it really usefull. One other thing but not linked to that is that when i use meteo france provider, it always show the last 3 hours in hourly tile (exemple: if it's 15h30, the first result in hourly tile in accuweather will be 15h. However, if i use meteo france it will be 12h)

papjul commented 3 years ago

You're right, rain hazard is in the data, along with snow and freeze hazards if I remember correctly. I just hadn't figured out how it worked but I will have another look.

Hourly data is shown exactly as fetched, I don't control the starting hour although I could choose to not display previous hours but I believe some people can find it useful.

papjul commented 3 years ago

It is fixed in #189.

You won't be able to see rain probability on daily because it only exists hourly.

Also, probability is per 3 hours (or 6 hours for later days). It means that probability is always the same for the next 3 hours. For example, if probability is 100% at 18:00, it will also be 100% at 19:00 and 20:00, meaning there is a 100% chance it will rain between 18:00 and 20:59.

RemyL commented 3 years ago

Thx, it's a fast improvement. I hope it will be merged soon. It may be possible to use the max precipitation value from hourly and display it in daily. (I don't know how mf provide datas so this can be hard to do) One last thing, do you think that you could do the same with wind (only in daily)

papjul commented 3 years ago

It's complicated because there is no "daily" actually, the entire app is designed to follow the Accu Weather API which split between day and night, and I don't know which hours are considered day and which are considered night? Does it change in winter or summer? Does it change if you're UTC+1 in Spain or in Finland (because even though both countries have the same timezone, there is more than one hour of difference for sunrise/sunset because of how far they are from each other)? I saw somewhere "day" and "night" were both lasting 12 hours, but it was not official Accu Weather website.

Wind is available hourly but Geometric Weather doesn't have support for hourly wind, and regarding displaying it daily, I will refer you to above.

papjul commented 3 years ago

Also, what is considered "night" on a day from 00:00 to 23:59? Does the night last, let's say, from 00:00 to 06:00 then it stops and continues from 18:00 to 23:59?

RemyL commented 3 years ago

Ok, thx for your time and answer. Hope that your commit will be merged soon.

papjul commented 3 years ago

According to the information displayed on AccuWeather website:

Based on that, I updated the pull request to display total precipitation, highest precipitation probability and lowest/highest wind chill from 06:00 to 17:59 and from 18:00 to 05:59.

I still need to complete the following:

As a side note, the Météo France website is not very consistent when displaying these info, so I cannot really mimic.

(btw, saw your email, sorry for not checking very often)

RemyL commented 3 years ago

Thx for your work and all your answers.

Wind: for me, it's best to take strongest value. I guess that it's the value that is the most interesting. For direction, i think that you don't need to worry about it and just take the direction of the strongest value (or the value you want to take)

Clouds; i guess that it is the value shown in "details" tile. Then. I guess that you can take higest value too.

For all these you can compare your datas with mf app and try to understand how they do it (if they display highest values, the one in middle of the day or maybe an average value.

I also checked the app and most other values are useless except maybe humidity in percent (in details tile) and realfeel (only this one) temperature (in daily tiles after you click on the day)

papjul commented 3 years ago

I believe it's the best implementation, and still better than nothing shown. I will have a look at it on additional Pull Request.

There is no RealFeel® temperature in Météo France, which is a copyrighted thing from AccuWeather. Météo France uses wind chill (« refroidissement éolien ») instead, you can read more about it here: https://meteofrance.com/magazine/meteo-questions/quest-ce-que-la-temperature-ressentie

RemyL commented 3 years ago

I believe it's the best implementation, and still better than nothing shown. I will have a look at it on additional Pull Request.

There is no RealFeel® temperature in Météo France, which is a copyrighted thing from AccuWeather. Météo France uses wind chill (« refroidissement éolien ») instead, you can read more about it here: https://meteofrance.com/magazine/meteo-questions/quest-ce-que-la-temperature-ressentie

Ok thx, i see. So don't bother about it. I don't think that it is usefull (except if you can easily replace realfeel by windfeel).

I will wait for your next PR. Thank you for your great work and explanations

papjul commented 3 years ago

I added daily wind chill in my last merged pull request. I also provide wind chill since the beginning to the hourly module but I don't think it's displayed anywhere.

RemyL commented 3 years ago

I added daily wind chill in my last merged pull request. I also provide wind chill since the beginning to the hourly module but I don't think it's displayed anywhere.

Thx, it's perfect then. So next build will have almost all datas from mf including rain, wind data, wind feel and clouds ? If so it will be perfect

papjul commented 3 years ago

No, wind and clouds are not part of the last merged request.

Plus, I need to get a crash fix merged before working on this.

RemyL commented 3 years ago

No, wind and clouds are not part of the last merged request.

Plus, I need to get a crash fix merged before working on this.

It's ok, thank you.

papjul commented 3 years ago

I think #193 has everything you requested.

RemyL commented 3 years ago

Nice, it's perfect. Just waiting to see it now

RemyL commented 3 years ago

According to the information displayed on AccuWeather website:

* Day is morning+afternoon

* Night is evening+the overnight (meaning the night forecast is in most case from the following day)

Based on that, I updated the pull request to display total precipitation, highest precipitation probability and lowest/highest wind chill from 06:00 to 17:59 and from 18:00 to 05:59.

I still need to complete the following:

* Wind: what should I do? Wind can be in many different directions on a 12-hour period. Should I take the "strongest" wind from the period? Or should I take the wind in the middle of the day (12:00) or the night (00:00)? Knowing these hours does not always exist, but 13:00 exists and I guess it becomes 14:00 in summer time?

* Clouds: I guess I can take the highest % of the period? Or the middle of the period?

As a side note, the Météo France website is not very consistent when displaying these info, so I cannot really mimic.

(btw, saw your email, sorry for not checking very often)

Now that i'm looking in the tommorrow notification thing, i see that in current mf provider "day value" seems to be "today day value" and "night value" seems to be "today morning value" or "previous day night value". So maybe we wiil need to check if precipitation and wind are correctly displayed in daily forecast

papjul commented 3 years ago

Now that i'm looking in the tommorrow notification thing, i see that in current mf provider "day value" seems to be "today day value" and "night value" seems to be "today morning value" or "previous day night value".

Branch mf-daily-wind-covers behaves like this:

So maybe we wiil need to check if precipitation and wind are correctly displayed in daily forecast

Precipitation and wind do not exist at daily level (except for a 24 hour-precipitation value, which is useless since we only care about half days/12 hours), they are all taken from hourly information. That's why you won't have any forecast for precipitation and wind for the last few days of the 15 days forecast, because hourly doesn't exist for them.

RemyL commented 3 years ago

Now that i'm looking in the tommorrow notification thing, i see that in current mf provider "day value" seems to be "today day value" and "night value" seems to be "today morning value" or "previous day night value".

Branch mf-daily-wind-covers behaves like this:

* Daytime: max hourly value from 06:00 to 17:59, defaults to max temp. of the day if cannot find hourly information

* Nighttime: min hourly value from 18:00 to 05:59, defaults to min temp. of the day if cannot find hourly information

So, if i check today datas, the night value is 18h to 24h from today and 24h to 05h59 from tomorrow or 18h to 24h from yesterday and 24h to 05h59 from today ? Because first i thought that it was first option but when i check hourly temperatures it seems to ne the second one

So maybe we wiil need to check if precipitation and wind are correctly displayed in daily forecast

Precipitation and wind do not exist at daily level (except for a 24 hour-precipitation value, which is useless since we only care about half days/12 hours), they are all taken from hourly information. That's why you won't have any forecast for precipitation and wind for the last few days of the 15 days forecast, because hourly doesn't exist for them.

Yes, i understand this but you use the houly informations and display them in the daily tile. What i meant is that we need to check that the correct hourly information is displayed to the correct "night" or "day" of the correct day.

Anyway as i don't have the updated app i can't check if it's correctly displayed or not

papjul commented 3 years ago

So, if i check today datas, the night value is 18h to 24h from today and 24h to 05h59 from tomorrow or 18h to 24h from yesterday and 24h to 05h59 from today ? Because first i thought that it was first option but when i check hourly temperatures it seems to ne the second one

It's the overnight, so "tomorrow".

Yes, i understand this but you use the houly informations and display them in the daily tile. What i meant is that we need to check that the correct hourly information is displayed to the correct "night" or "day" of the correct day.

It's not how it works. Date/time are stored as what we call timestamp which is the number of seconds since 1970-01-01. So basically, I take timestamp for today 06:00 + 12 3600, and then for the night 18:00 + 12 3600 (it's oversimplified but you get the idea).

Anyway as i don't have the updated app i can't check if it's correctly displayed or not

In v3.004, night temperature is the min. temp of the day as reported by MF (which is probably the night before). This behavior has changed as explained before.

RemyL commented 3 years ago

In v3.004, night temperature is the min. temp of the day as reported by MF (which is probably the night before). This behavior has changed as explained before.

Ok but does accuweather works on the same way ? If not this would mean that we could not use tomorrow notification. Because when we use this what we want to see is tomorrow morning (so today overnight) value and tommorow day value (tommorrow day value) because we don't care about next night (you can check my new issue)

papjul commented 3 years ago

Ok but does accuweather works on the same way ? If not this would mean that we could not use tomorrow notification. Because when we use this what we want to see is tomorrow morning (so today overnight) value and tommorow day value (tommorrow day value) because we don't care about next night (you can check my new issue)

No, I already explained that AccuWeather provides two half days directly from the API, check my other messages regarding how it works.

AccuWeather will provide the overnight min temperature as "night temperature" just as what MF provider does.

When you wake up at 07:00 AM and see a notification for today, you want to know how the overnight will be, not how the previous nighttime went, which is already in the past and no longer a forecast. And if the "today notification" shows the overnight, that's what the "tomorrow notification" should do for consistency.

RemyL commented 3 years ago

Ok but does accuweather works on the same way ? If not this would mean that we could not use tomorrow notification. Because when we use this what we want to see is tomorrow morning (so today overnight) value and tommorow day value (tommorrow day value) because we don't care about next night (you can check my new issue)

No, I already explained that AccuWeather provides two half days directly from the API, check my other messages regarding how it works.

AccuWeather will provide the overnight min temperature as "night temperature" just as what MF provider does.

When you wake up at 07:00 AM and see a notification for today, you want to know how the overnight will be, not how the previous nighttime went, which is already in the past and no longer a forecast. And if the "today notification" shows the overnight, that's what the "tomorrow notification" should do for consistency.

Ok but when you use "tomorrow notification" at 21h what you want the notification to show is next morning and then day value no ? (That would mean today overnight [more other as this is the min value from today 18h to 24h and tomorrow from 24h to 5h59 i think that this would definitly show how will be the next morning] and tomorrow day value) But ok i think that it's only a point of view here i may be wrong

papjul commented 3 years ago

I can understand the point but it has nothing to do with MF provider, it also applies to AccuWeather.

Basically, the notification is this way:

If there is something to improve, maybe it could be to split notifications this way:

In that case, you should open a separate issue.

RemyL commented 3 years ago

I can understand the point but it has nothing to do with MF provider, it also applies to AccuWeather.

Basically, the notification is this way:

* Today forecast: today daytime + today overnight

* Tomorrow forecast: tomorrow daytime + tomorrow overnight

If there is something to improve, maybe it could be to split notifications this way:

* Today forecast: today daytime

* Overnight forecast: today overnight

* Tomorrow forecast: tomorrow daytime

In that case, you should open a separate issue.

Yes i will