Garbage Collection - automation - notify

Hi all
Having trouble with the garbage collection addon in an automation.
The garbage collection and garbage collection cards work perfectly (good work designers).
I have tried to get an automated email (and tts) to work but failing to have the events fire.

Just looking at email notification. The below code works when manually executed but does not run by itself. The mail server doesnt register a hit.

- id: '1588210435366'
  alias: Industrial Bin notification
  description: ''
  - at: '10:01:00'
    platform: time
  - condition: state
    entity_id: sensor.industrial_waste
    state: '0'
- data:
      message: Industrial Bin empty time
    service: notify.remindermail

The sensor being tested is showing as collection ‘today’ and icon red. I believe that this means the state of the sensor is 0 (zero)

The state can be one of

Value Meaning
0 Collection is today
1 Collection is tomorrow
2 Collection is later

I have tried useing state and numeric state as conditions. Can someone please point to my failure.

Unless it’s a paste error the line - data: needs moving right two spaces.

Hi Marc,

not getting any errors from the layout (which is cut/paste from editor)

tried changing it but getting errors on any changes I make.

Fancy sharing the errors?

as in the editor gives a red exclamation mark after I change the code for that (and following lines)

I just looked at another HA box that I have and it appears the line is good from the samples their.

OK - is the automation switched on?

Are there any errors in the log when it runs?

If you manually trigger it do you receive the message?

ok the automation is switched on

their are zero errors in the log

manually triggering it works fine. also running the task through ‘services’ works fine.

And other time triggers in your setup work fine and on time?

yes that is correct

Please check if in the sensor configuration verbose_state=‘no’, otherwise you’ll get some text as state value instead of numbers (0-2).

Legend. Not at work at the moment to test that install (local only) however have had same issue at home for months. Works now. Thanks amaximus. Cheers Marc

1 Like

Hi, I want to use your example to different garbage sensors (paper, plastic, etc).

There’s a “smart” way to make it with just one automation? Or I have to make as many automation I need?

Thank you all in advance!

Hi Jokerigno

I used different automations for different bins (waste and recyclable).

Just used the same code (above) for both.

Their may be a “smart” way to put this into a single automation but Im not that “smart” :slight_smile:


OK :slight_smile:

Thank you anyway !

- alias: Bin notifications 
    platform: time
    at: '07:00:00' 
    condition: or
      - condition: state
        entity_id: sensor.rubbish
        state: '0'
      - condition: state
        entity_id: sensor.recycling
        state: '0'
    service: notify.mobile_app_YOU
      message: "{{ 'rubbish' if is_state('sensor.rubbish', '0') else 'recycling' }} is due for collection."

Thank you! :slight_smile:

1 Like

Hi @anon43302295
just one question… If I gonna have a third sensor (for example glass) except adding it to condition, how should I modify line
‘message’ ?

message: "{{ 'rubbish' if is_state('sensor.rubbish', '0') else 'recycling' else 'glass' }} ??? will it work?

i wish this got a reply, i need a third bin added