Add Adaptive Lighting Mode System foundation (Phase 1)
Implement the foundation for a comprehensive mode-based lighting control system for Inovelli Blue Dimmer Switches with Adaptive Lighting integration. This Phase 1 implementation includes: - Global mode definitions package (packages/adaptive_lighting_global.yaml) containing ROYGBIV color scheme mappings and mode settings for all standard modes (Adaptive, Reading, Theater, Sleep, etc.) - Inovelli mode cycling blueprint (blueprints/automation/inovelli_mode_cycling.yaml) enabling config button to cycle through lighting modes with LED feedback - Updated README with system overview, features, and quick start guide The system provides room-specific lighting modes with visual LED feedback, config button control, and git-trackable configuration via Home Assistant packages. Next phases will add mode application automations, button action blueprints, presence integration, and comprehensive documentation.
This commit is contained in:
49
README.md
49
README.md
@@ -1,5 +1,54 @@
|
|||||||
# Home Assistant Blueprints
|
# Home Assistant Blueprints
|
||||||
|
|
||||||
|
## Adaptive Lighting Mode System
|
||||||
|
|
||||||
|
A comprehensive mode-based lighting control system for Inovelli Blue Dimmer Switches with Adaptive Lighting integration.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- **Room-specific modes**: Define custom lighting modes per room (Reading, Theater, Sleep, etc.)
|
||||||
|
- **Visual LED feedback**: LED bar color indicates current mode
|
||||||
|
- **Config button control**: Press config button to cycle through modes
|
||||||
|
- **Multi-tap actions**: Double-tap boost, triple-tap max/night light
|
||||||
|
- **Adaptive Lighting integration**: Dynamic brightness and color following sun position
|
||||||
|
- **Version controlled**: All configuration in git-trackable package files
|
||||||
|
|
||||||
|
### System Components
|
||||||
|
|
||||||
|
**Blueprints** (Reusable):
|
||||||
|
- `inovelli_mode_cycling.yaml` - Config button cycles modes with LED feedback
|
||||||
|
- `inovelli_button_actions.yaml` - Multi-tap brightness controls (coming soon)
|
||||||
|
- `presence_mode_reset.yaml` - Auto-reset on room exit (coming soon)
|
||||||
|
|
||||||
|
**Packages** (Templates):
|
||||||
|
- `adaptive_lighting_global.yaml` - Shared mode definitions and colors
|
||||||
|
- `adaptive_lighting_bedroom_template.yaml` - Complete bedroom example (coming soon)
|
||||||
|
- `adaptive_lighting_living_room_template.yaml` - Living room example (coming soon)
|
||||||
|
|
||||||
|
### Quick Start
|
||||||
|
|
||||||
|
See [PACKAGE_SETUP_GUIDE.md](PACKAGE_SETUP_GUIDE.md) for detailed setup instructions (coming soon).
|
||||||
|
|
||||||
|
**Prerequisites**:
|
||||||
|
- Home Assistant with Adaptive Lighting integration installed
|
||||||
|
- Inovelli Blue Dimmer Switches (VZM31-SN) via Zigbee2MQTT
|
||||||
|
- Switches configured in Smart Bulb Mode
|
||||||
|
|
||||||
|
**Installation**:
|
||||||
|
1. Enable packages in `configuration.yaml`
|
||||||
|
2. Copy `packages/adaptive_lighting_global.yaml` to your `config/packages/` directory
|
||||||
|
3. Import blueprints via Home Assistant UI
|
||||||
|
4. Create automations from blueprints for each room
|
||||||
|
|
||||||
|
### Import URLs
|
||||||
|
|
||||||
|
**Blueprints**:
|
||||||
|
```
|
||||||
|
https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/blueprints/automation/inovelli_mode_cycling.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Occupancy Controlled Lights Blueprint
|
## Occupancy Controlled Lights Blueprint
|
||||||
|
|
||||||
Automatically control lights based on occupancy sensors with adaptive lighting support. Perfect for any room where you want lights to turn on when someone enters and turn off when they leave.
|
Automatically control lights based on occupancy sensors with adaptive lighting support. Perfect for any room where you want lights to turn on when someone enters and turn off when they leave.
|
||||||
|
|||||||
92
blueprints/automation/inovelli_mode_cycling.yaml
Normal file
92
blueprints/automation/inovelli_mode_cycling.yaml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# blueprints/automation/inovelli_mode_cycling.yaml
|
||||||
|
#
|
||||||
|
# Inovelli Config Button Mode Cycling
|
||||||
|
#
|
||||||
|
# Cycles through lighting modes when the config button is pressed on an
|
||||||
|
# Inovelli Blue Dimmer Switch (VZM31-SN) via Zigbee2MQTT.
|
||||||
|
#
|
||||||
|
# Features:
|
||||||
|
# - Cycles through available modes in input_select
|
||||||
|
# - Updates LED color to match new mode (ROYGBIV scheme)
|
||||||
|
# - Flashes LED to confirm mode change (3-second pulse)
|
||||||
|
#
|
||||||
|
# Requirements:
|
||||||
|
# - Inovelli Blue Dimmer (VZM31-SN) paired with Zigbee2MQTT
|
||||||
|
# - input_select helper with available modes
|
||||||
|
# - packages/adaptive_lighting_global.yaml for mode colors
|
||||||
|
#
|
||||||
|
# Reference: ADAPTIVE_LIGHTING_CONTROL_SYSTEM_DESIGN.md lines 144-182
|
||||||
|
|
||||||
|
blueprint:
|
||||||
|
name: Inovelli Config Button Mode Cycling
|
||||||
|
description: Press config button to cycle through lighting modes with LED feedback
|
||||||
|
domain: automation
|
||||||
|
input:
|
||||||
|
switch_action_sensor:
|
||||||
|
name: Switch Action Sensor
|
||||||
|
description: The sensor entity that reports button presses (sensor.xxx_action)
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
domain: sensor
|
||||||
|
integration: mqtt
|
||||||
|
|
||||||
|
mode_input_select:
|
||||||
|
name: Mode Input Select
|
||||||
|
description: The input_select helper that tracks current lighting mode
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
domain: input_select
|
||||||
|
|
||||||
|
led_color_entity:
|
||||||
|
name: LED Color Entity
|
||||||
|
description: The number entity for LED color when on (number.xxx_led_color_when_on)
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
domain: number
|
||||||
|
|
||||||
|
zigbee2mqtt_device_name:
|
||||||
|
name: Zigbee2MQTT Device Name
|
||||||
|
description: The device name in Zigbee2MQTT (for LED flash effect via MQTT)
|
||||||
|
example: "bedroom_switch"
|
||||||
|
selector:
|
||||||
|
text:
|
||||||
|
|
||||||
|
mode: single
|
||||||
|
max_exceeded: silent
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: !input switch_action_sensor
|
||||||
|
to: "config_single"
|
||||||
|
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
mode_select: !input mode_input_select
|
||||||
|
current_mode: "{{ states(mode_select) }}"
|
||||||
|
available_modes: "{{ state_attr(mode_select, 'options') }}"
|
||||||
|
current_index: "{{ available_modes.index(current_mode) }}"
|
||||||
|
next_index: "{{ (current_index + 1) % (available_modes | length) }}"
|
||||||
|
next_mode: "{{ available_modes[next_index] }}"
|
||||||
|
mode_colors: "{{ state_attr('input_text.adaptive_lighting_mode_colors', 'state') | from_json }}"
|
||||||
|
next_color: "{{ mode_colors.get(next_mode, 170) }}"
|
||||||
|
|
||||||
|
# Change to next mode
|
||||||
|
- service: input_select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: !input mode_input_select
|
||||||
|
data:
|
||||||
|
option: "{{ next_mode }}"
|
||||||
|
|
||||||
|
# Update LED color
|
||||||
|
- service: number.set_value
|
||||||
|
target:
|
||||||
|
entity_id: !input led_color_entity
|
||||||
|
data:
|
||||||
|
value: "{{ next_color }}"
|
||||||
|
|
||||||
|
# Flash LED to confirm mode change (3-second pulse)
|
||||||
|
- service: mqtt.publish
|
||||||
|
data:
|
||||||
|
topic: "zigbee2mqtt/{{ zigbee2mqtt_device_name }}/set"
|
||||||
|
payload: >-
|
||||||
|
{"led_effect": {"effect": "pulse", "color": {{ next_color }}, "level": 100, "duration": 3}}
|
||||||
170
packages/adaptive_lighting_global.yaml
Normal file
170
packages/adaptive_lighting_global.yaml
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
# packages/adaptive_lighting_global.yaml
|
||||||
|
#
|
||||||
|
# Global constants for Adaptive Lighting Mode System
|
||||||
|
# This file is shared across all rooms and should be version controlled.
|
||||||
|
#
|
||||||
|
# To use: Place in config/packages/ directory
|
||||||
|
# Enable packages in configuration.yaml:
|
||||||
|
# homeassistant:
|
||||||
|
# packages: !include_dir_named packages/
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# MODE COLOR MAPPINGS (ROYGBIV Scheme)
|
||||||
|
# =============================================================================
|
||||||
|
# These colors are used for LED feedback on Inovelli switches
|
||||||
|
# Values are hue (0-255) for Zigbee2MQTT ledColorWhenOn/Off parameter
|
||||||
|
#
|
||||||
|
# Reference ADAPTIVE_LIGHTING_CONTROL_SYSTEM_DESIGN.md lines 112-131
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
input_text:
|
||||||
|
adaptive_lighting_mode_colors:
|
||||||
|
name: "AL Mode Color Mappings (JSON)"
|
||||||
|
initial: >-
|
||||||
|
{
|
||||||
|
"Adaptive": 170,
|
||||||
|
"Reading": 42,
|
||||||
|
"Relaxing": 21,
|
||||||
|
"Sleep": 0,
|
||||||
|
"Manual Override": 212,
|
||||||
|
"Theater": 127,
|
||||||
|
"Party": 234,
|
||||||
|
"Homework": 85,
|
||||||
|
"Play": 148,
|
||||||
|
"Cooking": 42,
|
||||||
|
"Dining": 21,
|
||||||
|
"Cleanup": 170
|
||||||
|
}
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# MODE SETTINGS DEFINITIONS
|
||||||
|
# =============================================================================
|
||||||
|
# Standard settings for each mode
|
||||||
|
# Used as reference when creating mode application automations
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
adaptive_lighting_mode_settings:
|
||||||
|
name: "AL Mode Settings Reference (JSON)"
|
||||||
|
initial: >-
|
||||||
|
{
|
||||||
|
"Adaptive": {
|
||||||
|
"description": "Standard AL following sun",
|
||||||
|
"use_defaults": "configuration"
|
||||||
|
},
|
||||||
|
"Reading": {
|
||||||
|
"description": "Bright, cool white",
|
||||||
|
"min_brightness": 80,
|
||||||
|
"max_brightness": 100,
|
||||||
|
"min_color_temp": 4500,
|
||||||
|
"max_color_temp": 5500,
|
||||||
|
"transition": 2
|
||||||
|
},
|
||||||
|
"Relaxing": {
|
||||||
|
"description": "Dim, warm white",
|
||||||
|
"min_brightness": 20,
|
||||||
|
"max_brightness": 40,
|
||||||
|
"min_color_temp": 2000,
|
||||||
|
"max_color_temp": 2500,
|
||||||
|
"transition": 5
|
||||||
|
},
|
||||||
|
"Sleep": {
|
||||||
|
"description": "Very dim red/amber",
|
||||||
|
"min_brightness": 1,
|
||||||
|
"max_brightness": 5,
|
||||||
|
"min_color_temp": 2000,
|
||||||
|
"max_color_temp": 2000,
|
||||||
|
"sleep_rgb_color": [255, 50, 0],
|
||||||
|
"transition": 2
|
||||||
|
},
|
||||||
|
"Theater": {
|
||||||
|
"description": "Dim, cool for movies",
|
||||||
|
"min_brightness": 5,
|
||||||
|
"max_brightness": 20,
|
||||||
|
"min_color_temp": 3000,
|
||||||
|
"max_color_temp": 4000,
|
||||||
|
"transition": 3
|
||||||
|
},
|
||||||
|
"Party": {
|
||||||
|
"description": "Bright, dynamic for socializing",
|
||||||
|
"min_brightness": 60,
|
||||||
|
"max_brightness": 90,
|
||||||
|
"min_color_temp": 3500,
|
||||||
|
"max_color_temp": 4500,
|
||||||
|
"transition": 1
|
||||||
|
},
|
||||||
|
"Homework": {
|
||||||
|
"description": "Bright, neutral for focus",
|
||||||
|
"min_brightness": 85,
|
||||||
|
"max_brightness": 100,
|
||||||
|
"min_color_temp": 4000,
|
||||||
|
"max_color_temp": 5000,
|
||||||
|
"transition": 2
|
||||||
|
},
|
||||||
|
"Play": {
|
||||||
|
"description": "Medium bright, energizing",
|
||||||
|
"min_brightness": 60,
|
||||||
|
"max_brightness": 85,
|
||||||
|
"min_color_temp": 4000,
|
||||||
|
"max_color_temp": 5000,
|
||||||
|
"transition": 2
|
||||||
|
},
|
||||||
|
"Cooking": {
|
||||||
|
"description": "Bright, cool task lighting",
|
||||||
|
"min_brightness": 90,
|
||||||
|
"max_brightness": 100,
|
||||||
|
"min_color_temp": 4500,
|
||||||
|
"max_color_temp": 5500,
|
||||||
|
"transition": 1
|
||||||
|
},
|
||||||
|
"Dining": {
|
||||||
|
"description": "Medium, warm for meals",
|
||||||
|
"min_brightness": 40,
|
||||||
|
"max_brightness": 70,
|
||||||
|
"min_color_temp": 2500,
|
||||||
|
"max_color_temp": 3500,
|
||||||
|
"transition": 3
|
||||||
|
},
|
||||||
|
"Cleanup": {
|
||||||
|
"description": "Bright, standard for cleaning",
|
||||||
|
"min_brightness": 80,
|
||||||
|
"max_brightness": 100,
|
||||||
|
"min_color_temp": 4000,
|
||||||
|
"max_color_temp": 5000,
|
||||||
|
"transition": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# HELPER SCRIPTS
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
script:
|
||||||
|
get_mode_color:
|
||||||
|
alias: "Get LED Color for Mode"
|
||||||
|
description: "Returns the LED color value (0-255) for a given mode name"
|
||||||
|
fields:
|
||||||
|
mode:
|
||||||
|
description: "Mode name (e.g., 'Reading', 'Sleep')"
|
||||||
|
example: "Reading"
|
||||||
|
sequence:
|
||||||
|
- stop: "Color retrieved"
|
||||||
|
response_variable: "color"
|
||||||
|
response:
|
||||||
|
color: >-
|
||||||
|
{% set colors = state_attr('input_text.adaptive_lighting_mode_colors', 'state') | from_json %}
|
||||||
|
{{ colors.get(mode, 170) }}
|
||||||
|
|
||||||
|
get_mode_settings:
|
||||||
|
alias: "Get AL Settings for Mode"
|
||||||
|
description: "Returns the AL settings dictionary for a given mode"
|
||||||
|
fields:
|
||||||
|
mode:
|
||||||
|
description: "Mode name"
|
||||||
|
example: "Reading"
|
||||||
|
sequence:
|
||||||
|
- stop: "Settings retrieved"
|
||||||
|
response_variable: "settings"
|
||||||
|
response:
|
||||||
|
settings: >-
|
||||||
|
{% set all_settings = state_attr('input_text.adaptive_lighting_mode_settings', 'state') | from_json %}
|
||||||
|
{{ all_settings.get(mode, {}) }}
|
||||||
Reference in New Issue
Block a user