Skip to content

Feed outage is reported as 0 mm/h instead of unavailable #2

Description

@vfpdev

Summary

When the DWD radar feed can't be fetched, the integration reports no rain instead of going unavailable. For automations that act on severe weather (e.g. raising shutters before a hail cell), an outage silently reads as "all clear" — the worst-case failure mode for a safety trigger.

Where

In DWDRadarClient.async_get_data() (custom_components/rain_warner/dwd_radar.py), three outage paths return a current_precipitation: 0.0 payload with an empty forecast instead of raising:

  • _download_archive() returns None on a non-200 response or a network/timeout error → async_get_data() returns the zero payload.
  • An empty/unparseable archive (not frames) also returns the zero payload.

Downstream, severe_weather, rain_imminent, is_raining and the precipitation sensors then actively report "no rain" during the outage, and the entity keeps showing a plausible 0.0, so the outage is invisible to the user too.

Proposed fix

Raise a small RadarUnavailableError on those outage paths instead of returning zeros. The coordinator already wraps client exceptions into UpdateFailed, so the entities would correctly become unavailable and retain their last known value until the feed recovers — no coordinator change needed. Healthy-feed behaviour is unchanged; a genuine dry sky still reports 0.0 from real frames.

I already have a patch ready (plus a regression test for the new path) and can open a PR if you'd like — opening this issue first as the README asks. Happy to adjust the approach.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions