Trying to set Alarmo to Armed Away when everybody leaves the house.
This is giving me this error
Message malformed: invalid template (TemplateSyntaxError: expected token ‘:’, got ‘}’) for dictionary value @ data[‘value_template’]
alias: Alarm Auto Arm
description: Arm the alarm when no one is home
trigger:
- platform: template
value_template:
{{ not is_state('device_tracker.life360_dad', 'home') and
{{ not is_state('device_tracker.life360_mom', 'home') and
not is_state('device_tracker.life360_son', 'home') }}
action:
- service: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: single
I tried removing myself
This does not throw errors but, it does not arm the system
alias: Alarm Auto Arm
description: When no one is home
trigger:
- platform: template
value_template:
# "{{ states('device_tracker.life360_detrie' != 'home') and
"{{ states('device_tracker.life360_mom' != 'home') and
states('device_tracker.life360_son' != 'home') }}"
action:
- service: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: single
I thought I would try with conditions.
No errors but will not Arm
alias: Alarm Auto Arm
description: When no one is home
trigger:
- platform: state
entity_id: device_tracker.life360_mom
to: not_home
- platform: state
entity_id: device_tracker.life360_son
to: not_home
condition:
- condition: template
value_template: >-
{{ states('device_tracker.life360_mom' , 'not_home') and
states('device_tracker.life360_son' , 'not_home') }}
action:
- service: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: away
mode: single
This seems to work… Unless someone can offer improvements
alias: Alarm Auto Arm
description: When no one is home
trigger:
- platform: state
entity_id: device_tracker.life360_mom
to: not_home
- platform: state
entity_id: device_tracker.life360_dad
to: not_home
- platform: state
entity_id: device_tracker.life360_son
to: not_home
condition:
- condition: state
entity_id: device_tracker.life360_mom
state: not_home
- condition: and
conditions:
- condition: state
entity_id: device_tracker.life360_dad
state: not_home
- condition: and
conditions:
- condition: state
entity_id: device_tracker.life360_son
state: not_home
action:
- service: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: away
mode: single