Garbage reminder

Im getting 404 on your gist. Is it public?

It is, maybe that was a bad link, try this one, I can see it without being logged in.

4 Likes

Hi together,

I also forked @Tweak3D Blueprint again to work with “Waste Collection Schedule” from @mampfes:

Use this Blueprint:

Greets
Dominik

1 Like

If anyone Uses the Recollect integration in the USA, i modified this to report the proper next Pickup Type.

Hi there, i hope someone can help me. I have several automations that won’t work and i tried to troubleshoot them. I think it is because of something wrong with the timing.

for example, i have two different blueprints imported to send me a notification when my garbage is picked-up. This are westenberg/garbage-reminder.yaml and idominiki/GarbageCollection.yaml.

Both will check the garbage entities and if there is 1 day before pick up they must sent a notification through telegram. If i do a test it works, but when the blueprints must send a message on a certain time i get Stopped because a condition failed.

I think it has something to do with an invalid strftime date format.
I one of the automations i can set the correct strftime, which is by default %Y-%m-%d, in the configuration yaml of the garbage addon it is also set to %Y-%m-%d.

But when i check the entities, i see several different time/date fields.
I get in the yaml status attributes: Sort_date: 20221101
In the status date: Tomorrow, 2022-10-21
And if i check the attributes of an entity in lovelace i get also Sort date: 20.221.021 (this one is strange, but can be default behavior).

Maybe someone else has have the same problem in the past en seems to solve it?

Hi there, i hope you can help mei can’t get your blueprint to work. If it run on the set time in the trace i see: Stopped because a condition failed at

I think it has something to do with an invalid strftime date format.
I one of the automations i can set the correct strftime, which is by default %Y-%m-%d, in the configuration yaml of the garbage addon it is also set to %Y-%m-%d.

But when i check the entities, i see several different time/date fields.
I get in the yaml status attributes: Sort_date: 20221101
In the status date: Tomorrow, 2022-10-21
And if i check the attributes of an entity in lovelace i get also Sort date: 20.221.021 (this one is strange, but can be default behavior).

Do you have any idea?

I had the similar issue. In my case I have garbage collection addon configured in a way that sensors for garbage types are not holding textual state with date but only integer value:

  • 2 - if next collection is in two days or more
  • 1 - if next collection is one day ahead
  • 0 - if collection is today.

What worked for me was to change blueprint code to fetch “next_date” attribute while building sensors_tomorrow array that is then checked by trigger condition.
Here is the modified blueprint code:

blueprint:
  name: Updated 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
    date_format:
      name: Date format
      description: Valid strftime date format. Default %Y-%m-%d
      default: '%Y-%m-%d'
    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
    garbage_sensor_1:
      name: Garbage sensor 1
      description: Sensor should be a date string formatted according to the date format input
      default: ''
      selector:
        entity:
          domain: sensor
    garbage_sensor_2:
      name: Garbage sensor 2
      description: Sensor should be a date string formatted according to the date format input
      default: ''
      selector:
        entity:
          domain: sensor
    garbage_sensor_3:
      name: Garbage sensor 3
      description: Sensor should be a date string formatted according to the date format input
      default: ''
      selector:
        entity:
          domain: sensor
    garbage_sensor_4:
      name: Garbage sensor 4
      description: Sensor should be a date string formatted according to the date format input
      default: ''
      selector:
        entity:
          domain: sensor

variables:
  garbage_sensor_1: !input 'garbage_sensor_1'
  garbage_sensor_2: !input 'garbage_sensor_2'
  garbage_sensor_3: !input 'garbage_sensor_3'
  garbage_sensor_4: !input 'garbage_sensor_4'
  reminder_title: !input 'reminder_title'
  reminder_message: !input 'reminder_message'
  day_offset: !input 'day_offset'
  date_format: !input 'date_format'
  sensors_tomorrow: '{{ [(state_attr(garbage_sensor_1, ''friendly_name''), state_attr(garbage_sensor_1, ''next_date'').strftime(date_format)), (state_attr(garbage_sensor_2, ''friendly_name''), state_attr(garbage_sensor_2, ''next_date'').strftime(date_format)), (state_attr(garbage_sensor_3, ''friendly_name''), state_attr(garbage_sensor_3, ''next_date'').strftime(date_format)), (state_attr(garbage_sensor_4, ''friendly_name''), state_attr(garbage_sensor_4, ''next_date'').strftime(date_format))] | selectattr(''1'', ''eq'', (now() + timedelta(days = day_offset | int)).strftime(date_format)) | join('', '',  attribute=0) }}'
trigger:
  platform: time
  at: !input 'reminder_time'
condition:
  condition: template
  value_template: "{{ sensors_tomorrow != '' }}"
action:
  service: !input 'notifier'
  data:
    title: '{{ reminder_title }}'
    message: '{{ reminder_message }}{{ ''\n'' }}{{ sensors_tomorrow }}'

I hope this helps anybody who encountered similar issue
Rgds,
J.

I used all of the blueprints here but none of it is working. My setup is a google calendar with the entries for each garbage collection. With the HACS waste collection schedule I transfer these entries in 3 different sensor values - so 3 different types of waste. Based on this I wanted to get a notification each evening before at 6pm to have a reminder. Probably there is a more efficient way with the direct Google Calendar integration. Do you have an advice how to establish the reminder in the most efficient way?

I get this error for my reminders as I am using my google calendrer for my trash days reminder?

variables:
  garbage_sensor_1: calendar.garbage_day
  garbage_sensor_2: ''
  garbage_sensor_3: ''
  garbage_sensor_4: ''
  reminder_title: Garbage reminder, Take out the Trash
  reminder_message: 'The following garbage will be picked up tomorrow: '
  day_offset: 1
  date_format: '%Y-%m-%d'
  sensors_tomorrow: >-
    {{ [(state_attr(garbage_sensor_1, 'friendly_name'),
    states(garbage_sensor_1)), (state_attr(garbage_sensor_2, 'friendly_name'),
    states(garbage_sensor_2)), (state_attr(garbage_sensor_3, 'friendly_name'),
    states(garbage_sensor_3)), (state_attr(garbage_sensor_4, 'friendly_name'),
    states(garbage_sensor_4))] | selectattr('1', 'eq', (now() + timedelta(days =
    day_offset | int)).strftime(date_format)) | join(', ',  attribute=0) }}
trigger:
  platform: time
  at: '21:00:00'
condition:
  condition: template
  value_template: '{{ sensors_tomorrow != '''' }}'
action:
  service: notify.mobile_app_homeking
  data:
    title: '{{ reminder_title }}'
    message: '{{ reminder_message }}{{ sensors_tomorrow }}'
id: '1690572928061'
alias: Garbage reminder
description: ''
alias: Garbage reminder
description: ""
use_blueprint:
  path: westenberg/garbage-reminder.yaml
  input:
    reminder_title: Garbage reminder, Take out the Trash
    notifier: notify.mobile_app_homeking
    garbage_sensor_1: calendar.garbage_day
    reminder_time: "21:00:00"


Hi all, I can’t seem to get these blueprints working. Can someone help me find out what is going wrong? or is it an issue with newer Home Assistant?
If I try to type in the sensors_today variables, i can’t get it to display anything.
and in the blueprint of tweak3d trying to test that line i get attribute undefined.
So trying to build the sensors_today proves very challenging for me. Maybe I don’t understand the query language good enough.

All this functionality was replaced with the calendar integration years ago, so I doubt that this 3yo BP has been kept up.

I would look at something like this or do search for other similar in the forum:
Garbage Collection - recommendations for replacement of Bruxy integration - #11 by bschatzow.

Template Sensor Configuration for Calendar Events.

I think I am getting to understand why it isn’t working for me anymore.
The state of my sensors should be a date, but they aren’t the same for all sensors, and they aren’t what is expected in the blueprint.
The dateformat when further in the future as 7 days is “09-08-2024” this follows the %d-%m-%Y
But less then a week ahead it is like this: “Thursday, 01-08-2024”

So i guess this might be part of my problem, resulting in an empty array for the “Sensors_tomorrow”.
I’ll have to see if the ‘afvalbeheer’ HACS component has a setting for this to make it allways the same data format.

I do like the cards for a dashboard, so that’s why i am trying it this way and don’t go for completely changing it to the calendar in HA. Haven’t seen a good way of importing it there, but also haven’t searched very intensive either.

Thanks for this! The notification I was getting looked like

The following garbage will be picked up tomorrow: ['garbage', 'recycling']

I had to modify sensors_tomorrow so it would properly join the list by replacing

| join('', '',  attribute=0) 

with

| first | first | join(', ')