1
0
ansible-home-assistant/configuration/automations/bedroom-tv.yaml

79 lines
1.8 KiB
YAML
Raw Normal View History

- id: bedroom_tv_on
2022-08-07 21:55:25 +00:00
alias: '[Bedroom] TV On'
trigger:
- platform: state
2023-09-22 22:54:55 +00:00
entity_id: media_player.bedroom_tv
to: 'on'
2022-08-07 21:55:25 +00:00
condition:
- condition: state
entity_id: input_select.home_mode
state: Day
action:
- service: script.bedroom_tv_scene
2022-08-07 21:55:25 +00:00
- id: bedroom_tv_off
2022-08-07 21:55:25 +00:00
alias: '[Bedroom] TV Off'
trigger:
- platform: state
2023-09-22 22:54:55 +00:00
entity_id: media_player.bedroom_tv
2022-08-07 21:55:25 +00:00
to: 'off'
condition:
- condition: state
entity_id: input_select.home_mode
state: Day
action:
- service: script.bedroom_tv_off_scene
2022-12-08 07:53:47 +00:00
- id: bedroom_tv_turn_off_at_night
2022-12-08 07:53:47 +00:00
alias: '[Bedroom] TV turn off at night'
mode: single
trigger:
2023-09-22 22:54:55 +00:00
- platform: state
2023-11-07 01:25:18 +00:00
entity_id:
- input_select.home_mode
to: Night
2023-09-22 22:54:55 +00:00
for:
minutes: 30
- platform: state
entity_id: input_select.home_mode
2023-11-07 01:25:18 +00:00
to: Night
2023-09-22 22:54:55 +00:00
for:
minutes: 60
2023-11-07 01:25:18 +00:00
- platform: state
entity_id: media_player.bedroom_tv
to: on
for:
minutes: 30
2023-09-22 22:54:55 +00:00
condition:
- condition: state
entity_id: input_select.home_mode
state: 'Night'
2022-12-08 07:53:47 +00:00
action:
- service: media_player.turn_off
target:
entity_id: media_player.bedroom_tv
- id: bedroom_tv_off_at_night
2022-12-08 07:53:47 +00:00
alias: '[Bedroom] TV stay off at night'
mode: single
trigger:
- platform: state
2023-09-22 22:54:55 +00:00
entity_id: media_player.bedroom_tv
2022-12-08 07:53:47 +00:00
to: 'on'
condition:
- condition: time
before: "09:00:00"
after: "01:30:00"
2022-12-08 07:53:47 +00:00
action:
- service: media_player.turn_off
target:
entity_id: media_player.bedroom_tv
- service: switch.turn_off
target:
2023-09-22 22:54:55 +00:00
entity_id: media_player.bedroom_tv
- service: light.turn_off
entity_id:
- light.bedroom_lights
- light.bed_lightstrip
- light.bed_lamps