Turn lights on when Arlo detects motion

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

So it’s not possible to do it locally, you still have to go through the netgear API via their servers as the camera’s have an encryped connection there.

But at least it would remove the additional hop of the IFTTT server. I did have a look at this in the past but lacked the skills to code it up, and lacked the time to learn the skills :frowning:

I don’t know if you’ve solved this but there is a topic on a replacement arlo module for home assistant. I’ve installed it and seems to be working fine. I have a node-red automation set up so that if motion is triggered on any camera and it’s night then it turns on my hue lights outside. It does away with any requirement for IFTTT.

1 Like

+1 for the new Arlo module, I use it for motion detection and it works great so far. I believe they are looking into HACS integration. Hopefully it will eventually replace the existing arlo component.

1 Like