bremor / bureau_of_meteorology

Custom component for retrieving weather information from the Bureau of Meteorology.
MIT License
190 stars 31 forks source link

Continuing issue with "Clear Night" during the day #163

Closed atyndall closed 10 months ago

atyndall commented 1 year ago

I'm experiencing the issue described in #74, in that the current forecast status seems to be timeshifted into the future, indicating that the forecast is "Clear, night", even though it is 3pm currently.

I'm located in Perth which is 3 hours behind the eastern states, so it does smell like some sort of timezone handling issue, as "Clear, night" is the forecast later in the evening.

I've checked the BOM website and app for my weather station, and neither of them are showing "Clear, night" as the current conditions (they're both "Sunny"). Suggests maybe there is something going on in the extension code?

Here are some API outputs: https://gist.github.com/atyndall/91f81c5fe5311070e48f5fca2bf35137

My dashboard:

Screen Shot 2023-01-08 at 2 54 11 pm Screen Shot 2023-01-08 at 2 54 21 pm

BOM Website:

Screen Shot 2023-01-08 at 2 53 09 pm

BOM App:

Screen Shot 2023-01-08 at 2 53 09 pm
atyndall commented 1 year ago

Captured some more information from another occurrence. Night seems to start around 2pm?

Screen Shot 2023-01-15 at 2 12 25 pm Screen Shot 2023-01-15 at 2 12 17 pm
flybrys commented 1 year ago

I'm getting the opposite, where it says sunny during the night

omad commented 1 year ago

@atyndall That's really curious. Is it still happening? From your last screenshot it looks like UTC time is being used instead.

This component converts the UTC times from the BoM API into the timezone also available from the BoM API for your configured location (available from e.g. https://api.weather.bom.gov.au/v1/locations/qd66j8/).

Things to check:

atyndall commented 1 year ago

Hi @omad,

It's unfortunately difficult to determine if it's still happening with the forecast, as with the history I have available currently, it has been consistently raining, so there has been no "Clear, night" forecast for a while.

I have observed some other interesting strangeness. Around the day boundaries there appear to be "unknown" data gaps that are of inconsistent timing and length. I wonder if that is related.

Screenshot 2023-06-08 at 2 32 22 pm

Screenshot 2023-06-08 at 2 32 27 pmScreenshot 2023-06-08 at 2 32 32 pmScreenshot 2023-06-08 at 2 32 36 pm Screenshot 2023-06-08 at 2 34 26 pmScreenshot 2023-06-08 at 2 34 42 pm

What timezone do you have set in Home Assistant (Settings -> System -> General).

Screenshot 2023-06-08 at 2 27 48 pm

Seems to be correctly set to my TZ

Are the other dates within Home Assistant that are wrong?

Not that I've observed. All my other sensor logging seems to be aligned correctly with my timezone.

Are there other dates from this Integration that are wrong? (I can see that UV warning times are converted... but it's the wrong time of year for that to be apparent).

Screenshot 2023-06-08 at 2 33 56 pm

I did some other spot checking, and from what I can tell at least sunset time is accurate.

How is Home Assistant installed? (HA Operating System/Container/Core) (This could be caused by an environment issue, if the TimeZone database is missing or faulty)

It was a while ago I believe it's Home Assistant Core installed on a Debian VM;

atyndall@homeassistant:~$ uname -a
Linux homeassistant 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
omad commented 1 year ago

Hi @brywithawhy

I'm getting the opposite, where it says sunny during the night

That could be the same issue I'm getting, see https://github.com/bremor/bureau_of_meteorology/issues/177 for details.

Makin-Things commented 10 months ago

This is a BoM problem. The integration only makes available the data they publish.

atyndall commented 10 months ago

@Makin-Things I don't think this is a particularly reasonable response.

At all times that I have detailed, the BOM website and app (which I understand use the same API that the integration uses) have shown the accurate information. This suggests that the bug lies in this extension's interpretation of BoM's API, rather than some defect in the data they publish.

Otherwise how could the BOM website and app show the correct "Sunny" forecast while this extension shows something else?

Makin-Things commented 10 months ago

Firstly the BoM website doesn't use the same api, it is only used by the mobile app. The BoM do not document the api since they consider it to be a private api that nothing other than the mobile app is permitted to use (we ignore that and reverse engineered pretty much everything). If you feel like spending time and figuring it out please do and submit a PR. Unfortunately none of the major contributors have the time to commit.