Skip to content

Instantly share code, notes, and snippets.

@langelguy
Last active April 21, 2020 00:46
Show Gist options
  • Save langelguy/69b2380791148d217e1b51980777f5fa to your computer and use it in GitHub Desktop.
Save langelguy/69b2380791148d217e1b51980777f5fa to your computer and use it in GitHub Desktop.
- id: doorbell_alert
alias: Doorbell Alert
trigger:
- entity_id: binary_sensor.front_doorbell_ding
platform: state
to: 'on'
condition:
- condition: template
value_template: '{{ (as_timestamp(now()) - as_timestamp(state_attr(''automation.doorbell_alert'',
''last_triggered'') | default(0)) | int > 5)}}'
action:
- data:
entity_id: camera.front_doorbell
filename: '/config/www/doorbell.jpg'
service: camera.snapshot
- data:
data:
attachment:
url: https://"mydomain".duckdns.org/local/doorbell.jpg
message: Someone has pressed the doorbell.
service: notify.mobile_app_spencers_iphone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment