Code Monkey home page Code Monkey logo

Comments (16)

nagyrobi avatar nagyrobi commented on August 24, 2024

Seems like the component is not looking at the actual alerts but at the probable alert forecasts for today's date ??
kép

This is confusing...

from met_alerts_hu.

amaximus avatar amaximus commented on August 24, 2024

As per below description there are alerts per region and sort of alerts per county:

https://www.met.hu/idojaras/veszelyjelzes/omsz_veszelyjelzo_rendszere/

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

That part is OK, I'm talking about

  1. current alerts now and a few hours in future (no past events):
    kép

  2. forecast for today all day (=monday):
    kép

  3. forecast for tomorrow (=tuesday):
    kép

  4. and so on for 2 more days.

The component is erroneously pulling data for 2) while it should pull data for 1).
The data set for 2) is less important for HA use case, as it is intended to see the alerts for the entire day. By the end of the day it's not event true. It still shows very high temperature 20 minutes before midnight which is obviously not true anymore.

The data for 1) are much better as they follow the meterorogical events in real time.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

Thinking it over a little bit it could contain all the information...
Something like the real forecasts (just to follow HA's standards, below just a mockup):

alerts:
  - level: '1'
    type: Zivatar
    icon: mdi:weather-lightning-rainy
  - level: '2'
    type: Hőség
    icon: mdi:weather-sunny-alert
dominant_met_alert_value: 2
dominant_met_alert: Hőség
updated: '2021-06-22T06:00:00+00:00'
nr_of_alerts: '2'
friendly_name: Meteorológiai riasztás
attribution: Data provided by met.hu
forecast:
  - datetime: '2021-06-22T06:00:00+00:00'
    level1: 1
    type1: Zivatar
    icon1: mdi:weather-lightning-rainy
    level2: 2
    type2: Hőség
    icon2: mdi:weather-sunny-alert
    nr_of_alerts: 2
  - datetime: '2021-06-23T06:00:00+00:00'
    level1: 1
    type1: Zivatar
    icon1: mdi:weather-lightning-rainy
    level2: 2
    type2: Hőség
    icon2: mdi:weather-sunny-alert
    nr_of_alerts: 2
  - datetime: '2021-06-24T06:00:00+00:00'
    level1: 1
    type1: Zivatar
    icon1: mdi:weather-lightning-rainy
    level2: 2
    type2: Hőség
    icon2: mdi:weather-sunny-alert
    nr_of_alerts: 2
  - datetime: '2021-06-25T06:00:00+00:00'
    level1: 1
    type1: Zivatar
    icon1: mdi:weather-lightning-rainy
    level2: 2
    type2: Hőség
    icon2: mdi:weather-sunny-alert
    nr_of_alerts: 2

So the main part should contain data for 1) (the current/actual state), and under forecast you could locate the data for 2) - 5) (like you do it in fkf).

from met_alerts_hu.

amaximus avatar amaximus commented on August 24, 2024

Please read the first two paragraphs from 'Fontos tudnivalók' at https://www.met.hu/idojaras/veszelyjelzes/omsz_veszelyjelzo_rendszere/ . This makes clear to me that alerts (https://www.met.hu/idojaras/veszelyjelzes/index.php?c=a) and special conditions from the next 0-24 hours (https://www.met.hu/idojaras/veszelyjelzes/index.php?c=b) should be handled in a similar way.

However please feel free to fork my repo and modify the code as per your needs.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

Ok... I was just giving suggestions sorry didn't meant to offend.
Figyelmeztető előrejelzés is one thing (forecast) while riasztás is another thing (alert). The map on their website clearly differentiates the two, and it's also plain to see that for riasztás they have the region_ids, while for figyelmeztető előrejelzés only larger areas county_ids are available...

Unfortunately the original problem still remains. If I look at the map now, this is what I see:

kép

And this is what's in the sensor attributes:

kép

Config didn't change:

- platform: met_alerts_hu
  name: 'Meteorológiai riasztás'
  region_id: 101

This is confusing, as I'm not interested in any information about the larged county 13, just for the info belonging to my region 101. That's also the reason I don't want it in my config either.

from met_alerts_hu.

amaximus avatar amaximus commented on August 24, 2024

You were not offending, thus no problems.

You have to understand that the sensor combines the alerts (from Riasztás tab https://www.met.hu/idojaras/veszelyjelzes/index.php?c=a) with the special meteo conditions from the next tab which is sort of 0-24 forecast for alerts (https://www.met.hu/idojaras/veszelyjelzes/index.php?c=b) which do not have regular alerts (as described in https://www.met.hu/idojaras/veszelyjelzes/omsz_veszelyjelzo_rendszere/).

In fact both sources reflect probabilities of those meteo conditions on a wider geographical region (e.g. alerting on thunderstorm, the thunderstorm can hit one district but might avoid the neighbouring district).

With you latest update on the comment above I see your point. I'll modify the code to discard the county based alert/forecast or whatever we call it if not set instead of defaulting to a specific value and pulling data for it regardless that a user is interested in it or not.
In fact that's a good improvement proposal making the pulled data flexible based on the user needs.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

You're great, thank you.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

the sensor combines the alerts

That's what was not clear for me.
I don't really think this is a good idea, because if you look at the screenshots in the discussion it would be useful for others too that the actual alerts could be separated from the forecasts. The alert is something like the current weather state or current temperature, while the forecast is shown separately. I could add little warning icons separately for each warning type in the forecast lines, for the upcoming days etc...
But anyway, that's a different product, I understand that.

from met_alerts_hu.

amaximus avatar amaximus commented on August 24, 2024

Version 2.1.0 made the special memteo conditions optional. They will be shown only if count_id is specifically defined.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

Thank you.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

You have to understand that the sensor combines the alerts (from Riasztás tab https://www.met.hu/idojaras/veszelyjelzes/index.php?c=a) with the special meteo conditions from the next tab which is sort of 0-24 forecast for alerts (https://www.met.hu/idojaras/veszelyjelzes/index.php?c=b) which do not have regular alerts (as described in https://www.met.hu/idojaras/veszelyjelzes/omsz_veszelyjelzo_rendszere/).

In fact both sources reflect probabilities of those meteo conditions on a wider geographical region (e.g. alerting on thunderstorm, the thunderstorm can hit one district but might avoid the neighbouring district).

Here's an explanation why your approach to combine the two is incorrect:
https://telex.hu/belfold/2021/07/13/omsz-figyelmeztetes-riasztas-meteorologia-hosegriado-idojaras
https://www.facebook.com/orszagosmeteorologiaiszolgalat/posts/3926555147420284

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

I still think that they should also appear separately in the attributes of the entity, and anyone can process them in a later step as they want.

  • current alerts
  • forecast for today
  • forecast for today +1
  • forecast for today +2
  • forecast for today +3
    (like fkf is)

from met_alerts_hu.

amaximus avatar amaximus commented on August 24, 2024

Recent version 2.3.0 makes region_id optional and with no default value to allow handling weather alerts and forecasts independently.

If you don't want to combine the two infromation into one sensor, define two sensors, one with region_id set (for weather alerts) and one with county_id set (for forecasts).

Please get back to me with results.

from met_alerts_hu.

nagyrobi avatar nagyrobi commented on August 24, 2024

I am able to differentiate this way the alerts from the forecasts for today.
But how about the next days?

from met_alerts_hu.

amaximus avatar amaximus commented on August 24, 2024

Meteorology is not an exact science, therefore forecasts on special conditions for couple of days in advance are very unreliable. That's why they were not included in this integration, besides keeping the integration simple.

Feel free to fork this repository and modified it according to your needs.

from met_alerts_hu.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.