Turn lights on when Arlo detects motion

Has anyone been able to setup automations with triggers from Arlo camera?

When Arlo detects a motion, I’d like to send a notification and turn on a light.

If some related entity changes state then you can use it. You need to look in the dev-states menu (<>):
image

When the camera detects motion (which you need to enable) note which entity changes state, and what it changes state to.

Relevant cookbook examples include this and this. You’ll end up with something like:

automation:
- alias: Theres been motion
  trigger:
    - platform: state
      entity_id: camera.arlo_frontdoor
      to: 'on'
  action:
    - service: light.turn_on
      entity_id: light.kitchen_light
    - service: notify.mypushbullet
      data_template:
        title: "There was motion"
        message: "Something happened by the front door"

And you’ll want to turn the light off again:

automation:
- alias: Theres been motion
  trigger:
    - platform: state
      entity_id: camera.arlo_frontdoor
      to: 'off'
      for:
        minutes: 5
  action:
    - service: light.turn_off
      entity_id: light.kitchen_light

Adjust all the entities (and the state) to match your system.

Hi,
Thank you for taking the time to reply.
Unfortunately, I’ve been playing with this for past 10 hrs and still unsuccessful.

The arlo camera component (camera.tv_room) shows ‘idle’ . The sensor component that got auto-created (sensor.arlo_cameras) just shows ‘unknown
During a motion trigger, none of these attributes change.

Motion detection is enabled with “camera.enable_motion_detection
Arlo control panel is also armed_away with “alarm_control_panel.alarm_arm_away
I get a message directly form Arlo that motion was detected, but the automation from HA doesn’t trigger.

Any clues whether i am not looking at the right places?
how can i setup an action when motion is triggered/detected?

See those things I posted :wink:

You’re looking in generally the right place, but it might be that there’s nothing pushed to HA when motion is detected. I don’t have Arlo so don’t know.

Thank you.
Hopefully an Arlo-owner would come along and give me the smoking gun :slight_smile:

This is currently a bit tricky with Arlo, since the cameras in hass currently don’t actually report when there’s motion detected.

What I did is to use IFTTT (now Stringify since ifttt seems to have issues with Arlo) to flip a switch when it detects motion, so that I can take action on it in hass.

I don’t use camera.enable_motion_detection, but instead the alarm control panel, which allows for custom armed and home modes, where my home mode has motion detection enabled, but no notifications: https://github.com/joch/home-assistant-config/blob/master/configuration.yaml#L156

Have a look here for handling the switch: https://github.com/joch/home-assistant-config/blob/master/automation/internal/arlo.yaml

and here for an automation using Arlo motion to trigger lights: https://github.com/joch/home-assistant-config/blob/master/automation/hallway/lights.yaml#L27

Having motion enabled all the time will drain the batteries pretty quick though, so I’m currently moving away from using Arlo for motion detection (replacing with xiaomi motion sensors), and only using it for its home alarm features.

Hi joch,
thank you for sharing your config info. very helpful.
At first i decided to get stringify working with Arlo, but then decided to code this into HA itself.
For the benefit of anyone who comes along with similar needs, here’s sharing my completed code (confirmed to e working):

First define an input_number: (Assign any initial random value; it’ll get overridden at HA startup anyway in next step)

 var_captured_today_tv_room_arlo:
   name: tv_room_captured_today
   initial: 999
   min: 0
   max: 1000

Then, overwrite this initial value from arlo’s last known value (sensor.captured_today_tv_room):

# HA startup 
- id: enable_arlo_upon_ha_start
  alias: enable Arlo upon HA start
  initial_state: 'on'
  trigger:
    platform: homeassistant
    event: start
  action:
# initialize var to be equal to arlo's value at hass startup
    - service: input_number.set_value
      data_template:
        entity_id: input_number.var_captured_today_tv_room_arlo
        value: "{{ states.sensor.captured_today_tv_room.state | float }}"  

Finally, action when a trigger is detected:

# When alarm is triggered 
- alias: "Turn on lights when Arlo detects motion"
  trigger:
    platform: numeric_state
    entity_id: sensor.captured_today_tv_room
    value_template: "{{states.sensor.captured_today_tv_room.state | float - states.input_number.var_captured_today_tv_room_arlo.state | float}}"
    above: 0
    below: 2
  action:
