github Makin-Things/weather-radar-card v3.1.0-beta
3.1.0-beta — Multi-Marker Support

latest releases: v3.1.0-beta3, v3.1.0-beta2, v3.0.2...
pre-release5 hours ago

Multi-Marker Support — Beta

This is a preview release of the new marker system. The config format has changed — see the migration guide below.


What's New

markers[] — multiple map markers

Replace the old show_marker / marker_latitude / marker_longitude fields with a markers list. Each entry is independent and supports its own entity, icon, colour, and tracking settings:

type: custom:weather-radar-card
markers:
  - entity: zone.home         # always-visible home pin
    icon: mdi:home
    color: '#4CAF50'

  - entity: person.john       # follows John when he is the logged-in user
    icon: entity_picture
    track: entity

  - entity: device_tracker.van  # always tracks the van for all viewers
    icon: mdi:car
    color: '#2196F3'
    track: entity

Marker fields

Field Type Description
entity string device_tracker.*, person.*, or zone.* — position updates live on every HA state change
latitude / longitude number Static position (used when entity is not set or unavailable)
icon string default (home SVG), entity_picture, or mdi:icon-name
icon_entity string Entity ID for the picture when icon: entity_picture — auto-detected from entity if blank
color string CSS colour for default and MDI icons (e.g. '#FF5722'). Has no effect on entity pictures.
track entity / true Pan the map to follow this marker
mobile_only boolean Only show this marker on mobile devices
home_radius number Metres within which an entity-based marker is hidden when at home. Default 500. Set 0 to always show.

Live entity tracking

Markers with an entity field update their position on every HA state change. Works with device_tracker.*, person.*, zone.*, or any entity with latitude/longitude attributes.

Track resolution

Set track on one or more markers to auto-centre the map. When multiple markers have tracking enabled, the card picks one winner using this priority order:

  1. track: entity on a person.* whose user_id matches the currently logged-in HA user — highest priority. "I am this person, follow me."
  2. track: entity on any other entity — viewer-independent tracking (e.g. a shared vehicle).
  3. track: true — lowest always-on fallback; overridden by any track: entity match.

Ties at the same priority level log a console warning and use the first marker in the list.

Home suppression

Entity-based markers (device_tracker.*, person.*) are automatically hidden when the entity is at home:

  • If HA reports state: home for the entity, the marker is hidden regardless of GPS accuracy.
  • Otherwise, if the entity is within home_radius metres of the HA home location, it is hidden.
  • Set home_radius: 0 on a marker to disable suppression and always show it.
  • zone.* entities and static lat/lon markers are never suppressed.

Icon colour

Add color: '#hexvalue' to any marker using a default or mdi:* icon to render it in a custom colour. The default home icon switches to an inline SVG so any CSS colour works without extra asset files.

Auto-migration from old config

If your config uses the old show_marker / marker_latitude / marker_longitude / mobile_marker_* fields and has no markers array, the card automatically converts them in memory on load — your existing YAML continues to work without changes. A deprecation warning is logged to the browser console. When show_marker: true is present with no position specified, a zone.home marker is synthesised automatically.


Other improvements since 3.0.1

  • disable_scroll option — disables map pan/drag while keeping pinch-to-zoom active
  • show_scale bug fix — was declared but never wired to the Leaflet scale control
  • useDefineForClassFields: false tsconfig fix — ES2022 target was silently breaking LitElement's reactive properties, causing the card to produce no DOM at all
  • 126 unit tests covering migration, position resolution, track priority, home suppression, and icon rendering

Installation

Copy weather-radar-card.js and the accompanying assets to www/community/weather-radar-card/ and clear your browser cache.

This is a beta release. The marker API is stable but the editor UI for markers is still basic. Please report issues on GitHub.

Don't miss a new weather-radar-card release

NewReleases is sending notifications on new releases.