mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
34 lines
1.0 KiB
YAML
34 lines
1.0 KiB
YAML
# Toggle controlling the status of coordinate logging
|
|
input_boolean:
|
|
log_pixel_7_coordinates:
|
|
name: "Log Pixel 7 Coordinates"
|
|
icon: mdi:crosshairs-gps
|
|
|
|
# Automation to handle the actual logging of coordinates
|
|
automation:
|
|
- alias: "Log Pixel 7 Coordinates"
|
|
id: 7e726150-6bd7-40c8-a990-13df987d0fca
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.log_pixel_7_coordinates
|
|
from: "off"
|
|
to: "on"
|
|
|
|
- platform: state
|
|
entity_id: device_tracker.pixel_7
|
|
|
|
- platform: homeassistant
|
|
event: start
|
|
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.log_pixel_7_coordinates
|
|
state: "on"
|
|
|
|
action:
|
|
- action: notify.send_message
|
|
target:
|
|
entity_id: notify.pixel_7_coordinates
|
|
data:
|
|
message: "{{now().strftime('%Y-%m-%d')}}T{{now().strftime('%H:%M:%S.%f')}},{{states('device_tracker.pixel_7')}},{{state_attr('device_tracker.pixel_7','latitude')}},{{state_attr('device_tracker.pixel_7','longitude')}}"
|