Skip to content

Instantly share code, notes, and snippets.

@larsoss
Created March 17, 2022 12:16
Show Gist options
  • Select an option

  • Save larsoss/d4827a7276286b5f7ed58d4563493c37 to your computer and use it in GitHub Desktop.

Select an option

Save larsoss/d4827a7276286b5f7ed58d4563493c37 to your computer and use it in GitHub Desktop.
alias: Afval - Test - Bewerking.
description: Een reminder om het afval buiten te zetten de avond voor ophaling.
trigger:
- platform: time_pattern
minutes: /45
- platform: state
entity_id:
- binary_sensor.motion_woonkamer_occupancy
- binary_sensor.motion_keuken_occupancy
- binary_sensor.motion_computer_occupancy
- binary_sensor.motion_badkamer_occupancy
to: 'on'
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.waste_moved
state: 'off'
- condition: state
entity_id: input_boolean.waste_reminder
state: 'on'
- condition: time
after: '17:00'
before: '23:00'
- condition: template
value_template: '{{ states(''sensor.afvalwijzer_tomorrow'') != ''Geen'' }}'
action:
- variables:
bin: >-
{{ states('sensor.afvalwijzer_tomorrow') | replace('plastic ','') |
replace('restafval ','') | replace('gft ','') | lower }}
title: ♻️ Afval - Afvalwijzer
message: >-
De {{ states('sensor.afvalwijzer_tomorrow') | replace('plastic ','') |
replace('restafval ','') | replace('gft ','') | lower }} mag aan straat
worden geplaatst.
lovelace: /lovelace-thuis/afval
tag: bin_day
image: |-
{% if states('sensor.afvalwijzer_tomorrow') == "restafval" %}
/local/afvalwijzer/2Restafval.png
{% elif states('sensor.afvalwijzer_tomorrow') == "gft" %}
/local/afvalwijzer/2GFT.png
{% elif states('sensor.afvalwijzer_tomorrow') == "plastic" %}
/local/afvalwijzer/2PMD.png
{% else %}
https://www.hairfair.nl/media/blog/test-.jpg
{% endif %}
- service: notify.html5
data:
title: '{{ title }}'
message: '{{ message }}'
data:
tag: '{{ tag }}'
url: '{{ lovelace }}'
image: '{{ image }}'
actions:
- action: afval_aan_straat
title: Afval aan straat ✔️
- action: afval_stilhouden
title: Stilhouden voor 1 uur 💤
- service: notify.notify
data:
title: '{{ title }}'
message: '{{ message }}'
data:
group: chore
tag: '{{ tag }}'
url: '{{ lovelace }}'
image: '{{ image }}'
attachment:
hide-thumbnail: false
push:
interruption-level: time-sensitive
actions:
- action: afval_aan_straat
title: Afval aan straat ✔️
icon: sfsymbols:checkmark
- action: afval_stilhouden
title: Stilhouden voor 1 uur 💤
icon: sfsymbols:speaker.slash.rtl
- alias: Wait for a response.
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: afval_aan_straat
- platform: event
event_type: mobile_app_notification_action
event_data:
action: afval_stilhouden
- platform: event
event_type: html5_notification.clicked
event_data:
action: afval_aan_straat
- platform: event
event_type: html5_notification.clicked
event_data:
action: afval_stilhouden
timeout:
minutes: 17
continue_on_timeout: false
- alias: Perform the action.
choose:
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == ''afval_stilhouden'' }}'
sequence:
- delay: '00:30:00'
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == ''afval_aan_straat'' }}'
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.waste_moved
data: {}
- service: notify.notify
data:
message: clear_notification
data:
tag: '{{ tag }}'
- service: html5.dismiss
data:
data:
tag: '{{ tag }}'
initial_state: true
mode: single
max_exceeded: silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment