Garbage and Recycling Collection Notifier Light

Just wanted to share a simple little project I’m finishing up.

I made a very simple notifier light in my garage to remind us that it’s garbage day or recycling day. It uses an WS2812B RGB LED Strip mounted above my garbage and recycling bins. Basically the idea is that on the morning of the collection day, the section of strip above the collected can will light up green and the other side will be red. This was mentioned on the Home Assistant Podcast Episode 70 https://hasspodcast.io/ha070/

Garbage Day only


Garbage and Recycling Day

Hardware:

Really pretty straightforward and simple. I drilled a couple holes into a piece of angle iron so it can be mounted to the wall. Then mounted the LED strip to the bottom of the angle iron. When it’s on the wall, the leds shine downwards.
I’m using a NodeMCU flashed with WLED https://github.com/Aircoookie/WLED to control the strip. Thats basically it for hardware. Like I said: simple.
If you’ve never used WLED, DrZzs has a great video to set this up. https://www.youtube.com/watch?v=tXvtxwK3jRk

Software:

So first thing you need is some way for Home Assistant to what your pickup day(s) is(are).
I have garbage every Tuesday and recycling every other Tuesday.

I’m using the Garbage Collection custom integration https://github.com/bruxy70/Garbage-Collection to create a sensor for each bin. There are lots of different ways to do this. Pick your poison.

Next you need to setup WLED.

In a recent update of WLED, sections were introduced! So multiple sections of a single strip can have separate effects or in this case two separate solid colors. So for mine, I have 20 LED’s in the strip. The first section is LED 0-9 and the second section is 11-20. This makes a little gap between the two sections.

Once you have the two sections setup, then add the device to HA. It’s added via the UI and will give you an entity for each section and a “master” that turns the whole strip on/off

One other thing I’ve done is make the default turn-on behavior of each section to be green [0, 255, 0] and 100% brightness. Not necessary though.

Now for the automations and scenes.
Create a scene for each of your pickup days.
the following are in scenes.yaml

  - name: garbage_day
    entities:
      light.garbage_light_master:
        state: true
      light.recycling_can:
        state: true
        rgb_color: [255, 0, 0]
        brightness: '255'
      light.trash_can:
        state: true
        rgb_color: [0, 255, 0]
        brightness: '255'

  - name: recycling_day
    entities:
      light.garbage_light_master:
        state: true
      light.recycling_can:
        state: true
        rgb_color: [0, 255, 0]
        brightness: '255'
      light.trash_can:
        state: true
        rgb_color: [0, 255, 0]
        brightness: '255'

Now the automations.
I have 3 setup.
One for garbage day. One for garbage/recycling, and one to turn off the light.

Garbage Day:

############Automation checks every day at 5:30am. 
#When the garbage sensor shows 'today' and the recycling sensor is not 'today' 
#then the light over the garbage can is green and the light over the recycling can is red.
- id: garbage_light_notification
  alias: Garbage Light Notification
  initial_state: true
  trigger:
  - platform: time
    at: '05:30:00'
  condition:
  - condition: not
    conditions:
    - condition: state
      entity_id: sensor.recycling
      state: 'today'
  - condition: state
    entity_id: sensor.garbage_day
    state: 'today'
  action:
  - service: light.turn_on
    entity_id: light.garbage_light_master
  - service: light.turn_on
    data:
      entity_id:
      - light.trash_can
      - light.recycling_can
  - delay: '1'
  - service: scene.turn_on
    data:
      entity_id: scene.garbage_day

Recycling Day

#When both sensors show 'today' then
#both lights are green

- id: recycling_light_notification
  alias: Recycling Light Notification
  initial_state: true
  trigger:
  - platform: time
    at: '05:30:00'
  condition:
  - condition: state
    entity_id: sensor.recycling
    state: 'today'
  - condition: state
    entity_id: sensor.garbage_day
    state: 'today'
  action:
  - service: light.turn_on
    entity_id: light.garbage_light_master
  - service: light.turn_on
    data:
      entity_id:
      - light.trash_can
      - light.recycling_can
  - delay: '1'
  - service: scene.turn_on
    entity_id: scene.recycling_day

Turn off the light:

#At 10:30am, the whole strip turns off. 
#This gives us plenty of time to see the lights as a reminder

- id: garbage_light_off
  alias: Garbage Light Off
  trigger:
  - platform: time
    at: '10:30:00'
  condition:
  - condition: or
    conditions:
    - condition: state
      entity_id: light.recycling_can
      state: 'on'
    - condition: state
      entity_id: light.trash_can
      state: 'on'
  action:
  - service: light.turn_off
    data:
      entity_id:
      - light.garbage_light_master

That’s pretty much it.
You could add a TTS or push notification to these automations or a light in your kitchen or something too.

3 Likes

So just adding to this in case anyone is using WLED segments on their strips.

Something I noticed is that if the ESP board loses power, WLED loses it’s segments.
It’s really frustrating, but since I’m using this ONLY for this notifier light, I was able to set the default preset at boot as the green and red.

Basically, you setup your two segments in the WLED app. then choose red for one segment and green for the other (or whatever you want it to be). Then go to the Favorites tab. Set it as a favorite (you can choose from 1-16).

Then in the Config>LED Settings Menu, you can choose default preset at boot. Type whichever number was the favorite you setup.