Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings should be visible before they actually start #21

Closed
schumi2309 opened this issue Apr 15, 2024 · 6 comments · Fixed by #28
Closed

Warnings should be visible before they actually start #21

schumi2309 opened this issue Apr 15, 2024 · 6 comments · Fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@schumi2309
Copy link

schumi2309 commented Apr 15, 2024

hi,
I am on the latest version, I am in Belgium, in Liège, where, for the moment, there is a yellow alert in the wind, but the alert sensor always tells me "secure"
Is there anything to change or modify or is it a bug?

Capture d’écran 2024-04-15 à 11 33 24

Capture d’écran 2024-04-15 à 11 34 24

Capture d’écran 2024-04-15 à 11 37 18

there is indeed alert, so why tell me “secure”??

Capture d’écran 2024-04-15 à 11 41 24

@schumi2309 schumi2309 added the bug Something isn't working label Apr 15, 2024
@jdejaegh
Copy link
Owner

Hi, that's not a bug but I understand what you mean.

The alert starts at 2PM today (see starts_at: "2024-04-15T14:00:00+02:00") so the sensor will become "unsafe" at that time until ends_at (6PM).

The warning details are there because they are already available but the status is not active as the warning starts at 2PM.

You are not the first one to be surprised by the behavior, I'll consider adding a sensor "next warning starts in" showing when is the next warning starting. This way, people can create automation based on that.

@schumi2309
Copy link
Author

schumi2309 commented Apr 16, 2024

ok, I understand. I'll see what I can do to find a solution.
On the other hand, I often lose the radar camera and especially the rain forecast information, which is listed under the "hint" section (see photo). and when that happens, I no longer have the video from the camera. So, it’s useless!
Capture d’écran 2024-04-16 à 08 33 27

I created a sensor for rain information, and here is the result, works then, nothing!

Capture d’écran 2024-04-16 à 08 40 06

and it's common during the day, at certain times, I have the information, then, 10 minutes later, nothing.
is this a server problem?

@jdejaegh
Copy link
Owner

I also noticed that the API of the IRM times out several times per day. When this happens, the integration cannot refresh the data and Home Assistant shows the sensors as 'unavailable' until a successful refresh. Those API timeouts may explain why you don't always get the camera hint.

To check if this the API timing out, you can open the logs of your Home Assistant (Settings > System > Logs) and look for those messages:

Error fetching IRM KMI weather data: Error communicating with API: Timeout error fetching information
Error fetching IRM KMI weather data: Error communicating with API: Error fetching information

When this happens, all the sensors of the integration go 'unavailable' for about 7 minutes (the polling interval).

I'll check if I can improve the integration to handle the timeouts when I have some time.

@jdejaegh
Copy link
Owner

jdejaegh commented Apr 16, 2024

I created a separate issue to track the timeouts issue.

I keep this issue to track the main question here: the warning not being shown ahead of time but only when it is truly active.

To investigate:

  • Create a sensor with the start time of the next warning

@schumi2309
Copy link
Author

The only one I see is this:

Capture d’écran 2024-04-16 à 19 52 48

@jdejaegh jdejaegh changed the title problem alert Warnings should be visible before they actually start May 12, 2024
@jdejaegh jdejaegh self-assigned this May 12, 2024
@jdejaegh jdejaegh added enhancement New feature or request and removed bug Something isn't working labels May 12, 2024
@jdejaegh jdejaegh linked a pull request May 12, 2024 that will close this issue
@jdejaegh
Copy link
Owner

The changes related to the warnings have been merged into main. I tested the feature with unit tests but I'll wait until a real warning comes to see it in action before releasing it.
The feature basically adds a timestamp sensor which show the start time or the next warning (or None if no warning are scheduled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants