Room Assistant // Pi Zero W // Trash Day

For some reason I can never remember to take the dumpster out on trash day, so I wanted to share a project (document so I can find the next time I want to build one) I put together to hopefully solve this problem.

Requirements:
1 Pi Zero W (props to SparkFun for selling at the actual $10 suggested price point)

1 iBeacon of your choice, I used these.

A dumpster I guess. I used the model helpfully provided by my trash service.

Configuring the pi zero.

I like PiBakery and thought I might want to use this same build elsewhere, so I created a quick recipe.

This simply configures wifi and runs the room assistant configuration script located here.

If you use this script, remember to edit local.json to reflect your requirements.

Once this is complete, let the pi boot, verify that it’s reachable via ssh and install. Also, slap the iBeacon on our tracked device, in this case the dumpster.

Home Assistant Config:

I’m using the mqtt_room sensor here, so config is easy. But we need to get the device id for each iBeacon. You can either use a phone app for this, or I connected to the MQTT server and moved one beacon at a time until I determined which device id correlated to which device.

sensor:
  - platform: mqtt_room 
  device_id: "b5b182c7eab14988aa99b5c1517008d9-1-38047" 
  name: Dumpster
  state_topic: room_presence
  away_timeout: 30
  - platform: mqtt_room 
  device_id: "b5b182c7eab14988aa99b5c1517008d9-1-39839" 
  name: F150
  state_topic: room_presence
  away_timeout: 30

I’m also tracking my truck here, why, because I had an extra iBeacon. What am I doing with it, nothing at the moment, if you have a great idea, please post it.

Now everything should be working and we should see our sensors in HA.

Now that we can determine if the dumpster is in the garage or not, we need an automation to alert us to move it outside if we haven’t already. In my case I want my automation to trigger if it’s 0800 and the dumpster is still inside, in the case I’m working from home, or whenever I open the garage door if it’s earlier. So we get something that looks like this.

- id: dumpster_inside 
  alias: Set Dumpster Outside 
  trigger:
  - at: 08:00:00
    platform: time
  - entity_id: switch.xbee_xbee_io_4193fedf_209_6 
    platform: state 
    to: 'on'
  condition:
  - after: 02:30:00 
    before: 09:30:00
    condition: time 
    weekday:
    - fri 
  - condition: state
    entity_id: sensor.dumpster
    state: garage 
  action: 
  - data: 
      message: It's trash day and the dumpster is still inside the garage.
      title: Take Dumpster Outside
    service: notify.pushbullet                                                                                                                       

While we are at it, why not have a reminder to bring it inside, it might be lonely.

- id: dumpster_outside
  alias: Bring Dumpster In
  trigger:
  - at: '11:00:00'
    platform: time
  - entity_id: switch.xbee_xbee_io_4193fedf_209_6 
    platform: state 
    to: 'on'
  condition:
  - after: '10:30:00' 
    condition: time 
    weekday:
    - fri 
  - condition: state
    entity_id: sensor.dumpster
    state: not_home 
  action: 
  - data: 
      message: The dumpster is still outside, please bring it back inside.
      title: Bring Dumpster Inside
    service: notify.pushbullet                                                                                                                 

Now we can get helpful alerts.

But of course, we should update our floorplan to show the state of the dumpster also.

SVG here.

And the CSS.

Result.

And that’s it, hopefully our dumpster woes are solved.

9 Likes

Lol I thought I was the only one who used a beacon to track my bins.

Could this be used with a spare raspberry pi?

As long as the pi supports BLE, you should be good. Looks like the 3b and 3b+ do, not sure on the older models.

Thanks! I do have the 3b+ I’ll have to try this out!

glue a door sensor to it and you can tell when the truck has emptied it!

I set up a similar project this week .To @thecubical’s point, I found a great beacon that handles presence AND motion.

When there’s motion, it broadcasts an additional beacon that’s the base beacon ID +1 (HEX).

Also, BlueCharm (the beacon vendor) is friendly and responsive to questions.

I’m still putting the finishing touches on things, but I’m using distance to tell if the can is at the street (it never goes “away” in my case) via a template sensor. I plan to create a couple of binary inputs to keep track of each can (trash / recycle) if they get moved while at the street.

Thanks for sharing, I no longer use the trash portion of this. The vendor was acquired by a large corporation and then raised rates to the point it was worth my time to drive my trash and recycling to the collection location myself. I am intrigued by the beacon you mentioned though, having motion built in, opens up a lot of possibilities. Just need to find a project for it.