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

90 lines
2.0 KiB
YAML
Raw Permalink 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
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
2023-12-15 13:17:28 +00:00
to: "on"
2023-11-07 01:25:18 +00:00
for:
minutes: 60
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
- id: bedroom_lamp_off_at_night
alias: '[Bedroom] Turn off lamps at night'
mode: single
trigger:
- platform: state
entity_id:
- media_player.bedroom_tv
to: "off"
for:
hours: 0
minutes: 5
seconds: 0
action:
- service: light.turn_off
target:
entity_id: light.bed_lamps