Danik
(Daniel)
February 18, 2019, 7:36am
1
I am using google map device tracker, and i want to create a card with device tracker and device tracker Attributes in same card, such as:
State
Battery level
Battery charging
This is the entity:
1- How to add the Attributes parameters ?
2- Which card to use ? (lovelace)
3- I try to create a sensor using this code: but i get error:
platform: template
sensors:
phone_battery:
friendly_name: ‘Phone Battery’
value_template: ‘{{states.device_tracker.google_maps_000000000000000000000.attributes.battery_level | round}}’
unit_of_measurement: ‘%’
Jardiamj
(Jardi Martínez Jordan)
February 18, 2019, 8:07am
4
Your problem might be in the formatting of your template sensor, I can’t really tell if the formatting is correct by looking at that picture but it should look like this:
- platform: template
sensors:
phone_battery:
friendly_name: Phone Battery
value_template: '{{states.device_tracker.google_maps_000000000000000000000.attributes.battery_level | round}}'
unit_of_measurement: '%'
Give that a try.
Danik
(Daniel)
February 18, 2019, 8:49am
6
The issue with the error was solved, tnx to @Jardiamj for the help!
the solution:
The block right under “- platform: template” wasn’t indented, the whole block needed to be moved 2 spaces to the right