2017-02-15 18:06:51 +00:00
|
|
|
######################################################################
|
|
|
|
## TV Time at sunset or 8pm. Whichever is later.
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
- alias: TV Time
|
|
|
|
trigger:
|
|
|
|
- platform: sun
|
|
|
|
event: sunset
|
|
|
|
offset: '+01:00:00'
|
2017-02-23 21:50:00 +00:00
|
|
|
- platform: state
|
|
|
|
entity_id: input_boolean.TV_time
|
|
|
|
state: 'on'
|
|
|
|
from: 'off'
|
2017-02-15 18:06:51 +00:00
|
|
|
- platform: state
|
|
|
|
entity_id: sensor.samsungtv
|
|
|
|
state: 'Online'
|
|
|
|
- platform: time
|
|
|
|
after: '20:00:00'
|
|
|
|
|
|
|
|
condition:
|
|
|
|
condition: and
|
|
|
|
conditions:
|
|
|
|
- condition: state
|
|
|
|
entity_id: group.family
|
|
|
|
state: home
|
|
|
|
- condition: state
|
|
|
|
entity_id: sensor.samsungtv
|
|
|
|
state: 'Online'
|
|
|
|
- condition: state
|
|
|
|
entity_id: sun.sun
|
|
|
|
state: 'below_horizon'
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
state: 'off'
|
|
|
|
|
|
|
|
action:
|
2017-02-23 21:50:00 +00:00
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.tv_time
|
2017-02-24 01:19:57 +00:00
|
|
|
- service: scene.turn_on
|
|
|
|
entity_id: scene.tv_time
|
|
|
|
|
2017-02-15 18:06:51 +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
|
|
|
|
state: 'Offline'
|
|
|
|
|
|
|
|
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
|