Successfully Adding Video Notifications in Home Assistant

Hey everyone, I wanted to share my experience with adding video notifications in Home Assistant. I’ve been trying to figure this out for a while and finally got it working, so I thought I’d document the process for anyone else who might be interested or struggling with the same thing.

The Goal:
I wanted to send video notifications to my mobile app when certain events happen in my home. Specifically, I’m using a camera to record short clips of our pet feeder and send those clips as notifications. It’s a fun way to keep an eye on our furry friends even when I’m not home.

The Challenge:
I stumbled upon some documentation that suggested it was possible to attach videos to notifications, but when I tried it out, I kept getting empty notifications. I tested different file paths, checked the permissions, and even looked into alternative methods like Telegram, but I really wanted to stick with the Home Assistant companion app for consistency.

The Solution:
After some trial and error, I realized that the issue might be with how the file path was structured. I was using a relative path, but it turns out I needed to use an absolute path for the video file. Here’s the code that finally worked for me:

yaml
alias: Feederclip
description: “”
triggers:

  • trigger: time
    at: “08:10:30”
    conditions:
  • condition: time
    before: “22:00:00”
    after: “10:00:00”
    actions:
  • action: camera.record
    metadata: “”
    data:
    duration: 20
    filename: >-
    /config/www/feeder/feeder{{ state_attr(‘automation.feederclip’,‘last_triggered’)|replace(’ ‘,’')}}.mp4
    target:
    entity_id: camera.pet_feeder_3
  • action: notify.mobile_app_samsungs24u
    data:
    data:
    video: >-
    /local/www/feeder/feeder{{ state_attr(‘automation.feederclip’,‘last_triggered’)|replace(’ ‘,’')}}.mp4
    message: “The monster has been fed!”
    mode: single

Key Takeaways:

  1. File Path: Make sure the file path is absolute and correctly points to where your video files are stored.
  2. Permissions: Ensure that Home Assistant has the necessary permissions to read and write to the directory where your videos are stored.
  3. Testing: Test your automation step by step. Start by recording the video and checking if it’s saved correctly before moving on to sending notifications.

The Result:
Now, every morning at 8:10, my phone lights up with a notification showing the previous night’s feeding session. It’s a small but cool way to integrate my pets into my smart home setup.

I hope this helps anyone else who’s been trying to get video notifications working in Home Assistant. It’s a great feature once you get it sorted out, and it really adds another layer of functionality to your setup.

Happy automating! :rocket: