Today I will share my new garbage collection assistant (thanks to @ferrimiche suggestion!)
Prerequisites
First thing first, you must have this installed:
- home assistant (I can show you how)
- HACS (installation instructions)
Install Garbage Collection integration
Thanks to @bruxy70 we have an integration ready to use!
Go to HACS -> integrations -> explore & download repositories
Search for Garbage collection
and install the integration
Then configure it following the creator instructions. Those are perfectly clear!
Automation for notification
This is the automation that sends me and my wife the garbage collection reminder:
alias: Garbage collection
description: "notify garbage collection"
trigger:
- platform: time
at: "19:00:00"
condition:
- condition: or
conditions:
- condition: state
entity_id: sensor.raccolta_carta
attribute: days
state: 0
- condition: state
entity_id: sensor.raccolta_organico
attribute: days
state: 0
- condition: state
entity_id: sensor.raccolta_multimateriale
attribute: days
state: 0
- condition: state
entity_id: sensor.raccolta_indifferenziato
attribute: days
state: 0
action:
- service: script.notify_garbage_collection
data: {}
mode: single
and this is the script:
alias: Notify garbage collection
sequence:
- service: notify.baldarn
data:
message: >-
Remember
{{ "organico" if is_state('sensor.raccolta_organico', "today" else "" }}
{{ "multimateriale" if is_state('sensor.raccolta_multimateriale', "today") else "" }}
{{ "carta" if is_state('sensor.raccolta_carta', "today") else "" }}
{{"indifferenziato" if is_state('sensor.raccolta_indifferenziato',"today") else "" }}
- service: notify.wife
data:
message: >-
Remember
{{ "organico" if is_state('sensor.raccolta_organico', "today" else "" }}
{{ "multimateriale" if is_state('sensor.raccolta_multimateriale', "today") else "" }}
{{ "carta" if is_state('sensor.raccolta_carta', "today") else "" }}
{{"indifferenziato" if is_state('sensor.raccolta_indifferenziato',"today") else "" }}
mode: single
icon: mdi:delete
I’m not a python expert, if you have any suggestion for more elegant scripts, please let me know!
For any question come in the telegram channel