I’m looking for some help with an automation that does not fire. I am relatively new to using a template to make an automation fire so I thought I would start with something simple. I have two boolean input switches, one for me and one for my wife. When I leave or she leaves, the switch turns off. When I or she come home, the switch turns on.
My goal is: when both my wife and I are away from home both of our switches will be off and the indoor cameras will turn on. I wrote the automation. I tested the automation by manually running it and it turns the cameras off or on as expected. I turn on or off the switches to simulate us being home or away but the automation never fires. I put the template into ‘Developer Tools → Template the results will show “true” or “false” as expected.
So why is my automation not firing?
Please note that I do not wish to use home or zones for presence detection. This automation is being run for our vacation condo and my HA is physically at my primary residence.
YAML for the automation to turn on cameras when both of us are not home
alias: PV everyone away turn on camera
description: ""
triggers:
- trigger: template
value_template: >-
"{{ is_state('input_boolean.pv_ds_home', 'off') and
is_state('input_boolean.pv_sc_home', 'off') }}"
conditions: []
actions:
- type: turn_on
device_id: d1ceb8ec8d1842287344f323f902226c
entity_id: d2ce8f892e0a1861d39dfef9cc9a41fd
domain: switch
- type: turn_on
device_id: b888bbd1a4ee2876166b6f121905e1f6
entity_id: 07c611818484404620edd9703529f77c
domain: switch
- type: turn_on
device_id: b4d6f5a549e2eeb42a59084fb3f0d52f
entity_id: 931bc109a014824d3104cd85d918083a
domain: switch
mode: single
YAML for the automation to turn off cameras when either of us are home
alias: PV off when anyone home
description: ""
triggers:
- trigger: template
value_template: >-
"{{ is_state('input_boolean.pv_ds_home', 'on') or
is_state('input_boolean.pv_sc_home', 'on') }}"
conditions: []
actions:
- type: turn_off
device_id: d1ceb8ec8d1842287344f323f902226c
entity_id: d2ce8f892e0a1861d39dfef9cc9a41fd
domain: switch
- type: turn_off
device_id: b888bbd1a4ee2876166b6f121905e1f6
entity_id: 07c611818484404620edd9703529f77c
domain: switch
- type: turn_off
device_id: b4d6f5a549e2eeb42a59084fb3f0d52f
entity_id: 931bc109a014824d3104cd85d918083a
domain: switch
mode: single
I appreciate any help I receive here in advance.