Alarm Panel automation for multiple alarms with aarlo

Just getting started with Home Assistant automations… I’m using the aarlo integration and have been able to get this setup correctly. However with the newer Arlo cameras, they all appear as separate alarm panel entities. I am trying to create a manual alarm panel that has 4 modes [arm_away, arm_home, arm_night, disarm] and then map each of those modes to a different set of the aarlo alarm panel entities. Something like this:

Desired mapping:

home_alarm.state = disarmed -> camera1=disarmed, camera2=disarmed, camera3=disarmed
home_alarm.state = arm_home -> camera1=armed, camera2=disarmed, camera3=disarmed
home_alarm.state = arm_night -> camera1=armed, camera2=armed, camera3=disarmed
home_alarm.state = arm_away -> camera1=armed, camera2=armed, camera3=armed

Here is the config I have now.

configuration.yaml:
alarm_control_panel:
  - platform: aarlo
    away_mode_name: armed
    home_mode_name: armed
    night_mode_name: armed
    trigger_time: 30
    alarm_volume: 8
  - platform: manual
    name: Home Alarm
    code: !secret alarm_code

automations.yaml:
- id: "1630711012673"
  alias: Arlo State
  description: Arm/Disarm the Arlo Cameras based on the main alarm state
  trigger:
    - platform: state
      entity_id: alarm_control_panel.home_alarm
      to: arm_home
    - platform: state
      entity_id: alarm_control_panel.home_alarm
      to: arm_away
    - platform: state
      entity_id: alarm_control_panel.home_alarm
      to: arm_night
    - platform: state
      entity_id: alarm_control_panel.home_alarm
      to: disarm
  action:
    - service: alarm_control_panel.alarm_arm
      data_template:
        entity_id: >
          {% if trigger.to_state == \"arm_home\" %}
            alarm_control_panel.aarlo_camera1
          {% else if trigger.to_state == \"arm_night\" %}
            alarm_control_panel.aarlo_camera1,
            alarm_control_panel.aarlo_camera2
          {% else if trigger.to_state == \"arm_away\" %}
            alarm_control_panel.aarlo_camera1,
            alarm_control_panel.aarlo_camera2,
            alarm_control_panel.aarlo_camera3
          {% endif %}
    - service: alarm_control_panel.alarm_disarm
      data_template:
        entity_id: >
          {% if trigger.to_state == \"arm_home\" %}
            alarm_control_panel.aarlo_camera2,
            alarm_control_panel.aarlo_camera3
          {% else if trigger.to_state == \"arm_night\" %}
            alarm_control_panel.aarlo_camera3
          {% else if trigger.to_state == \"disarm\" %}
            alarm_control_panel.aarlo_camera1,
            alarm_control_panel.aarlo_camera2,
            alarm_control_panel.aarlo_camera3
          {% endif %}
  mode: single

However I can’t seem to get this working right. Maybe an automation isn’t the right way to go?

When I attempt to switch the home_alarm to arm_away, then I get the following error:

2021-09-08 08:30:45 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: invalid template (TemplateSyntaxError: unexpected char '\\' at 26) for dictionary value @ data['action'][0]['data_template']. Got None. (See /config/configuration.yaml, line 8).

In this came config, I’m also looking for a way to transition from one armed state to another. From the lovelace alarm panel, when the home_alarm manual alarm entity is set to any of the armed states, the only available option is to disarm. Is there a way to have the other arm states available as choices when the panel is already armed?

Is there a better way to do this?

Firstly I am no expert and probable would have tried to achieve your templates as simple choose options in the UI as I find it easier to read.

However is it possible to change the device type of the aarlo’s to say a switch? There for making life a lot easier.

Failing that if I assume right that the aarlo alarm entities do not need a code to change state? Then I probably would have created 4 scenes for the 4 wanted states (armed, disarmed, night, away etc) and added them all to each scene in the required state.

I would then make an automation with the 4 home_alarm states as triggers and then simply used a choose action based on trigger to activate required scene.

That’s all assuming you can’t change the device type. Also did you specifically want to use an alarm panel to activate these scenes as you could easily use a drop down help to activate them.

Hello,

maybe someone can help me as i am stucked in an automation:
I use the Arlo Cameras, having no subscription. So i want to automate it with HA as this gives better possibilities as via app.
I want to arm when i leave my homezone - and vice versa disarm when entering my homezone. But s.th. fails…

This is my automation for entering the zone (i added a condition to only do this when it is outside a configurable time range using helpers; i have always on during night):

id: '1605799910745'
alias: enter homezone
description: Arlo off when entering homezone
trigger:
  - platform: zone
    entity_id: person.ralf
    zone: zone.home
    event: enter
condition:
  - condition: not
    conditions:
      - condition: time
        after: input_datetime.security_arlo_on
action:
  - service: alarm_control_panel.alarm_arm_home
    data: {state: disarmed}
    entity_id: alarm_control_panel.aarlo_sehnix
mode: single
1 Like