Docker/ha/config/packages/house/people/simon/work_state.yaml

65 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

automation:
- id: simon_work_home
alias: Simon – works from home
trigger:
- platform: state
entity_id:
- device_tracker.rd0203606
- device_tracker.simon_jobbdator
condition:
- condition: time
after: "08:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: or
conditions:
- condition: state
entity_id: device_tracker.rd0203606
state: "home"
- condition: state
entity_id: device_tracker.simon_jobbdator
state: "home"
action:
- service: input_select.select_option
target:
entity_id: input_select.simon_work_state
data:
option: "Hemma"
- id: simon_work_office
alias: Simon – works at office
trigger:
- platform: state
entity_id:
- device_tracker.rd0203606
- device_tracker.simon_jobbdator
condition:
- condition: time
after: "08:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: and
conditions:
- condition: state
entity_id: device_tracker.rd0203606
state: "not_home"
- condition: state
entity_id: device_tracker.simon_jobbdator
state: "not_home"
action:
- service: input_select.select_option
target:
entity_id: input_select.simon_work_state
data:
option: "På jobbet"