You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.9 KiB

######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# When we get out of bed at night, turn on the accent lights in the bathroom - and then turn off the lights when we are back in bed.
# Defines the When we get out of bed at night, turn on the accent lights in the bathroom triggers, conditions, and actions.
# -------------------------------------------------------------------
# Notes: Also turn on the lights sunset comes. (but only if we are home)
# Notes: connected to [Etekcity Outlets](https://amzn.to/2efNoBP)
# Notes: [433Mhz Transmitter and receiver](https://amzn.to/2dceNY2)
######################################################################
- alias: Bedtime Accent Light
id: 08fe7b86-7610-420a-8f4c-7adb86618900
trigger:
- platform: state
entity_id:
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
to: 'off'
- platform: state
entity_id: sun.sun
to: 'below_horizon'
from: 'above_horizon'
- platform: state
entity_id: group.family
from: 'not_home'
to: 'home'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: group.family
state: 'home'
action:
- service: switch.turn_on
entity_id: switch.master_bathroom_accent_1
- wait_template: >-
{{ not is_state('binary_sensor.sleepnumber_carlo_stacey_is_in_bed', 'off') or is_state('person.stacey', 'not_home')}}
- wait_template: >-
{{ not is_state('binary_sensor.sleepnumber_carlo_carlo_is_in_bed', 'off') or is_state('person.carlo', 'not_home') }}
- service: switch.turn_off
entity_id: group.master_bathroom_accents

Powered by TurnKey Linux.