I’m trying to setup an automation that turns off heating if nobody is at home but it triggers when one person state is home and other not_home.
Any ideas what is wrong with below code? In the attached screenshot from the web UI, condition says if both matches so I would expect it to trigger if both of us are not at home which is not the case.
automation turn-off-heating:
- alias: Turn off heating when nobody is at home
description: ""
trigger:
- platform: state
entity_id:
- person.dominik
- person.kasia
from: 'home'
to: 'not_home'
condition:
- and:
- condition: state
entity_id: person.dominik
state: 'not_home'
- condition: state
entity_id: person.kasia
state: 'not_home'
action:
- service: climate.set_hvac_mode
data:
hvac_mode: "off"
target:
area_id:
- entryway
- living_room
- office
- kids_room
- service: notify.pushover
data:
message: "Nobody is at home - turning off heating"
mode: single