Features Wishlist

Buienradar animated GIF map

HeronimonimoSuggested this wish ·

What would you like to add

Have a weather radar map on the display would be usefull. I tried using the camera feed from the Home Assistant Buienradar integration, but that resulted in a still map due to the way the camera feed is refreshed.

It seems the HA integration takes this from an animated GIF url: url = ( f"https://api.buienradar.nl/image/1.0/RadarMap{self._country}" f"?w={self._dimension}&h={self._dimension}" )

How this relates to Home Assistant

Pictures, mockups, or examples

No response

Before submitting

  • I searched the existing issues and this has not already been requested

Originally shared on GitHubOriginal authors and dates are preserved.

View original

Discussion 1

Add a comment
Heronimonimo

What I want to build: a rain radar plugin with a timeline. The tile shows the current radar picture. Tapping it opens a card with a timeline bar, and tapping the bar steps through past and forecast frames (on_tap + tessera::tap_point() → ui::set_picture).

Source: the NL Weather (KNMI) integration has one camera entity that serves an animated GIF. It has 19 frames: 6 past ones (−60 min) and 13 forecast ones (up to +120 min), every 10 minutes, each with its time printed on it. camera.buienradar also serves an animated GIF. The KNMI API key stays in Home Assistant, so the plugin needs no network permission and no secrets.

What blocks it today:

plugin_pictures.HA_PICTURES allows /api/image/serve/, /api/image_proxy/ and /local/, but not /api/camera_proxy/. A camera’s entity_picture is therefore refused (“not an address the plugin may show”). tile_art.layer opens the picture with Image.open and always paints frame 0. For a radar loop, that’s the oldest frame.

What I’m asking for (two small, generic changes; neither names a plugin):

Add /api/camera_proxy/ to HA_PICTURES, with the same rules as the other Home Assistant pictures: only for a tile or card of an entity (of_entity), fetched with the app’s own token. Home Assistant changes the camera token every 5 minutes, so the address changes and the 6-hour cache by address doesn’t hold an old picture. A frame selector on a picture address: #frame=N, 0-based, with negative numbers counting from the end (#frame=-1 is the newest) and out-of-range numbers clamped. Pictures.fetch caches by the address without the #frame part, so all frames come from one download. Only the painting step picks the frame (source.seek(n) when getattr(source, 'is_animated', False)). An address without #frame works exactly as it does today.

Docs and API: the line on where a picture may come from (FIRMWARE_API.md, “Pictures on a tile”), the pictures row in MANIFEST.md, and a minor bump of PLUGIN_API (0.15). That way a plugin that uses this won’t install on an older app.

Tests: allowed() with a camera_proxy path, both for a tile of an entity and for one without. Also layer() with a small 3-frame GIF and #frame=0, #frame=-1 and #frame=99.

Possible issue: the KNMI GIF can be around 1 MB, which may matter if the Home Assistant picture route has a size limit.

I’m happy to make the plugin itself and publish it to tessera-plugins once this is in.

Add your thoughts, a screenshot or a useful link.

Markdown & basic HTML
Paste or drop images · URLs on their own line become previews0 / 10,000
Create your account to join in

We need a verified email address to reach you about your contribution. Your address stays private.

Continue with GitHub

Your draft stays in this tab. Return here after verification.