Motion heat map

I track the position of my cats with an airtag and display their position in a map card:

It would be nice to have a “heat map” with more color in proportion to the time the cat stays in the same position.

Something like this (position of Messi in a soccer field)

messi

2 Likes

Start by sharing how do you spy on your cat :smiley_cat:

2 Likes

Sure:

  • Both of them have an Apple AirTag (battery for one year, cheap and pretty small)

  • Apple does not share information on Items (only Persons and Devices): with the iCloud integration you not get the position.

  • So you need an Apple device with FindMy to track them (the application caches the coordinates on disk)

  • I then use FindMySync to push this cached information to Home Assistant (FindMySync - Martin Pham). It will automatically generate entries for known_devices.yml as

findmy_5520090377EF4B24A70C82C73D8C2519:
  name: "Lisi"
  mac: FINDMY_55200903-77EF-4B24-A70C-82C73D8C2519
  icon:
  picture:
  track: true
  • You then have the cats as devices and you can assign them to persons
  • And finally the map
type: map
entities:
  - entity: person.lisi
  - entity: person.mia
title: Gatte ultime 24 ore
default_zoom: 17
hours_to_show: 24
dark_mode: true
2 Likes

I do not know about any custom card which can be used here.

What I did in a similar case:

  1. Assume an object (person, car, pet) is moving in some area.
  2. Divide this area to small zones (50 m radius or less):
  3. For each zone use same entity_id as a friendly_name (this is important).
  4. Create history_stats sensors for every zone.

Now you can see how much time an object spend in these zones.
Very cumbersome - but it works.
Ofc a location tracking should be precise)))

1 Like

Thanks. Then I should find a way to display the information (time per zone) in a map

You will have to add attributes “latitude”, “longitude” to these history-stats sensors via customization - then just add these sensors on a map with this option “label_mode = state”.

Since zone entities should be also added on a map to display a “circle” - you will have to:

  1. Specify a blank icon for each zone (mdi:blank).
  2. Add those HS-sensors after zone entities - to make these sensors be shown ABOVE zones.

Why do you allow your cats to roam like that? Not good for the cat.

You are kidding, right?