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.
171 lines
5.3 KiB
YAML
171 lines
5.3 KiB
YAML
# 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, {}) }}
|