Skip to content

Instantly share code, notes, and snippets.

@idominiki
Forked from Hooverjc/GarbageCollection.yaml
Last active January 4, 2024 14:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save idominiki/76d57efc075042c22b02a553fc3d78ab to your computer and use it in GitHub Desktop.
Save idominiki/76d57efc075042c22b02a553fc3d78ab to your computer and use it in GitHub Desktop.
blueprint:
name: Garbage reminder
domain: automation
input:
reminder_time:
name: Reminder time
description: At what time the day before do you want to be reminded
default: '18:00:00'
selector:
time: {}
day_offset:
name: Day offset
description: Amount of days to be added to the triggers date to check for sensor
value matches. E.g. 1 to be notified the day before or 0 for notification
on the garbage collection day.
default: 1
reminder_title:
name: Reminder title
description: Shown as title in the notification
default: Garbage reminder
reminder_message:
name: Reminder message
description: Accompanying text in the notification
default: 'The following garbage will be picked up tomorrow: '
notifier:
name: Notifier
description: Name of integration you prefer to use for notifications. E.g. notify.notify
default: notify.notify
variables:
reminder_title: !input 'reminder_title'
reminder_message: !input 'reminder_message'
day_offset: !input 'day_offset'
sensors_tomorrow: "{{ states.sensor | selectattr('attributes.daysTo', 'equalto', day_offset|int(0)) | map(attribute='attributes.friendly_name')| list | join(', ') }}"
trigger:
platform: time
at: !input 'reminder_time'
condition:
condition: template
value_template: "{{ sensors_tomorrow | length > 0 }}"
action:
service: !input 'notifier'
data:
title: '{{ reminder_title }}'
message: '{{ reminder_message }}{{ sensors_tomorrow }}'
data:
ttl: 0
priority: high
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment