home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.38k stars 30.64k forks source link

Met Eireann weather integration showing "sunny" at night #125223

Open goodlucknow opened 2 months ago

goodlucknow commented 2 months ago

The problem

As per title, weather integration is showing "sunny" at night time, when I believe it should show "clear night". Attempting to browse through the code shows it in the condition map ATTR_CONDITION_CLEAR_NIGHT: ["Dark_Sun"]. And I believe Met Eireann's API differentiates, at least in the notes shows Sun: 1, Dark_Sun: 101. I haven't been able to test the API output at the time I've observed the issue but I do know their own app & site correctly show night time conditions.

What version of Home Assistant Core has the issue?

core-2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Met Eireann

Link to integration documentation on our website

https://www.home-assistant.io/integrations/met_eireann

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @dylangore, mind taking a look at this issue as it has been labeled with an integration (met_eireann) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `met_eireann` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign met_eireann` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


met_eireann documentation met_eireann source (message by IssueLinks)

goodlucknow commented 2 months ago

I have had a look at the XML returned from the API, and I believe they might be returning incorrect states, i.e. returning <symbol id="PartlyCloud" number="3"/> at 3:00a.m. instead of Dark_PartlyCloud and 103 as per their own API notes. I can't find a specific example for "Sunny" condition right now due to weather, but I also can't find a single instance of a "Dark_" symbol or number being returned on the forecast currently available to me.

If this is the case, might I suggest using the homeassistant sun component state to manage and map the states within the integration? I can see where another integration has done this here to handle similar.

I am not sure how Met Eireann's own site & app are handling it but it does display day/night conditions correctly there, even if the API does not.

goodlucknow commented 1 month ago

also going to attempt to raise this with Met Eireann and see if they can fix their output, not going to hold my breath there.