xlcnd / meteoalarmeu

A 'custom component' for Home-Assistant for Weather Warnings from meteoalarm.eu
GNU General Public License v3.0
20 stars 3 forks source link

Entity not updating by itself #19

Closed MrBartusek closed 3 years ago

MrBartusek commented 3 years ago

For some reason, this integration always show that there are no alerts after adding it or restarting HA

Steps to reproduce:

  1. Add integration and set it to any region with a issued alert
  2. Check Entity -> No alert
  3. Update entity via Home Assistant Core Integration: Update entity
  4. Check Entity -> Alert available
  5. Restart Home Asistant
  6. Check Entity -> Alert disappeared again
xlcnd commented 3 years ago

Hi,

The identity updates, it takes 30m to do it, as is told in the documentation!

You can mitigate this by adding the following automation:

- alias: Update weather warnings (special cases)
  trigger:
  - platform: homeassistant
    event: start
  - platform: state
    entity_id: binary_sensor.meteoalarmeu
    to: unavailable
    for: 00:10:00
  action:
  - service: homeassistant.update_entity
    entity_id: binary_sensor.meteoalarmeu
MrBartusek commented 3 years ago

Hey @xlcnd, Thanks for reply!

Unfortunately, the automation that you send doesn't work as expected. homeassistant -> start event fires before sensor initializes (i guess) and thus, it's still is stuck in that limbo state without warnings. The second condition doesn't make sense in my situation because the sensor is not unavailable but it is off as there were no warnings.

I think there still would be a way to resolve that with automation but that's not a proper way to do it. None of my integrations has that issue so it makes me think there is a problem with this integration. It reports the state of 0 warnings when it initializes and then the user needs to wait 30 minutes for it to get valid data? It makes no sense to me.

xlcnd commented 3 years ago

In my test installation the automation works, but the way HA starts doesn't garanties predictability...

In relation to the special behaviour of this integration, well all integrations that rely on the 'normal' HA updating have this behaviour!

Anyway, I have no simple solution... and if you cannot bare this limitation, I advise you to delete the integration.