1
0
ansible-home-assistant/roles/scripts/files/30.pc-sleep.yaml

47 lines
1.3 KiB
YAML
Raw Normal View History

2021-05-24 22:10:22 +00:00
pc_sleep:
alias: PC Sleep
sequence:
- choose:
- conditions:
- condition: state
2022-05-05 22:50:00 +00:00
entity_id: binary_sensor.hulk_ping
2021-05-24 22:10:22 +00:00
state: 'on'
- condition: state
entity_id: input_boolean.pc_caffeine
state: 'off'
sequence:
- service: shell_command.pc_suspend
- service: input_boolean.turn_on
target:
entity_id: input_boolean.pc_sleeping
- conditions:
- condition: state
2022-05-05 22:50:00 +00:00
entity_id: binary_sensor.hulk_ping
2021-05-24 22:10:22 +00:00
state: 'off'
sequence: [ ]
default:
mode: single
icon: mdi:desktop-tower-monitor
pc_safe_off:
alias: PC Safe Off
sequence:
- choose:
- conditions:
- condition: state
2022-05-05 22:50:00 +00:00
entity_id: binary_sensor.hulk_ping
2021-05-24 22:10:22 +00:00
state: 'on'
sequence:
- service: shell_command.pc_poweroff
- wait_for_trigger:
- platform: state
2022-05-05 22:50:00 +00:00
entity_id: binary_sensor.hulk_ping
2021-05-24 22:10:22 +00:00
to: 'off'
- service: switch.turn_off
target:
entity_id: switch.computer_outlet
default: [ ]
- service: switch.turn_off
target:
entity_id: switch.computer_outlet
mode: single
icon: mdi:desktop-tower-monitor