My camera checks if I took the trash out

I wanted the house to stop reminding me about the garbage once the bin is already out. So now my driveway camera does the checking.

The setup: one of my G5 Pro (PoE) looks at the driveway and goes into Home Assistant through Frigate. HA has a calendar with the pickup days, black bin for garbage and blue bin for recycling.

From 12 hours before the pickup, HA takes a snapshot every hour and asks an AI one simple question: is the black bin closer to the street than to the house? It answers true or false, nothing else. If it’s true, the “bin at the road” flag turns on and the house leaves me alone.

If the bin is still beside the house, I get a reminder at 6 p.m. the day before and again in the morning: a notification on my phone and on the TV, and one of the spots on my kitchen rail changes color. Red the evening before, yellow the morning of. Hard to miss when you make your coffee.

The reminder light is an Aqara LED Bulb T2 (GU10, RGB CCT) on my kitchen rail, paired to my M3 and shared to Home Assistant over Matter.

Two things I learned. Tell the AI where the street and the house are in the picture, otherwise it guesses. And ask only for true or false, it’s much more reliable than asking for a description.

What makes it work at night is the camera. The G5 Pro has True Color Night Vision (1/1.8" sensor, f/1.0 aperture), so the snapshot at 2 a.m. is still in color. That’s how the AI can tell the black bin from the blue one in the dark. With a black and white infrared picture, both bins would look the same.

Here is the driveway tonight at 2:15 a.m. Black bin at the road, blue bin still beside the house because it’s not its week. The flag was already on.

And this is what the kitchen looks like when I forget.

Here is the automation if you want to try it. Change the calendar, the camera and the helper for yours. A second automation turns the helper back off the day before the next pickup.

alias: AI - Is the bin at the road?
description: Every hour, within 12 hours of a pickup, ask the AI if the bin is at the road.
triggers:
  - trigger: time_pattern
    minutes: "59"
conditions:
  - condition: template
    value_template: >
      {% set start = as_timestamp(state_attr('calendar.garbage', 'start_time')) %}
      {{ start is not none and (now().timestamp() - start) | abs <= 43200 }}
  - condition: state
    entity_id: input_boolean.bin_at_the_road
    state: "off"
actions:
  - action: ai_task.generate_data
    continue_on_error: true
    data:
      task_name: Check bin
      entity_id: ai_task.google_ai_task
      instructions: >-
        Look only at this image. The street is at the top and the house is
        at the bottom. If the black garbage bin is closer to the street than
        to the house, answer strictly true, otherwise answer strictly false.
        Answer only true or false, in lowercase, without quotes or line break.
      attachments:
        media_content_id: media-source://camera/camera.driveway
        media_content_type: image/jpeg
    response_variable: ai_response
  - if:
      - condition: template
        value_template: "{{ ai_response is defined and ai_response.data == 'true' }}"
    then:
      - action: input_boolean.turn_on
        target:
          entity_id: input_boolean.bin_at_the_road
mode: single

What chore do you make your cameras check for you?

6 Likes

I like this a lot, especially that the camera removes a reminder instead of adding one more.

Frigate is on my project list too, for my older PoE cameras in Home Assistant, so two questions:

  1. What does the AI step run on? Is that a local model, or do you send the snapshot to a cloud service?
  2. What hardware does your Frigate run on? My Home Assistant machine is an old i7 without a usable GPU, so I am looking at a Coral USB stick for detection.

The tip to ask only for true or false is a good one. I will steal that.

1 Like

The AI step for the bin is cloud: Google Gemini, through the AI Task feature in Home Assistant. One small snapshot per hour for a few hours before the pickup, so it stays very light.

Frigate runs in an LXC on my Proxmox box, an Intel i5-14500. No Coral here. Detection is a YOLOv9 model running on the integrated GPU with OpenVINO. Before buying the USB stick, look at which i7 you have: if it’s a 6th gen or newer, its integrated graphics are enough for OpenVINO. The Frigate docs don’t recommend the Coral for new installs anymore.

For the AI part of Frigate itself (descriptions and chat), mine is connected to Cloudflare Workers AI, so nothing heavy runs at home.