Created
April 8, 2025 20:57
-
-
Save davidino/3a5ccb0c6c101f7ef6a04c3685950c6a to your computer and use it in GitHub Desktop.
Bin reminder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Garbage bin reminder | |
| description: "" | |
| mode: single | |
| triggers: | |
| - alias: it's 8pm | |
| at: "19:35:00" | |
| enabled: true | |
| trigger: time | |
| - entity_id: zone.home | |
| attribute: persons | |
| above: 0 | |
| value_template: "{{ state.attributes.persons|length }}" | |
| enabled: true | |
| alias: someone arrives home | |
| trigger: numeric_state | |
| conditions: | |
| - alias: someone is home at the right time | |
| condition: and | |
| conditions: | |
| - condition: numeric_state | |
| entity_id: zone.home | |
| attribute: persons | |
| above: 0 | |
| value_template: "{{ state.attributes.persons|length }}" | |
| alias: someone is home | |
| - condition: time | |
| before: "23:00:00" | |
| after: "18:00:00" | |
| enabled: true | |
| weekday: | |
| - mon | |
| - wed | |
| enabled: true | |
| actions: | |
| - data: | |
| start_date_time: "{{ now() + timedelta( days = 1 ) }}" | |
| end_date_time: "{{ now() + timedelta( days = 1 ) }}" | |
| target: | |
| entity_id: calendar.bin | |
| response_variable: agenda | |
| action: calendar.get_events | |
| - alias: stop the execution if it's not the right day | |
| if: | |
| - alias: check if events is empty | |
| condition: template | |
| value_template: "{{ agenda['calendar.bin'].events|length == 0 }}" | |
| then: | |
| - stop: wrong day | |
| - variables: | |
| bin: > | |
| {% if agenda['calendar.bin'].events %}{{ | |
| agenda['calendar.bin'].events[0].summary }}{% endif %} | |
| - data: {} | |
| target: | |
| entity_id: input_boolean.bin_reminder | |
| enabled: true | |
| action: input_boolean.turn_on | |
| - repeat: | |
| while: | |
| - condition: state | |
| entity_id: input_boolean.bin_reminder | |
| state: "on" | |
| sequence: | |
| - data: | |
| message: Hey Remember the {{ bin }} bin for tomorrow | |
| title: Hey Remember the {{ bin }} bin for tomorrow | |
| enabled: true | |
| action: notify.internal_notification_group | |
| - delay: | |
| hours: 0 | |
| minutes: 10 | |
| seconds: 0 | |
| milliseconds: 0 | |
| enabled: true | |
| - data: | |
| message: Hey Remember the {{ bin }} bin for tomorrow | |
| title: Hey Remember the {{ bin }} bin for tomorrow | |
| alias: For testing purposes send the notification to David | |
| enabled: false | |
| action: notify.mobile_app_davids_iphone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment