looking for some help on an automation.
i’ve set it up so that, when the last person leaves the house, it turns off everything, adjusts the heating temp etc etc
I’ve set up what i thought would be correct, but the automation never triggers, even though HA knows that there is no-one “home”.
alias: When The Last Person Leaves Home
description: Automation that turns off all non-required devices when no one is home
triggers:
- trigger: numeric_state
entity_id:
- zone.home
attribute: persons
below: 1
for:
hours: 0
minutes: 0
seconds: 10
alias: When no-one is at home
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id:
- bedroom
- living_room
- kitchen
- hall
- garden
- office
alias: Turn off lights in all rooms
- action: climate.set_temperature
metadata: {}
data:
temperature: 15
target:
entity_id:
- climate.office
- climate.bedroom
- climate.living_room
alias: Set temperature in all rooms to 15 degrees
- type: turn_off
device_id: c366ceaef0c95a2e4d8c98d5255f18fc
entity_id: 4ed714acbd203f1e9eeb1057be1d9922
domain: switch
alias: Turn off bedroom de-humidifier
- type: turn_off
device_id: 8406611c0b8878e3c427f28db334558d
entity_id: 730beb7699275c4ccf0a8aca5f9fb08b
domain: switch
alias: Turn off bedroom fan
- action: media_player.turn_off
metadata: {}
data: {}
target:
device_id:
- a96f23dc8f9ce8d2439eecb5fcdf6b76
- 7549bd55ee54b23e2061a796c7228a54
- 1b58b03343cc3ac38df5c2616ef0b206
enabled: true
alias: Turn off media players
- action: notify.mobile_app_simons_iphone
metadata: {}
data:
message: test no-one is home
title: My Home
alias: Send notification to Simons phone
mode: single
and this is what HA was reporting when no-one was home (i had left the house about 5 minutes earlier - other person had left much earlier than me)
i’m guessing the automation isn’t picking if the change from 1 to 0 in zone.home or something like that, as it appears all the other triggers are correct

