Ask for locations with Assist

This commit is contained in:
2023-07-20 16:46:04 -04:00
parent 64607570f1
commit 29f637a823
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,24 @@
language: "en"
intents:
GetLocation:
data:
- sentences:
- "where is {person} [at] [(right now|currently)]"
- "give me [the] [current] location (of|for) {person}"
skip_words:
- "please"
- "can you"
lists:
person:
values:
- in: "(tony stork|tony|anthony|dad)"
out: "person.tony_stork"
- in: "(tina stork|christina stork|tina|christina|mom)"
out: "person.christina_stork"
- in: "(kallen stork|collin stork|kallen|collin)"
out: "person.kallen_stork"
- in: "(emmalynn stork|emma stork|emmalynn|emma)"
out: "person.emmalynn_stork"

View File

@ -336,6 +336,20 @@ mqtt:
payload_available: "online"
payload_not_available: "offline"
intent_script:
GetLocation:
speech:
text: >
{% set location = states(person) %}
{% set name = state_attr(person,'friendly_name') %}
{% if location in ['away','not_home'] %}
{{ name }} is currently away from home
{% elif location in ['unavailable','unknown'] %}
I do not have a current location for {{ name }}
{% else %}
{{ name }} is currently at {{ location }}
{% endif %}
automation:
- id: kallen_at_school
alias: Kallen is at School