diff --git a/custom_sentences/en/presence.yaml b/custom_sentences/en/presence.yaml new file mode 100644 index 0000000..3353a86 --- /dev/null +++ b/custom_sentences/en/presence.yaml @@ -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" \ No newline at end of file diff --git a/packages/presence.yaml b/packages/presence.yaml index 71361aa..1b116bc 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -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