Map-card: a slightly improved map-card

I cant seem to use display: attribute when using the card within auto-entities?

My sensor entities all have an Attribute known as B7 (for diesel cost), display: state works just fine.

Display: state vs Display: attribute

type: custom:auto-entities
card:
  type: custom:map-card
filter:
  include:
    - integration: fuel_prices
      attributes:
        area: Work
      options:
        display: attribute
        attribute: B7
        size: 48

Ive tried a different attribute as well, as i thought maybe it could only handle strings, such as brand or name, and not floats like B7, but none work. With or without quotes around the attribute, etc.
Also, size works just fine, so its just something to do with attribute specifically.

There was a PR:

It was merged, I checked this periodically but did not see working.
Also, there was not a release created since that PR.
May be, only Readme was updated?
Or both Readme and a code were updated - but Release was not created?

Last published release is from 11 months ago, so assume it was just never pushed to a release then… that sucks.

Let’s wait )

1 Like

Is there some way to use templates for entity name?

  - type: custom:map-card
    history_date_selection: true
    entities:
      - entity: >
          device_tracker.my_tracker_{{ states('select.my_select') | lower }}

UPDATE
I made it using custom:auto-entities:

  - type: custom:auto-entities
    card:
      type: custom:map-card
      history_date_selection: true
    filter:
      template: >
        {% set var = states('select.my_select') | lower
        %} {% if var not in ['unknown', 'unavailable', ''] %}
          {{ 'device_tracker.tracker_' ~ var }}
        {% endif %}

Thank you Nathan!

Like Krazykid67 (Jun 2024 post), I’m seeing a “loop” with an added straight line connecting the history starting point (where I was “12 hours ago”) and the history ending point (“now”)

Is no one else seeing this?
Does it require the gradual_opacity option to eliminate this unwanted line?

type: custom:map-card
show_all: false
entities:
  - entity: zone.apt
    size: 50
    focus: false
  - entity: person.self
    history_start: 12 hours ago
    history_end: now
    history_line_color: blue
focus_entity: person.self

From what I remember I got rid of this by using
use_base_entity_only: true

1 Like

BINGO!
You are awesome - thank you for that!

Attaching the revised yaml for future viewers.
The added statement is attached to the entities list, not the focus_entity (as I mistakenly tried first)

type: custom:map-card
show_all: false
entities:
  - entity: zone.apt
    size: 50
    focus: false
  - entity: person.self
    history_start: 12 hours ago
    history_end: now
    history_line_color: blue
    use_base_entity_only: true
focus_entity: person.self

Is it possable to use polylines with this card?

Yes you can use plugins, see here for an example I did

1 Like

I somehow missed your post as I was (till date) looking quite some time for something simple and effective to add area’s of my own making…appreciate your input, thx !!

Would like to thank @nathan.gs! I used this to interate a map from my robomower! :slight_smile:

2 Likes

hi, can or could you please share your yaml?
thanks a lot

Sure,

type: custom:map-card
zoom: 19
card_size: 9
tile_layer_url: https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
tile_layer_options: null
x:  # your x cordinates ->> keeps map centered! otherwise it folows the robot
"y": # your y cordinates
entities:
  - entity: device_tracker.verbauwhede_022330
    history_start: 12 hours ago
    history_line_color: "#00ff00"
    icon: mdi:robot-mower

just discovered this card and really like it! Already customized it somehow to my liking, but I face 2 issues, not sure if related to my config or being a bug. Lets see a screenshot below:

Two issues I have are:

  • Error message at left edge of card. Sometimes it is there, sometimes not. Depending on zoom level it can appear in few, somehow random(?) places of card. Sometimes it appears in places other than previously. No clue what it is and how to get rid of it.
  • Addditional line that connects person being away with my home. On screenshot it is line between my wiffe icon and our house (where my icon is placed). This line is always is redrawn wnen card is refreshed (window reloaded) always poining between person away and home. If window is not redrawn, person can move to new position, but like remain attached to previous position. Window refreshed - moves again to current position. Is it bug? How to get rid of this line?

BTW, here is my config:

type: custom:map-card
history_start: 24 hours ago
theme_mode: dark
tile_layer_options:
  maxZoom: 19
entities:
  - entity: person.dorota_malinowska
    display: marker
    size: 48
    color: red
    z_index_offset: 100
  - entity: person.mirek_malinowski
    display: marker
    size: 48
    color: blue
    z_index_offset: 80
  - entity: device_tracker.audi_q5_position
    display: marker
    size: 48
    color: orange
    z_index_offset: 60
  - entity: zone.home
    display: icon
    size: 32
    focus_on_fit: false
    z_index_offset: 40
    color: green
    circle:
      source: radius

That line typically appears when you add a person entity which is comprised of multiple individual device_tracker child entities. I think you can fix this by adding use_base_entity_only: true to the person entities.

Hi
Has anyone else lost there history line after after upgrading to 2026.4.0
I can’t see any history for any days anymore, even if I scroll to a different day.

This line in the config of map-card doesn’t work after 2026.4.0 update

history_date_selection:true

That’s why my history lines won’t show, it doesn’t use date picker anymore, see the post above.

Can someone else using date picker confirm please.

Here’s my yaml

type: custom:map-card
tile_layer_options:
referrerPolicy: origin-when-cross-origin
history_date_selection: true
card_size: 9.5
entities:

  • entity: device_tracker.google_ma
    gradual_opacity: 0.5
    size: 26
    history_line_color: blue
    use_base_entity_only: true
    circle:
    source: attribute
    attribute: gps_accuracy
    color: blue
    fill_opacity: 0.3
  • entity: device_tracker.google_map
    gradual_opacity: 0.5
    history_line_color: green
    use_base_entity_only: true
    size: 26
    picture: /api/image/serve/f69e5e3d
    circle:
    source: attribute
    attribute: gps_accuracy
    color: green
    fill_opacity: 0.3
    theme_mode: light

Map badges
Since this PR was rejected by HA frontend team due to vague reasons, hopefully ha-map-card would be the first with this feature.
PR proposed.

It is very beta:
– some unsolved issues are there (will be solved soon);
Docs not updated yet - Docs are updated;
even screenshots in PR are used from that mentioned Frontend PR - screenshots in PR are from ha-map-card.

Anyone can try it, constructive observations are welcome.
Possible use-cases & examples are provided in PR description.

Just a small screenshot for one of many possible use-cases:

1 Like

I just discovered this card and am amazed!

However, I cannot seem to get the option position_update_threshold to work.
At home apparently my GPS positioning is very flaky:

This config should not show any movement, but it does:

type: custom:map-card
entities:

  • entity: person.heidi
    position_update_threshold: 5000
    display: icon
    history_date_selection: true

Any idea what I’m doing wrong?