-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvirtual_device_tracker.yaml
More file actions
47 lines (42 loc) · 1.12 KB
/
virtual_device_tracker.yaml
File metadata and controls
47 lines (42 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
blueprint:
name: Virtual device tracker
description: >
Updates a virtual device_tracker from any entity attribute that returns
[latitude, longitude] (e.g., 'location')
domain: automation
input:
geocoded_sensor:
name: Geocoded location entity
description: Entity with an attribute that returns [lat, lon]
selector:
entity: {}
location_attribute:
name: Attribute name
description: Attribute holding [lat, lon]
default: location
selector:
text:
device_id:
name: Device tracker ID (dev_id)
description: device_tracker.<dev_id> will be created/updated
selector:
text:
mode: single
trigger:
- platform: state
entity_id: !input geocoded_sensor
attribute: !input location_attribute
variables:
eid: !input geocoded_sensor
attr: !input location_attribute
coords: "{{ state_attr(eid, attr) }}"
condition:
- condition: template
value_template: "{{ coords is not none }}"
action:
- service: device_tracker.see
data:
dev_id: !input device_id
gps: "{{ coords }}"
attributes:
source_type: gps