Additional controls on Map card history trails

Love the new hours_to_show option in the map card, was looking for that for a while. I had set up a dashboard in Grafana for it but very glad to just use native HA for this since I have too many addons already :grin:

Not sure what’s already in the works for enhancements here but I would really like to see the following:

  1. Labels on the points in the trail. Like perhaps if you hover over the dots it pops up info on the timestamp and exact location collected. Or could show a small timestamp next to each dot always but that might make the UI too busy
  2. Controls at the top to allow you to change the hours to display without re-entering config. And perhaps pick a range of hours to display? So I can show “8AM to 10AM on Wednesday” for instance instead of just “X hours ago until now”
  3. On hover of a person/tracker, hide the others paths persons/trackers and their paths. Or on click. Basically just ability to focus on one entity at a time.

Anyway thanks for the great feature!

Totally agree with @CentralCommand and adding:
3.5. maybe also allow selecting the persons to show/hide as with the graph card - clicking a label un/hides the entity. the labels will also detail the color of each person.
4. having a route appear also on the more info popup card that pops when clicking en entity

and thanks for a great feature as is :wink:

Would also be nice to pick the color of each persons trail.
Trying to figure out how that is done now as I updated and someone changed colors. Super confusing since we are all used to another color for …over a year now?? Not exactly sure how long, but a long time.

1 Like

@Qua3952
Your point 4 can be kinda simulated with a custom popup card with the help of browser_mod, something like this:

type: entities
entities:
  - entity: person.john_doe
    tap_action:
      action: fire-dom-event
      browser_mod:
        command: call-service
        service: browser_mod.popup
        service_data:
          title: John Doe
          deviceID:
            - this
          card:
            type: vertical-stack
            cards:
              - type: history-graph
                entities:
                  - entity: person.john_doe
              - type: map
                entities:
                  - entity: person.john_doe
                hours_to_show: 24

@danbutter
You can’t change trails colors per person with this method, but you can do it for all the trails with the help of card-mod style, which may be useful if you have only one person on the card:

type: map
entities:
  - entity: person.john_doe
hours_to_show: 24
card_mod:
  style:
    ha-map$:
      .leaflet-overlay-pane: |
        path {
          fill: red;
          stroke: red;
        }

On topic, I totally agree and see original points 1 and 3 absolutely crucial and hope developers will find time and knowledge to implement them.

3 Likes

I am using HA 2022.11.1 and have made the following adjustments to the above yaml code to get the map changes to work:

type: map
entities:
  - entity: person.john.doe
hours_to_show: 24
card_mod:
  style:
    ha-map$:
      .leaflet-pane: |
        path {
          fill: red;
          stroke: none;
        }
      .leaflet-overlay-pane: |
        path {
          fill: red;
          stroke: none;
        }

Note:

  • stroke: none - Hide the track lines.
  • stroke: red - Display the line in red.
  • stroke-width: 1; - Change the line with to 1px (it normaly is 3px)

Attempted to implement #1, submitted a pull request:

3 Likes

Hi, this is very cool, but does it exist a way to make the point bigger?
I want to plot positions without lines, but with “dots” of position larger (it will rappresent portions of garden in which lawnmower has cut the grass)…
also another thing that i need is to avoid “browsing” map, i need to make a static position 'cause the lawnmower work only on my garden.