Hi All!
Doing well with the automation, but I’ve the following issue.
I had device tracking working van NMap and that worked pretty good. But because there where some times Nmap got it wrong I combined it with Ping. So now I have two device trackers and that works great!
However… I made a template sensor so I could combine the two trackers, so far so good. But now I have a badge with the statement “Home” or “Away” in it. Is it possible to fill the badge with a photo or with an icon?
Yes, I’ve searched the forum and internet, but I can’t find an answer. Hope you guys will point me in the right direction!
Kind regards,
Eltjo
silvrr
November 13, 2017, 6:26pm
2
take a look at a mdi icon or an entity picture
Thanks for the quick response, but that doesn’t work with a “template sensor”?
Do I have to change it to a template binary sensor?
silvrr
November 13, 2017, 6:41pm
4
Customize works with any entity. I use mdi icons on a number of my template sensors.
If you want to change the icon based on the status look at a template icon. (scroll down to “change the icon” in the link below)
Hi,
I tried it, but that won’t give the right response. I still have a badge with the word “Home” in it and not an icon.
This is what I have written under sensors (template):
eltjo_thuis:
friendly_name: 'Eltjo'
value_template: '{{ states("group.eltjo") }}'
icon_template: >-
{% if is_state("group.eltjo", "home") %}
mdi:weather-sunny
{% else %}
mdi:weather-night
{% endif %}
Any thoughts?
Well, I got it so far that I have a badge with custom text (dutch) for home (thuis) of away (weg).
To make it nicer I made the name of the person as a unit of measurement so that name comes neatly in red under the badge:
eltjo_thuis:
friendly_name: ' '
unit_of_measurement: 'Eltjo'
value_template: >-
{% if is_state('group.eltjo', 'home') %}
Thuis
{% else %}
Weg
{% endif %}
igpels
(Luke)
December 12, 2017, 9:02am
7
I was trying to solve the same problem. I think I found a good way using MQTT and MQTT device tracker component.
Not sure if you are still interested, but I just figured out a way to do this. You can create this by using MQTT device tracker component. Set up MQTT first and then add the following to your config.
device_tracker:
- platform: mqtt
devices:
paul: 'location/paul'
theresa: 'location/theresa'
This will create a tracker that allows you to set state with a “home”, “away” message in the red box and you can add a picture in the known_devices.yaml file.
And your autom…