Home-AssistantConfig/automation/tv_time_on_and_off.yaml

62 lines
1.6 KiB
YAML
Raw Normal View History

2016-10-19 17:47:13 +00:00
######################################################################
## TV Time at sunset or 8pm. Whichever is later.
######################################################################
- alias: TV Time
trigger:
- platform: sun
event: sunset
2016-10-19 17:38:48 +00:00
offset: '+01:00:00'
- platform: event
event_type: tv_time
2016-10-12 17:22:09 +00:00
- platform: state
entity_id: sensor.samsungtv
2016-11-27 18:40:52 +00:00
state: 'Online'
2016-10-19 17:38:48 +00:00
- platform: time
after: '20:00:00'
2016-10-12 17:22:09 +00:00
condition:
condition: and
conditions:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: sensor.samsungtv
2016-11-27 18:40:52 +00:00
state: 'Online'
- condition: state
entity_id: sun.sun
state: 'below_horizon'
2016-10-18 01:09:31 +00:00
- condition: state
2016-10-18 00:52:04 +00:00
entity_id: input_boolean.guest_mode
state: 'off'
2016-10-12 17:22:09 +00:00
action:
service: scene.turn_on
entity_id: scene.living_room_tv_time
2016-11-10 18:26:44 +00:00
######################################################################
## Turn off the Living room lights when the TV is turned off.
######################################################################
- alias: TV Time off
trigger:
- platform: state
entity_id: sensor.samsungtv
2016-11-27 18:40:52 +00:00
state: 'Offline'
2016-11-10 18:26:44 +00:00
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
service: light.turn_off
entity_id:
- group.living_room
- group.living_room_accents