Home Assistant automation to detect motion on an Arlo security camera and turn a light on and off

Portrait of Rod Alcidonis

Rod Alcidonis

Published on October 21, 2022

Subscribe to my YouTube channel
Buy me a beer
A picture showing programming codes.

In this tutorial, I will be showing you how to create an automation in Home Assistant to detect motion on an Arlo Security Camera and to turn the front door light on when motion is detected and off when motion is inactive. You can also follow me more closely on this YouTube video where I demonstrated line by line how to code the automation.

To code this smart home automation, I am using the Arlo Camera Support Integration and the Appdaemon framework integration in Home Assistant. Go ahead and configure both of those integrations.

Part I

First, I need to register my Appdaemon App in Home Assistant, as described in the video. My Apps.yaml file is as follows:

Arlo Motion:
  module: arlo_motion
  class: ArloMotion

Part II

The code for the automation is as follows:

import appdaemon.plugins.hass.hassapi as hass
class ArloMotion(hass.Hass):
	def initialize(self):
			self.listen_state(self.on_motion_detected, "binary_sensor.aarlo_motion_front_door", attribute = "state", new = "on")
	def on_motion_detected(self, entity, attribute, old, new, kwargs):
		if new == "on":
			self.turn_on("light.front_door_light")
		if new == "off":
			self.turn_off("light.front_door_light")

To test the automation, you should activate motion on your Arlo Security Camera and then observe whether the automation actually turns your designated light on and off.


I hope you found this article, "Home Assistant automation to detect motion on an Arlo security camera and turn a light on and off", informative and useful. For more smart home automation content, you might want to read this article next: Home Assistant is Now For Everybody!. If you found this article helpful, Subscribe to the On Motion Detected YouTube Channel, or sign up for our newsletter for more smart home automation content delivered to your inbox.

Leave a comment

Your email address will not be published. Required fields are marked *