I am trying to make an automation that will turn on/off an input boolean (used to control my home alarm) depending if me and my wife have left our home or if one of us is home.
I can see the change happening (me/us going from “home” to “away”) but the automation is never triggered, I tried using the geolocation trigger as well but that had the same effect, input boolean was not changed, what is it that I am missing?
- id: '1598772461367'
alias: LARM Auto ON me
description: ''
trigger:
- entity_id: person.me
from: home
platform: state
to: away
condition:
- condition: state
entity_id: person.wife
state: away
action:
- data: {}
entity_id: input_boolean.alarm_on
service: input_boolean.turn_on
mode: single
Well after not being able to understand why the built in functionality is borken or why I cant make it work I decided to follow your suggestion, for those who are interested it ended upp looking like this:
# Alarm sensor true if both are away
- platform: template
sensors:
away:
friendly_name: "away"
value_template: >-
{% if is_state('person.me', 'home')
and is_state('person.wife', 'home')%}
false
{% else %}
true
{% endif %}
# Alarm sensor true if one is home
- platform: template
sensors:
home:
friendly_name: "home"
value_template: >-
{% if is_state('person.me', 'home')
or is_state('person.wife', 'home')%}
true
{% else %}
false
{% endif %}
Are you still using this or have you come up with anything different? Just curious, I have 4 people in my house and I have Ring Alarm integration setup. I want the alarm to arm when everyone leaves and disarm if any one of us come home.
I still use this, I have not checked if the geolocation functions are working now.
This is the code I have now:
# Alarm sensor true if both are away
- platform: template
sensors:
away:
friendly_name: "away"
value_template: >-
{% if is_state('person.me_mobile', 'home')
or is_state('person.wife_mobile', 'home')%}
false
{% else %}
true
{% endif %}
# Alarm sensor true if one is home
- platform: template
sensors:
home:
friendly_name: "home"
value_template: >-
{% if is_state('person.me_mobile', 'home')
or is_state('person.wife_mobile', 'home')%}
true
{% else %}
false
{% endif %}
You could also just use on the statements above and switch a boolean, you do not need both of them, I just have not had the time to rewrite the automatons and these functions.