Map-card: a slightly improved map-card

Yes, you can :

I tried something :

- sensor:
    - name: "Map history version"
      unique_id: map_history_version
      state: >
        {{ states('input_datetime.tijdstip_gps_tracker_start') }} -
        {{ states('input_datetime.tijdstip_gps_tracker_einde') }}

  - type: custom:map-card
    card_size: 12
    zoom: 12
    maxZoom: 20
    focus_entity: device_tracker.gps_tracker_auto
    follow_focus: refocus
    history_date_selection: true
    entities:
      - entity: device_tracker.gps_tracker_auto
        size: 40
        color: purple
        history_show_dots: false
        gradual_opacity: 1.4
        display: icon
        history_line_color: purple
        history_start: input_datetime.tijdstip_gps_tracker_start
        history_end: input_datetime.tijdstip_gps_tracker_einde
      - entity: sensor.map_history_version
        display: marker
        size: 0
        color: transparent

But of course I get an error on the map :slight_smile:
image

You should read better… look at the scnreenshot you added … and listen to @Ildar_Gabdullin

Sorry, not awake yet :sweat_smile:

So I can’t select an exact period of history ?

You can use a template to populate the number-helper? Possibly you can use a template sensor state-value too…you need to try that out. Alternative is posisbly the config card templater …

Sorry, missed this feature!

Thank you for sharing this, but it does not fit my requirement.
I use the config-template-card due to the possibility to set a dynamic entity. For my use case, I set the entity used in the cards based on a value of a input_select. I don’t see how to make it work in the same way with card-templater.

card-templater is a similar solution as config-template-card but in some cases one works and the other doesn’t. For selecting entities both do fine (my experience) so try with the card-templater too?

Card-templater accomplishes the exact same thing as config-template-card. The way you “configure” card-templater isn’t the same as config-template-card. Use the example I already gave to use dynamic entities:

Example

If you still don’t understand how to configure it, check card-templater documentation.

Hi
Does anyone know why countries are displayed wrong ie Germany is Deutschland. Language in HA is set to English.
The built in open street map displays names correctly.
Please see screenshot.

Thats is not wrong but actually correct … it is openstreetmap and not the card nor HA, you will see that each country is in its own language, compare e.g. Roma, München … and tbh… I like this ‘feature’.
EDIT: if you want a english map then you will have to find that online and use it as overlay

2 Likes

Has anyone been able to get OpenWeather Weather Maps 2.0 working with this card? If so, can you please share your map card configuration so I can check my URL formatting?

More information about my previous attempts to get this working can be found here and here.

Thank you!

also can check this out

Thanks, I’ll check it out, but on the surface it’s missing weather overlays, right?

This afternoon I will add it

Added! GitHub - cataseven/Google-Map-Card: Google Maps Card for Home Assistant

1 Like

Is it possible to use the tap_action of the tracker entities to zoom in and centre on that entity ?

Hi Nathan,
Is it possible to add a time bar to display the minute-by-minute history?

Better late than never :slight_smile:

But i just fixed it like this because i wanted to do the same.

I made an automation that writes every blitzortung event to a device tracker.

alias: "Bliksem: Update laatste inslag op kaart"
description: Maak of update een device_tracker met de laatste blikseminslag
triggers:
  - event_type: state_changed
    trigger: event
conditions:
  - condition: template
    value_template: >
      {{
      trigger.event.data.entity_id.startswith('geo_location.lightning_strike_')
      }}
actions:
  - variables:
      lat: "{{ trigger.event.data.new_state.attributes.latitude }}"
      lon: "{{ trigger.event.data.new_state.attributes.longitude }}"
      distance: "{{ trigger.event.data.new_state.attributes.distance }}"
  - data:
      dev_id: last_lightning_strike
      gps:
        - "{{ lat | float }}"
        - "{{ lon | float }}"
      gps_accuracy: 1
      source_type: gps
      attributes:
        icon: mdi:weather-lightning
        friendly_name: Laatste Blikseminslag
        distance: "{{ distance }}"
    action: device_tracker.see
mode: queued

Then i used this in the map-card to show the latest strike as an icon and the 2hr history as yellow dots.

  - entity: device_tracker.last_lightning_strike
    display: icon
    size: 20
    color: yellow
    history_start: 2 hours ago
    history_show_lines: false
    history_show_dots: true

Thank you so much, amazing card!

Question: can you “group” markers / display count before you zoom? (like the default map card)

I track roadwork / accidents, etc around me and displaying them on the map.
What I am struggling with is how to make it look less “cluttered”. Tried reducing the size of the icon but does not seem to work for me, so I was hoping to group them instead. Or any other suggestions are welcome :slight_smile:

This is how it looks currently:

type: custom:auto-entities
card:
  type: custom:map-card
  hours_to_show: 0
  default_zoom: 10
  card_size: 5
  display: icon
  size: 12
  circle: auto
  theme_mode: dark
filter:
  include:
    - options: {}
      domain: geo_location
      attributes:
        source: az511
grid_options:
  columns: full
  rows: 12

For reference, this is a screenshot with the default map card, to show what I mean by “grouping”:

Clustering is not supported in this custom card, it is a feature request which was already registered in GitHub repo.