This is the automation I have, once run, you will see a discovered device in known_devices.yaml
and you can use it as any other device_tracker
- alias: Car Tracker
trigger:
- platform: state
entity_id: sensor.car_latitude, sensor.car_longitude
action:
- service: device_tracker.see
data_template:
dev_id: car
host_name: Car
gps:
- "{{ states('sensor.car_latitude') }}"
- "{{ states('sensor.car_longitude') }}"
1 Like
Has this service changed in the last two years? I canāt get a new sensor created with this automation:
alias: Device Tracker Update Person1
description: ""
trigger:
- platform: state
entity_id:
- sensor.location_person1
condition: []
action:
- service: device_tracker.see
data:
dev_id: person1
gps: "service: device_tracker.see
data:
dev_id: person1
gps: "{{ states.sensor.location_person1.state }}"
mode: single
No, mine still works. what is the state of
ā{{ state_attr(āsensor.person1_iphone_geocoded_locationā,āLocationā) }}ā
Ooopsā¦ that was an attempt to try something else because the first attempt didnāt work. Edited above. The state of that sensor is the GPS coordinates from my mobile device. Iāve had a real uphill battle over the last few days. My mobile device_trackers have ceased to work, and Iām trying to implement a work-around.
Just trying to call the device_tracker.see
service doesnāt work for me:
āFailed to call service device_tracker.see. Unknown error.ā My patience with this packed up and left days ago. All of my mobile device_trackers failed simultaneously, and Iāve been trying to figure out a way to get my automations back up & running since.
EDIT: Just tried for āfunā using sample data:
service: device_tracker.see
data:
dev_id: THIS_BS
gps: [51.509802, -0.086692]
Have a look at mine above itās a bit different to that
Yes, it is. Iām using a single entity for both latitude and longitude, which should work.
Iāve also split latitude and longitude into separate entities and done it similar to yours. This:
service: device_tracker.see
data:
mac: FF:FF:FF:FF:FF:FF
dev_id: person1
host_name: Person1
location_name: home
gps:
- "{{ states('sensor.location_person1') }}"
- "{{ states('sensor.longitude_person1') }}"
ā¦doesnāt work either, even now that I have device_tracker.person1
created.
Have you tried with data_template
Ohh, I see. Yes, Iāve tried this:
- alias: Device Tracker Update Person1
trigger:
- platform: state
entity_id: sensor.location_person1
action:
- service: device_tracker.see
data_template:
dev_id: person1
host_name: Person1
gps:
- "{{ states.sensor.location_person1.state }}"
mode: single
ā¦but it doesnāt do anything.
This updates the device_tracker entity:
service: device_tracker.see
data:
mac: FF:FF:FF:FF:FF:FF
dev_id: person1
host_name: Person1
location_name: home
gps:
- 30
- -20
This does not:
service: device_tracker.see
data:
mac: FF:FF:FF:FF:FF:FF
dev_id: person1
host_name: Person1
location_name: home
gps:
- "{{ states.sensor.location_person1.state }}"
EDIT: Iāve abandoned this pursuit because I got my native mobile device_tracker entities working. I may come back to this in the future, though.