Skip to main content

Lady Catterton's Automated Cat Alert System

image.pngLady Catterton isn't allowed outside, but she doesn't let that stop her from keeping a close eye on the neighborhood cats that pass by. Here's how she does it.

 

Lady Catterton runs Home Assistant OS on a spare HP Mini PC. You can read about how she set it up here: https://www.wswapps.com/books/home-assistant/page/setup-home-assistant-on-a-mini-pc

Lady Catterton runs Frigate NVR as an addon in HAOS to monitor thather local cameras and detect object.objects. You can read about her setup here: https://www.wswapps.com/books/home-assistant/page/frigate-nvr

 

And finally, Lady Catteron has configured some automations in Home Assistant to let you know any time she spots a fellow kitty. Here'sBelow is an example of how she does that. She prefers to post to Mastodon, but you couldcan post your important news anywhere. Maybe one day she'll get more creative with her words as well. Kitten steps.

This automation config looks for cat events coming from Frigate on a specific camera only after theythe haveevent has ended, to ensure we only post about it once. AtAfter the endposting, we delay for 5 minutes to ensure that we don't get too excited and post again tooright soon.away.

alias: Mastodon - Back Door Cat
description: Posts to Mastodon with cat image when Frigate detects a cat
triggers:
  - trigger: mqtt
    topic: frigate/events
    payload: end
    value_template: "{{ value_json.type }}"
conditions:
  - condition: template
    value_template: >-
      {{ trigger.payload_json.after.label == 'cat' and trigger.payload_json.type
      == 'end' and trigger.payload_json.after.camera == 'Back_Door' }}
    enabled: true
actions:
  - variables:
      source_filename: >-
        {{ trigger.payload_json.after.camera }}-{{ trigger.payload_json.after.id
        }}.jpg
    enabled: true
  - delay: "00:00:03"
  - data:
      config_entry_id: MASTODON_ACCOUNT_ID_ASSIGNED_BY_HA_HERE
      visibility: unlisted
      status: >-
        A 🐱 just came by the back door!

        #cat #homeassistant #frigate

      media_description: >-
        I'm {{ (trigger.payload_json.after.score * 100) | round(1) }}% sure this
        is a cat!
      media_warning: false
      media: /media/frigate/clips/{{ source_filename }}
    action: mastodon.post
  - delay: "00:05:00"
mode: single