Skip to content

Instantly share code, notes, and snippets.

@Landrash
Created March 3, 2017 11:48
Show Gist options
  • Save Landrash/dd27cf7387b1d265f575a0113de80c20 to your computer and use it in GitHub Desktop.
Save Landrash/dd27cf7387b1d265f575a0113de80c20 to your computer and use it in GitHub Desktop.
notification when home.
- alias: 'Presence Notifications'
initial_state: 'off'
trigger:
- platform: state
entity_id: device_tracker.pixel_pixel, device_tracker.iphone_iphone
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.stop_automation
state: 'off'
- condition: template
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
action:
- service: notify.pushnotify
data_template:
title: "Presence Notification"
message: >
{{ trigger.from_state.attributes.friendly_name }} just changed from
{{ trigger.from_state.state }} to {{ trigger.to_state.state }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment