43 Commits

Author SHA1 Message Date
96ab81f7ae Fix Adaptive mode not restoring lighting conditions
The blueprint was unconditionally overriding use_defaults to 'current',
preventing modes from specifying their own use_defaults value. This caused
Adaptive mode (which uses use_defaults: 'configuration') to keep the current
settings instead of resetting to configuration defaults.

Modified the data template to conditionally add use_defaults: 'current' only
when not already present in al_config, allowing modes like Adaptive to use
their specified value while maintaining backward compatibility.
2025-12-21 18:27:46 -08:00
aeb9d99930 Fix YAML block scalar causing template line-wrapping in blueprints
Replace block scalar (>-) with regular quoted strings for settings_entity
templates. The block scalar was causing Home Assistant to wrap lines in
the middle of the replace() function call, breaking the template parsing.

This fixes:
- LED color not updating in mode cycling automation
- Mode settings not being applied in apply mode automation

The templates now stay on a single line and parse correctly.
2025-12-21 18:10:46 -08:00
6f612787a1 Update Inovelli mode cycling blueprint to use nested schema
Replace reference to deleted adaptive_lighting_mode_colors entity with
convention-based mode settings lookup. The blueprint now extracts led_color
from each mode's nested JSON schema (input_text.adaptive_lighting_settings_{{mode}})
instead of using a separate color mapping entity.

This fixes the error:
"ValueError: Template error: from_json got invalid input 'unknown' when
rendering template '{{ states('input_text.adaptive_lighting_mode_colors') | from_json }}'"
2025-12-21 18:03:52 -08:00
16319e5bc4 Fix blueprint input section structure to nest under blueprint key
Move input definitions from root level to be nested under the blueprint
section. Home Assistant requires input declarations to be under
blueprint.input, not at the root level.

This fixes import errors:
- "Missing input definition for adaptive_lighting_switch, led_color_entity, mode_input_select"
- "Missing input definition for sunrise_time, sunset_time, weekend_mode_boolean, adaptive_lighting_switch, max_brightness"
- "Missing input definition for toggle_time, weekend_mode_boolean"
2025-12-21 17:53:47 -08:00
14fadbe44e Add custom mode tutorial and update docs for pure blueprint architecture
Add ADDING_MODES.md tutorial covering:
- UI-created modes (recommended) and package-defined modes
- Complete schema reference with nested al_config
- Behavior types (adaptive_lighting, scene, script)
- Manual control support and advanced examples

Update all documentation to reflect:
- Zero YAML editing for room setup (UI-driven workflow)
- Convention-based mode lookup pattern
- Pure blueprint architecture (3 core + 3 optional blueprints)
- Extensibility via helpers instead of template copying
2025-12-21 17:44:47 -08:00
a5ed6c6340 Refactor global package to nested schema
Convert mode definitions from flat to nested JSON schema:
- Embed LED colors in mode settings (remove separate color mapping)
- Add behavior, manual_control, and led_color to top level
- Nest AL settings in al_config object for service validation
- Reduce from 11 to 8 essential modes (remove Reading, Homework, Play)

Modes now use nested structure to avoid AL service validation errors
while maintaining extensibility for different behavior types.
2025-12-21 17:44:32 -08:00
8f2bce6759 Add data-driven blueprint architecture for adaptive lighting modes
Implement three core blueprints using convention-based entity lookup:
- apply_lighting_mode: Dynamic mode application with behavior polymorphism
- weekend_mode_schedule: Auto-enable/disable based on day of week
- weekend_mode_apply_settings: Apply AL adjustments for weekends

Blueprints use convention over configuration, allowing unlimited custom
modes without code changes. Modes discovered via naming pattern:
input_text.adaptive_lighting_settings_{{mode}}
2025-12-21 17:44:15 -08:00
d486f20378 Remove validate_yaml script 2025-12-21 15:52:14 -08:00
7a92040822 Add gitignore 2025-12-21 15:52:06 -08:00
63dec6c5ee Add Inovelli Blue Dimmer switch hardware documentation 2025-12-21 15:51:08 -08:00
40e03d0300 Reorganize blueprints: move legacy blueprints to blueprints/automation 2025-12-21 15:50:59 -08:00
4b285770d2 Fix presence_mode_reset blueprint variable scoping issue
Move condition check into action sequence after variables are defined.
Previously, the condition tried to use 'occupancy_sensors' before it was
defined, causing UndefinedError during automation execution.
2025-12-21 15:35:23 -08:00
a5a6b9d4b6 Add comprehensive documentation and testing tools
- Update README with complete setup guide and all blueprint URLs
- Add PACKAGE_SETUP_GUIDE with step-by-step setup instructions
- Add ROOM_CONFIGURATION_GUIDE with bedroom, living room, and bathroom examples
- Add HARDWARE_TESTING_CHECKLIST for validating with real Inovelli switches
- Add CHANGELOG documenting v1.0.0 release
- Add validation script for automated YAML testing
- Add test configuration example for testing without hardware
2025-12-21 14:30:53 -08:00
5eec41a43c Add button actions and presence reset blueprints
- Add inovelli_button_actions blueprint for multi-tap controls
  - Double-tap up: brightness boost (+50%)
  - Double-tap down: return to adaptive lighting
  - Triple-tap up: max brightness (100%, 4000K)
  - Triple-tap down: night light (5%, warm red)
  - Configurable auto-reset timeout

- Add presence_mode_reset blueprint for occupancy integration
  - Auto-reset manual control when room empty
  - Optional mode reset to default
  - Configurable empty delay
  - Multiple occupancy sensor support

- Fix entity name in living room template (light.living_room_lights)
2025-12-21 14:30:41 -08:00
602a2b7e78 Phase 2 2025-12-20 15:36:06 -08:00
27d322f09f Update feedback flash to 0.5 seconds 2025-12-20 15:33:41 -08:00
4f344e7b16 Fix inovelli_mode_cycling blueprint trigger for event entities
Correct the trigger mechanism to match how Home Assistant event entities
actually work. Event entities trigger on state changes and expose the
actual event type as an attribute, not as event_data.

Changes:
- Replace platform:event trigger with platform:state
- Add condition to check event_type attribute for 'config_single'
- Remove incorrect event_data and state_changed event_type usage

This matches the working pattern used in production automations and
ensures the blueprint triggers correctly when the config button is
pressed on Inovelli switches.
2025-12-20 15:24:24 -08:00
44c7771f09 Update inovelli_mode_cycling blueprint to use event entity
Change from sensor-based to event-based trigger for Inovelli button
presses. This aligns with Zigbee2MQTT's modern event entity approach
and matches the Phase 1 plan specification.

Changes:
- Replace switch_action_sensor (sensor domain) with switch_action_event (event domain)
- Update trigger from platform:state to platform:event with event_data
- Use state_changed event type for proper event handling

This provides more reliable button press detection and cleaner event
handling compared to the older sensor state monitoring approach.
2025-12-20 15:15:03 -08:00
988a7e0933 Fix inovelli_mode_cycling blueprint: remove invalid 'example' key
The 'example' key is not a valid blueprint input parameter in Home Assistant.
Moved the example value into the description field instead.
2025-12-20 15:02:37 -08:00
258c4172e9 Implement Adaptive Lighting Mode System Phase 1 foundation
Add global mode definitions and config button mode cycling blueprint to
establish the foundation for the adaptive lighting mode system.

Changes:
- Add input_text helpers for all 11 mode settings (Adaptive, Reading,
  Relaxing, Sleep, Theater, Party, Homework, Play, Cooking, Dining,
  Cleanup) with JSON configuration for brightness, color temp, and
  transition parameters
- Store mode settings as individual input_text entities to work within
  Home Assistant's 255 character limit
- Add usage notes for accessing mode settings in templates
- Fix variable definition bug in inovelli_mode_cycling blueprint by
  adding zigbee2mqtt_device_name to variables section
- Update README to reflect that PACKAGE_SETUP_GUIDE.md exists

All YAML files validated with yamllint. JSON configuration validated
with jq.

Part of Phase 1 implementation from adaptive lighting mode system plan.
Automated verification complete, ready for manual testing.
2025-12-20 15:00:02 -08:00
ea20e11bdd Remove invalid helper script from global package
- Remove script.get_mode_color which had incorrect response syntax
- Replace with usage notes showing how to access mode colors in templates
- Blueprints and automations access colors directly via templates
- Fixes 'extra keys not allowed @ data['sequence'][0]['response']' error
2025-12-20 14:41:53 -08:00
ea426e56ef Fix input_text max length constraint for mode colors
- Add max: 255 parameter to adaptive_lighting_mode_colors input_text
- Minify JSON to fit within Home Assistant's 100 character default limit
- Remove adaptive_lighting_mode_settings input_text (too long, convert to comments)
- Remove get_mode_settings script (no longer needed)
- Fix template syntax: use states() instead of state_attr() for input_text values
- Convert mode settings to reference documentation comments

This fixes the 'Initial value length not in range 0-100' error from Home Assistant.
2025-12-20 14:38:21 -08:00
2cb34c7c9f 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.
2025-12-20 14:22:24 -08:00
c9529ed52b Clarify that Adaptive Lighting integration is optional
Update blueprint and README to make it clear that the Adaptive Lighting
switch can be left empty, in which case lights will use simple on/off
control. Add clarifications to input descriptions and enhance
documentation with better examples.
2025-12-06 14:49:03 -08:00
621fdeb709 Only apply adaptive lighting when switch is on
Fixes #1
2025-11-15 12:20:03 -08:00
f301d1b5e2 Switch mode to restart 2001-01-01 00:00:00 +00:00
5d18dbc336 Fix template variable access in actions
Adds variables section to properly expose blueprint inputs as template variables, fixing undefined variable errors in conditions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:52:40 -08:00
d338a7298a Revert to simple multiple entity selector
Simplifies sensor selection back to multiple entity selector instead of complex target/area approach. More reliable and straightforward while still supporting multiple sensors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:41:10 -08:00
b612412470 Fix trigger to use event-based state monitoring
Replaces unsupported domain/device_class trigger with event-based approach that listens to state_changed events and filters for selected occupancy sensors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:25:58 -08:00
cfddf9145d Fix adaptive lighting switch validation
Adds check for empty dict to prevent entity_id errors when adaptive lighting switch is not configured.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:24:38 -08:00
89d268b3f4 Fix trigger to use domain-based filtering
Replaces template variable in trigger entity_id with domain/device_class trigger and condition filter. This properly handles dynamic sensor selection from target selector.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:23:24 -08:00
a7d475c1c5 Fix trigger syntax for area-based sensor selection
Replaces invalid 'target' key in trigger with proper 'entity_id' using variables section to resolve target selector. Simplifies template logic by centralizing sensor resolution.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:21:58 -08:00
d03b80a211 Support area-based motion sensor selection
Updates occupancy controlled lights to use target selector like lights, allowing selection of entire areas of motion sensors. Lights turn on when any sensor in the selected areas/entities detects motion and turn off when all are clear for the delay period.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:20:11 -08:00
b894471828 Add configurable off delay to occupancy controlled lights
Adds off_delay input parameter allowing users to configure how long to wait after motion stops before turning lights off. Includes re-verification to prevent lights turning off if motion resumes during the delay period.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 17:14:02 -08:00
9e4de90676 Add occupancy controlled lights 2025-10-27 14:55:37 -07:00
d5034210ed Try using an external counter 2025-10-25 22:23:04 -07:00
3f82719fa4 New format with mode:single 2025-10-25 22:09:16 -07:00
86f3d9e0e1 New architecture attempt 2025-10-25 22:07:05 -07:00
f392cea7de Set mode to single 2025-10-25 21:56:52 -07:00
278c7da4a1 Set continue_on_timeout:true 2025-10-25 21:51:44 -07:00
04a9511142 Add CLAUDE.md 2025-10-25 21:51:01 -07:00
0f5048b5c0 Add README 2025-10-25 21:41:26 -07:00
d262aa1771 Add multi_press_action 2025-10-25 21:39:35 -07:00