# Turn on light at full 100% brightness & send a notification
    - service: notify.pushbullet
      data:
        message: 'Arlo has detected motion'
    - service: homeassistant.turn_on
      entity_id: switch.kitchen_led_power
    - service: homeassistant.turn_on
      entity_id: switch.kitchen_led_100
# set var equal to arlo's value. Wait 5 mis to handle multiple triggers in quick succession
    - delay:
        minutes: 5
    - service: input_number.set_value
      data_template:
        entity_id: input_number.var_captured_today_tv_room_arlo
        value: "{{ states.sensor.captured_today_tv_room.state | float }}"  
# Turn off light
    - service: homeassistant.turn_on
      entity_id: switch.kitchen_led_power
1 Like

I’ve corrected the formatting of your first block, to show you how it should be done (rather than quotes). Please edit your post and do that for the rest, so people can use what you posted.

See the large blue box at the top of this (and every) page for more details.

1 Like

how about now?

Thanks - means people can copy and paste without (as many) tears :slight_smile:

That’s great! :slight_smile: It requires you to enable recording when detecting motion though, which will drain the batteries even more.

This is exactly what I was looking for, Thanks.
I am a Noob. Would this go into automations.yaml?

I actually plugged it into a file i called arlo.yaml
This arlo.yaml file is then linked to automations.yaml using the ‘include’ function.

joch - Could you please post what you write in stringify? Trying to get something like what you described going but I can’t get stringify to work.

Sorry, but I don’t use Stringify anymore and have deleted the recipes. The basics are to add the Arlo app, and then trigger the an alarm in Home Assistant using a HTTP API call.

I just trigger when the “last” value updates for the individual cameras: https://github.com/joch/home-assistant-config/blob/master/automation/home/alarm.yaml#L234

Hi Guys,

Thanks for this information i’m trying to get my Arlo to work with my Hive bulbs but i’m struggling to understand where I need to put this code, can i put it all in automation including the stuff that has to run when HA boots up? @amritgary & @Tinkerer

Thanks in advance

Please don’t tag random folks - it comes across as you demanding they answer you.

Hi Tinkerer, i was only tagging you both as it seems you have inputted the most into the subject and would be notified of me posting on this thread in the hope one of you would reply back to help is all :).

I’m just having difficulty to get the lights to turn on when motion is detected.

this is my current configuration in my automation.yaml file

  • alias: Camera detects motion
    trigger:
    platform: state
    entity_id: camera.arlo_side_of_house
    to: ‘on’
    condition:

    • condition: time
      after: ‘17:00’
      before: ‘06:30’
      action:
    • service: homeassistant.turn_on
      entity_id: light.hall_way
      data:
      transition: 15
  • alias: Motion Sensor Lights Off
    trigger:

    • platform: state
      entity_id: camera.arlo_side_of_house
      to: ‘off’
      for:
      minutes: 15
      action:
    • service: homeassistant.turn_off
      entity_id: light.hall_way
      data:
      transition: 160

I don’t believe there are any events for motion on the arlo cameras with the home assistant integration. I certainly don’t see any with my Arlo Q.

I have setup some applets in ifttt to call into home assistant:

Hi,
This is my experience with arlo motion detection:

  1. I tried the method described above, with an automation and binary sensor using a value template that monitored the Arlo “last_captured” parameter. But it din´t work very well for me. I think I abandoned it due to lag (last_capture is slow…). Also, It drained Arlo batteries as mentioned above.

So now I use IFTTT

  1. I have reliably used Arlo+IFTTT for a while. A applet in IFTTT sends changes an input_boolean in HA for each camera. Then I have configured binary sensors in HA to monitor each input boolean and voila, I have a motion sensor for each camera :slight_smile:

It works very well, does not drain any batteries, but unfortunately Arlo+IFTTT have a delay of 3-10s before it sends changes to my input_boolean. I think that a big part of that delay is the arlo camera native wake-up-time.

It works well, its reliable, but it´s much slower than an ordinary PIR sensor.

I would be very happy if anyone with more skills than I have, could dig into the arlo component to add a sensor in HA that could be used for motion detection. Im thinking that if IFTTT have reliable motion detection with arlo, it must be possible to do it locally without IFTTT as well.

1 Like