mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
alias: "Computer Area Not Occupied"
|
|
id: automation_computer_area_not_occupied
|
|
mode: restart
|
|
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.home_occupied
|
|
from: "on"
|
|
to: "off"
|
|
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.home_occupied
|
|
- binary_sensor.computer_area_occupied
|
|
to: "off"
|
|
for: "00:15:00"
|
|
|
|
# - platform: time_pattern
|
|
# minutes: "/5"
|
|
|
|
condition:
|
|
- alias: "Room is considered occupied"
|
|
condition: state
|
|
entity_id: input_boolean.computer_area_occupied
|
|
state: "on"
|
|
|
|
- alias: "Lights are not forced to be turned off manually"
|
|
condition: state
|
|
entity_id: input_boolean.lights_off_manually
|
|
state: "off"
|
|
|
|
- alias: "Either the home is unoccupied, or no presence has been detected in the room for 15 minutes"
|
|
condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.home_occupied
|
|
state: "off"
|
|
- condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.computer_area_person_occupancy
|
|
state: "off"
|
|
for:
|
|
minutes: 15
|
|
- condition: state
|
|
entity_id: binary_sensor.computer_area_occupied
|
|
state: "off"
|
|
for:
|
|
minutes: 15
|
|
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.home_occupied
|
|
state: "off"
|
|
sequence:
|
|
- action: homeassistant.turn_off
|
|
entity_id: input_boolean.computer_area_occupied
|
|
- conditions:
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_select.house
|
|
state: "Manual"
|
|
sequence:
|
|
- action: homeassistant.turn_off
|
|
entity_id: input_boolean.computer_area_occupied
|