Skip to content

Instantly share code, notes, and snippets.

@letsautomatenet
Last active July 10, 2024 13:34
Show Gist options
  • Save letsautomatenet/9c84d96eef95592cca87090eb7b0c734 to your computer and use it in GitHub Desktop.
Save letsautomatenet/9c84d96eef95592cca87090eb7b0c734 to your computer and use it in GitHub Desktop.
Create Zone of current phone location
# Create this script and then add a card to the dashboard linking to the script
alias: Add New Zone
sequence:
- service: zone.create
metadata: {}
data:
radius: "{{radius|default(100)}}"
name: "{{zone_name}}"
latitude: "{{ state_attr('device_tracker.marc_phone','latitude') }}"
longitude: "{{ state_attr('device_tracker.marc_phone','longitude') }}"
description: ""
fields:
zone_name:
selector:
text: null
name: Zone Name
required: true
radius:
selector:
number:
min: 50
max: 500
step: 50
name: Radius
default: 100
required: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment