As I typed this out I realized my solution feels complicated but it’s very powerful once you understand how it works it requires very little maintenance (only when you want to add a new warning; nothing changes for new devices).
- I use an input_select to track what the LEDs in an area are currently set to,
- a template sensor to track what they should be set to,
- a script to evaluate the sensors and figure out which effects, colors, and brightnesses to use,
- and a final script to identify all Inovelli dimmers, switches, and fan / light combos in an area and set their LEDs.
-
As a general principal I like to use the LED color for “cleared” / “normal” state, which changes from red at night to blue during the day, and effects are for warnings. They catch peoples’ attention and even guests know something is wrong.
-
I use a combination of template sensors and input_selects.
-
I use “areas” instead of groups. When a device is added to an area, it automatically gets the color and effect settings for that area without changing any scripts or automations.
Here are some snippets to show how it works. First, a template sensor to determine what I want an area to be:
- name: "Garage Door Status Should be Set to"
state: >
{# Garbage day, but not done #}
{% if is_state('binary_sensor.garbage_day', 'on') and
is_state('binary_sensor.garbage_out','on') %}
Garbage
{# It's cold / hot outside / thermostat is auto / heat / cool; close the dang door! #}
{% elif is_state('binary_sensor.garage_door', 'on') and
(float(states('sensor.current_temp_outside'), default=0) < 50.0 or
float(states('sensor.current_temp_outside'), default=0) >= 85.0) or
not is_state('climate.ecobee3_kitchen', 'off') %}
Thermal
{# prevents lights from timing out and turning off and locks from locking since I have no motion sensor in the garage #}
{% elif is_state('input_boolean.garage_in_use', 'on') %}
In Use
{% elif is_state('input_select.goodnight', 'Started') and
is_state('input_boolean.outside_rear_in_use', 'off') %}
Goodnight
{# We're shutting it down and locking it up. Get out. #}
{% else %}
Clear
{% endif %}
An input select template tracks the status of the door:
garage_door_status_is:
name: Garage House Door Status Is
options:
- Clear
- Thermal # Covers hot or cold outside as well as the EcoBee on
- Laundry # Laundry is done
- "In Use" # Warning that garage side door won't lock
- Goodnight # Sets the goodnight alerts if nothing else needs to be displayed.
From there, a simple automation can track any state change to sensor.garage_door_status_should_be_set_to
and call a script. I also track the “status_is” sensors, so I can manually set them to clear if I want and things take care of themselves. The automation for my downstairs warnings looks like:
alias: Inovelli Downstairs Warnings
description: >-
Handles Inovelli effects for events like open doors, areas in use, disabled
locks or lighting controls, and so on.
trigger:
- platform: state
entity_id: sensor.front_door_status_should_be
id: Front Door Status Should Be
- platform: state
entity_id: sensor.garage_house_door_status_should_be
id: Garage Door Status Should Be
- platform: state
entity_id: sensor.sliding_glass_door_status_should_be
id: Sliding Glass Door Status Should Be
- platform: state
entity_id: input_select.front_door_status_is
id: Front Door Status Is
- platform: state
entity_id: input_select.garage_house_door_status_is
id: Garage Door Status Is
- platform: state
entity_id: input_select.sliding_glass_door_status_is
id: Sliding Glass Door Status Is
condition:
- condition: or
conditions:
- condition: template
value_template: >-
{{ states('sensor.front_door_status_should_be') !=
states('input_select.front_door_status_is') }}
- condition: template
value_template: >-
{{ states('sensor.garage_house_door_status_should_be') !=
states('input_select.garage_house_door_status_is') }}
- condition: template
value_template: >-
{{ states('sensor.sliding_glass_door_status_should_be') !=
states('input_select.sliding_glass_door_status_is') }}
action:
- service: script.inovelli_downstairs_warnings
data: {}
mode: queued
max: 10
The script.inovelli_downstairs_warnings script is a series of choose services, one for each area, in order to determine what needs to change.
- service: script.inovelli_led_zwavejs
data_template:
area: garage
color: |
{% if is_state('sensor.garage_door_status_should_be', 'Thermal') %}
Red
{% elif is_state('sensor.garage_door_status_should_be', 'In Use') %}
Green
{% elif is_state('sensor.garage_door_status_should_be', 'Laundry') %}
Purple
{% elif is_state('sensor.garage_door_status_should_be', 'Goodnight') %}
Red
{% elif is_state('sensor.garage_door_status_should_be', 'Clear') %}
Off
{% endif %}
duration: |
{% if is_state('sensor.garage_door_status_should_be', 'Clear') %}
Off
{% else %}
Forever
{% endif %}
effect: |
{% if is_state('sensor.garage_door_status_should_be', 'Thermal') %}
Fast Blink
{% elif is_state('sensor.garage_door_status_should_be', 'In Use') %}
Pulse
{% elif is_state('sensor.garage_door_status_should_be', 'Laundry') %}
Pulse
{% elif is_state('sensor.garage_door_status_should_be', 'Goodnight') %}
Chase
{% elif is_state('sensor.garage_door_status_should_be', 'Clear') %}
Off
{% endif %}
brightness: 6
My script for setting colors and effects on Inovelli Red series devices will take an “area”, identify the appropriate entities, and update them in the appropriate service calls. There’s no need to tell it what type of devices or list the entities.