Successful Automation Setup: Motion Detection When Away

Hey everyone, I thought I’d share my experience setting up an automation that notifies me when motion is detected while I’m away from home. I’ve been experimenting with Home Assistant for a while now, and this particular setup has been a game-changer for my peace of mind.

Initially, I wanted a system that would alert me if any unusual activity was detected in my home when I wasn’t there. After some research, I decided to use a motion sensor paired with my existing security setup. The challenge was getting the automation to trigger only when I was away, which required a bit of tweaking.

Here’s a quick overview of how I set it up:

  1. Trigger: I used a motion sensor (specifically the binary_sensor.pir1_occupancy) as the trigger. This sensor is strategically placed in my living area to cover the main entry points.

  2. Condition: The next step was setting the condition to ensure the notification only goes out when I’m not home. I utilized the zone component to track my location. The condition checks if I’m not in the ‘zone.home’ state before proceeding.

  3. Action: Once the condition is met, the automation sends a persistent notification to my phone with a clear message: ‘Motion detected’ along with a title for quick recognition.

The initial YAML setup had a few hiccups, mainly around correctly nesting the condition within the trigger. I found that using the states('person.gal') != 'home' condition was the key to ensuring it only activates when I’m away. After some trial and error, everything started working smoothly!

One thing I learned is the importance of testing each component individually before setting up the entire automation. This helped me identify and fix issues early on, saving me a lot of frustration.

Now, with this automation in place, I feel much more secure knowing that any unexpected movement in my home while I’m away will immediately alert me. It’s a simple yet effective setup that I highly recommend for anyone looking to enhance their home security without breaking the bank.

If anyone has questions or needs help setting something similar up, feel free to reach out! I’d be happy to share more details or troubleshoot any issues you might encounter.