mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-02-20 16:21:58 +00:00
62 lines
1.6 KiB
YAML
Executable File
62 lines
1.6 KiB
YAML
Executable File
######################################################################
|
|
## TV Time at sunset or 8pm. Whichever is later.
|
|
######################################################################
|
|
|
|
- alias: TV Time
|
|
trigger:
|
|
- platform: sun
|
|
event: sunset
|
|
offset: '+01:00:00'
|
|
- platform: event
|
|
event_type: tv_time
|
|
- 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:
|
|
service: scene.turn_on
|
|
entity_id: scene.living_room_tv_time
|
|
|
|
######################################################################
|
|
## 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 |