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