Here’s one of those little automations that feels like magic when it works: your porch light turns on automatically when someone walks up after sunset. It’s a practical example of using Google Home’s new automation script editor—and it’s ridiculously easy to set up.
Part of the inspiration for this automation came from watching delivery drivers show up late at night or early in the morning, using their phone flashlights just to find the steps to my front door. I wanted to provide a safe, welcoming spot for them to drop off packages; no fumbling in the dark, no guesswork. A little light goes a long way toward making everyone feel more comfortable.
What You’ll Need
- A camera that supports person detection — I used a Nest Doorbell/Cam with a subscription to enable person alerts.
- A smart light — either a connected smart bulb or, in my case, a smart switch controlling the porch light.
- Access to the public preview of Google Home’s script editor — you'll need this to write YAML-style automations.
The Automation Script
metadata:
name: Turn on porch light when a person is seen
description: Turn on light when a person is seen
automations:
- starters:
- type: device.event.PersonDetection
device: Front Door - Front Porch
condition:
type: time.between
after: SUNSET
before: sunrise
actions:
- type: device.command.OnOff
devices:
- Porch - Front Porch
on: true
How It Works
- Trigger: A person is detected by the camera on the front porch.
- Condition: It only runs between sunset and sunrise (so it doesn’t waste energy during the day).
- Action: Turns on the porch light immediately.
Why I Love It
This kind of automation is simple but useful. It boosts security, saves you from fumbling for the switch, and just feels like your home is paying attention. Google’s new automation editor makes it easy to build and customize these routines with YAML-style clarity.
Want to Try It?
If you've got a Google Home-compatible camera and smart light, just open the Google Home script editor and paste this in as a custom routine. You can always tweak the device names or time settings to fit your setup.
More to come as I play with presence sensors, weather triggers, and multi-room responses. Smart homes are finally getting... smarter.
No comments:
Post a Comment