Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peyanski/c624efc494af79c8f6b0afdef4a8d948 to your computer and use it in GitHub Desktop.

Select an option

Save peyanski/c624efc494af79c8f6b0afdef4a8d948 to your computer and use it in GitHub Desktop.
Notify for a family-room window that stays open for five minutes at night, including a window that was already open at 22:00.
alias: Notify when a family-room window stays open late
description: >-
Notify for a family-room window that stays open for five minutes at night,
including a window that was already open at 22:00.
triggers:
- trigger: state
entity_id:
- binary_sensor.left_window
to:
- 'on'
for:
hours: 0
minutes: 5
seconds: 0
id: left_window_open
enabled: true
alias: Left window
- trigger: state
entity_id:
- binary_sensor.right_window
to:
- 'on'
for:
hours: 0
minutes: 5
seconds: 0
id: right_window_open
enabled: true
alias: Right window
conditions:
- condition: time
after: '22:00:00'
before: '07:00:00'
enabled: true
actions:
- choose:
- conditions:
- condition: trigger
id:
- left_window_open
sequence:
- action: persistent_notification.create
metadata: {}
data:
message: Left window is still open
title: Left
- conditions:
- condition: trigger
id:
- right_window_open
sequence:
- action: persistent_notification.create
metadata: {}
data:
message: Right window is still open
title: Right
mode: queued
max: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment