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.