Automate Echo Glow accents and steady movie lighting

Refs #1827 and #2059
master
Carlo Costanzo 1 week ago
parent 1572e44eae
commit 7970c28c68

@ -39,7 +39,7 @@ Camera-verified garbage and recycling reminders: [`garbage_day_garage.yaml`](Spe
| [`late_night_brightness_guard.yaml`](late_night_brightness_guard.yaml) | Scoped 20:00-06:00 brightness cap for direct user-activated living-room and outdoor front-light groups; nested scene and automation contexts are excluded. [Watch Night Brightness](https://youtu.be/XRciHrQhcxk) [Night Brightness blog](https://www.vcloudinfo.com/2026/10/home-assistant-nighttime-light-brightness-automation.html). The article also provides a portable whole-house alternative; it does not change this scoped rule. |
| [`late_night_helper.yaml`](late_night_helper.yaml) | Nighttime arrival path with the living-room M1 front-right light explicitly limited to 25% brightness. |
Bathroom night lighting requires an explicit in-bed to out-of-bed transition; recovery from an unavailable bed sensor does not switch on the accent outlet. Sunset and arrival behavior remain unchanged.
Bathroom night lighting requires an explicit in-bed to out-of-bed transition; recovery from an unavailable bed sensor does not switch on the accent outlet. Sunset and arrival behavior remain unchanged. The [Echo Glow automation](echo_glow_accents.yaml) follows the kitchen accents by default and the bathroom accents at bedtime, both at 50%. Living room accents take priority and use a 50% minimum. During Roku playback or pause, the Glow holds steady gold at 50% while the living room accents are on. An active entry alert overrides every mode with red.
Living room entry alerts require a garage door to remain open for five seconds, then restore each light's prior state after all entry points are secure.

@ -0,0 +1,126 @@
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Echo Glow Accents - kitchen, bedtime, living room, and entry alerts
# Related Issue: 1827, 2059
# Notes: Entry alerts override steady gold during Roku playback.
# All active Glow modes use at least 50% brightness.
######################################################################
- alias: Echo Glow Accents
id: echo_glow_accents
mode: restart
triggers:
- trigger: state
entity_id: light.living_room_accents
- trigger: state
entity_id: media_player.living_room_ultra
to: null
id: roku_state
- trigger: state
entity_id: media_player.living_room_ultra
attribute: app_id
- trigger: state
entity_id:
- group.kitchen_accents
- group.master_bathroom_accents
- group.bed
to: ['on', 'off']
- trigger: state
entity_id: automation.living_room_red_on_entry_garage_open
attribute: current
- trigger: state
entity_id: automation.good_night_trigger
attribute: last_triggered
- trigger: state
entity_id: sun.sun
to: ['above_horizon', 'below_horizon']
- trigger: state
entity_id: light.echo_glow
from: ['unknown', 'unavailable']
to: ['on', 'off']
- trigger: homeassistant
event: start
actions:
# Let all lights in a scene settle before reading the group's color.
- delay:
milliseconds: 750
- condition: state
entity_id: light.echo_glow
state: ['on', 'off']
- variables:
living_room: light.living_room_accents
roku: media_player.living_room_ultra
minimum_brightness: 128 # 50% on the Home Assistant brightness scale.
tv_gold: [255, 215, 0]
bedtime_active: >-
{% set good_night = state_attr('automation.good_night_trigger', 'last_triggered') %}
{# The date shifted by 12 hours groups an evening and the following morning. #}
{{ is_state('sun.sun', 'below_horizon') and
(is_state('group.bed', 'on') or
(good_night is not none and
(as_local(good_night) - timedelta(hours=12)).date() ==
(now() - timedelta(hours=12)).date())) }}
source: >-
{% if state_attr('automation.living_room_red_on_entry_garage_open', 'current') | int(0) > 0 %}
entry_alert
{% elif is_state(living_room, 'on') and states(roku) in ['playing', 'paused']
and state_attr(roku, 'app_id') not in [none, '', 'dev'] %}
tv_time
{% elif is_state(living_room, 'off') %}
{{ 'group.master_bathroom_accents' if bedtime_active else 'group.kitchen_accents' }}
{% else %}
{{ living_room }}
{% endif %}
settings: >-
{% if source == 'entry_alert' %}
{{ {'rgb_color': [255, 0, 0], 'brightness_pct': 100} }}
{% elif source == 'tv_time' %}
{{ {'brightness': minimum_brightness, 'rgb_color': tv_gold} }}
{% elif not is_state(source, 'on') %}
{{ none }}
{% elif source == 'group.master_bathroom_accents' %}
{{ {'brightness': minimum_brightness, 'color_temp_kelvin': 2200} }}
{% elif source == 'group.kitchen_accents' %}
{{ {'brightness': minimum_brightness, 'color_temp_kelvin': 2700} }}
{% else %}
{% set brightness = state_attr(living_room, 'brightness') %}
{% set kelvin = state_attr(living_room, 'color_temp_kelvin') %}
{% set hs = state_attr(living_room, 'hs_color') %}
{% set level = {'brightness': [brightness | int(0), minimum_brightness] | max} %}
{% if is_state_attr(living_room, 'color_mode', 'color_temp') and kelvin is number %}
{{ dict(level, color_temp_kelvin=kelvin) }}
{% elif hs is not none %}
{{ dict(level, hs_color=hs) }}
{% else %}
{{ level }}
{% endif %}
{% endif %}
- if:
- condition: template
value_template: "{{ settings is mapping }}"
then:
# Send gold at movie start, then ignore changes that leave the Glow at the TV setting.
- condition: template
value_template: >-
{{ source != 'tv_time' or
(trigger is defined and trigger.id | default('') == 'roku_state' and
trigger.to_state.state == 'playing') or
not (is_state('light.echo_glow', 'on') and
is_state_attr('light.echo_glow', 'brightness', minimum_brightness) and
(state_attr('light.echo_glow', 'rgb_color') or []) | list == tv_gold) }}
- action: light.turn_on
target:
entity_id: light.echo_glow
data: "{{ settings }}"
else:
- condition: template
value_template: "{{ is_state(source, 'off') }}"
- condition: state
entity_id: light.echo_glow
state: 'on'
- action: light.turn_off
target:
entity_id: light.echo_glow
Loading…
Cancel
Save

Powered by TurnKey Linux.