Finally I would like to show the device location on a map in lovelace.
Since I did not find a way to directly use the attributes in a map card, I thought about creating a template sensor. But I did not find any proposals for this.
Not sure if this helps you or not, I have explored both device trackers and sensors with geo coding. The first picture below shows the resulting lovelace maps generated by each type of HA entity, the yaml code for each map is below. From my experience, if you add the attributes with the spelling shown below to a sensor, you can place it on a lovelace map as it shown below. You have different spelling, you might try changing those :
Make a template sensor with the 2 attributes and you should be good to go. Unfortunately you can’t copy and paste this because you’ve burred out the entity_id… which doesn’t make sense by the way. Knowing the entity_id isn’t going to give anyone information about your system that they can use to be malicious.
first of all thanks for your quick and constructive feedback from all of you!
Finally I was looking for a simple solution. @petro, your solution really looks the best and it’s what I already tried before (more or less) … but seems that I had a syntax error somewhere.
Background: I put all my sensors into sensors.yaml, which looks like this:
That’s the old template format. If you copy/paste exactly what I wrote into configuration.yaml, then it’ll work. Do not paste it into the old format as the 2 formats do not work together.
what does “old” or “new template format” mean? Did I miss anything that there are different formats available? Do you have a reference for me where I can learn more about?
BTW: I just got it working with my separate sensors.yaml file which I have included in configuration.yaml. So I would like to keep the template sensors outsourced from my configuration.yaml. The result for my imow sensor looks like this and perfectly works :-).