From REST to Map Card

Hey all,

I have a few questions that may require a bit of creativity. From a high level what I am trying to do is get a map card on my Lovelace showing the locations of a few devices received from a REST sensor.

Here is where I am at so far:

  • I have a rest sensor that pulls in a handful of device locations, each one as a separate JSON entry.
  • I’ve been able to successfully map these to template sensors, such that I have several sensor, each with either the long or lat. e.g. sensor.obj_1_lat would be 32.0182

Now the harder part, how to get this onto a map card. From what I’ve read is seems like the only way to do this is the following:

  • Create a script that calls the “device_tracker.see” service and hardcode the gps coordinates
  • Run this over and over so it continuously updates
  • Then I should be able to use the default map card

Now, my questions are:

  1. Is this really the best way to be doing this?
  2. If so, I am struggling with finding the syntax to get the values of my two sensors (one for long, one for lat) into the [lat ,long] format required by the device_tracker.see service
  3. I’m not familiar with scripts, how do I get this to run every 5 minutes?

Thanks all!