From fae0cd8c061420e5a77e25139f6354f8d4c8ec58 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 25 Apr 2018 18:35:12 -0400 Subject: [PATCH] Notify when someone's home --- automations.yaml | 20 ++++++++++++++++++++ configuration.yaml | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/automations.yaml b/automations.yaml index af53e3f..da06a18 100644 --- a/automations.yaml +++ b/automations.yaml @@ -60,6 +60,26 @@ platform: state from: not_home to: home +- action: + - service: notify.notifymyandroid + data: + message: >- + Someone's home: + {{ states + | selectattr("entity_id", "in", + states.group.phones.attributes.entity_id) + | selectattr('state', 'eq', 'home') + | map(attribute='attributes.friendly_name') + | join(' and ')}}. + alias: Notify that someone else is home + trigger: + - entity_id: group.phones + platform: state + to: home + condition: + - condition: state + entity_id: device_tracker.homeassistant_pixel + state: not_home - action: - service: scene.turn_on entity_id: scene.dimmed_brightness diff --git a/configuration.yaml b/configuration.yaml index b139119..0c43d8b 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -84,6 +84,11 @@ weather: - platform: darksky api_key: !secret darksky_api_key +notify: + - name: notifymyandroid + platform: nma + api_key: !secret notifymyandroid_api_key + zone: !include zones.yaml group: !include groups.yaml automation: !include automations.yaml