John Ogle 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
2025-10-25 21:51:01 -07:00

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
  • presence_mode_reset.yaml - Auto-reset on room exit

Packages (Templates):

  • adaptive_lighting_global.yaml - Shared mode definitions and colors
  • adaptive_lighting_bedroom_template.yaml - Complete bedroom example
  • adaptive_lighting_living_room_template.yaml - Living room example
  • adaptive_lighting_simple_template.yaml - Minimal single-mode room

Setup Guide

Quick Start:

  1. Install Adaptive Lighting integration via HACS
  2. Follow PACKAGE_SETUP_GUIDE.md to enable packages
  3. Copy templates from packages/ directory
  4. Import blueprints via UI
  5. See ROOM_CONFIGURATION_GUIDE.md for examples

Documentation:

Files:

  • packages/adaptive_lighting_global.yaml - Required for all rooms
  • packages/adaptive_lighting_bedroom_template.yaml - Template for bedrooms
  • packages/adaptive_lighting_living_room_template.yaml - Template for common areas
  • packages/adaptive_lighting_simple_template.yaml - Template for simple rooms
  • blueprints/automation/inovelli_mode_cycling.yaml - Config button mode cycling
  • blueprints/automation/inovelli_button_actions.yaml - Multi-tap actions
  • blueprints/automation/presence_mode_reset.yaml - Auto-reset on room exit

Import URLs

Blueprints:

https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/blueprints/automation/inovelli_mode_cycling.yaml
https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/blueprints/automation/inovelli_button_actions.yaml
https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/blueprints/automation/presence_mode_reset.yaml

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.

Import URL

https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/occupancy_controlled_lights.yaml

Installation

Method 1: Import via UI

  1. Go to Settings → Automations & Scenes → Blueprints
  2. Click "Import Blueprint" (blue button, bottom right)
  3. Paste the import URL above
  4. Click "Preview" then "Import"

Method 2: Manual Installation

  1. Download the blueprint file
  2. Place it in /config/blueprints/automation/occupancy_controlled_lights.yaml
  3. Restart Home Assistant or reload automations

Features

  • Occupancy-based control: Automatically turns lights on/off based on presence
  • Adaptive lighting support: Optional integration with Adaptive Lighting component
  • Configurable transitions: Set different fade times for on/off
  • Fallback support: Works with or without adaptive lighting
  • Multiple light support: Control single lights or groups

Configuration Options

Input Description Default
Occupancy Sensor Binary sensor that detects occupancy/presence Required
Lights Light entities to control Required
Adaptive Lighting Switch Adaptive lighting switch for this room. Leave empty to use simple on/off without adaptive lighting. Optional
Turn On Transition Transition time when turning lights on (seconds) 5
Turn Off Transition Transition time when turning lights off (seconds) 15
Adapt Brightness Whether to adapt brightness with adaptive lighting Yes
Adapt Color Whether to adapt color with adaptive lighting Yes

Usage Examples

Example 1: Basic Room with Adaptive Lighting

Configuration:

  • Occupancy Sensor: binary_sensor.living_room_occupancy
  • Lights: light.living_room_lights
  • Adaptive Lighting Switch: switch.adaptive_lighting_living_room
  • Turn On Transition: 3 seconds
  • Turn Off Transition: 10 seconds

Example 2: Simple On/Off Mode (without Adaptive Lighting)

Use Case: Control lights with simple on/off without adaptive lighting adjustments.

Configuration:

  • Occupancy Sensor: binary_sensor.kitchen_motion
  • Lights: light.kitchen_ceiling, light.kitchen_under_cabinet
  • Adaptive Lighting Switch: Leave empty (default)
  • Turn On Transition: 1 second
  • Turn Off Transition: 5 seconds
  • Adapt Brightness: Not applicable (no adaptive lighting switch)
  • Adapt Color: Not applicable (no adaptive lighting switch)

Example 3: Bedroom with Gentle Transitions

Configuration:

  • Occupancy Sensor: binary_sensor.bedroom_presence
  • Lights: light.bedroom_lights
  • Adaptive Lighting Switch: switch.adaptive_lighting_bedroom
  • Turn On Transition: 10 seconds (gentle wake-up)
  • Turn Off Transition: 30 seconds (gradual fade)

How It Works

  1. Occupancy Detected: When the sensor state changes to "on" (occupied):

    • If an Adaptive Lighting switch is configured AND enabled, applies adaptive lighting settings
    • If the Adaptive Lighting switch is left empty OR is disabled, turns lights on with simple on/off using the specified transition time
  2. No Occupancy: When the sensor state changes to "off" (not occupied):

    • Turns off all specified lights with configured transition time

Tips

  • Sensor Selection: Works best with presence sensors (mmWave) for continuous detection
  • Transition Times: Longer transitions feel more natural but may delay response
  • Adaptive Lighting: Requires the Adaptive Lighting integration to be installed
  • Light Groups: You can target light groups for easier management

Troubleshooting

Lights not turning on:

  • Verify occupancy sensor is working and changing state
  • Check that light entities are correct and responsive
  • Ensure adaptive lighting switch exists if specified

Lights turning off too quickly:

  • Check occupancy sensor timeout settings
  • Some PIR sensors have short detection windows

Adaptive lighting not working:

  • Verify Adaptive Lighting integration is installed
  • Check that the switch entity exists and is enabled
  • Make sure the switch covers the target lights

Multi-Press Action Blueprint

Trigger different actions based on how many times an entity changes state rapidly. Perfect for light switches, buttons, or any entity where you want single, double, triple, or quad-press actions.

Import URL

https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/multi_press_action.yaml

Installation

Method 1: Import via UI

  1. Go to Settings → Automations & Scenes → Blueprints
  2. Click "Import Blueprint" (blue button, bottom right)
  3. Paste the import URL above
  4. Click "Preview" then "Import"

Method 2: Manual Installation

  1. Download the blueprint file
  2. Place it in /config/blueprints/automation/multi_press_action.yaml
  3. Restart Home Assistant or reload automations

Features

  • Configurable time window: Set how quickly presses must occur (default 1.5s)
  • Immediate or delayed single-press: Choose whether single press acts instantly or waits
  • Up to 4 press levels: Single, double, triple, and quad press actions
  • Complex action support: Each action can include conditions, scenes, scripts, and more

Configuration Options

Input Description Default
Trigger Entity The entity to monitor for state changes Required
Time Window Maximum time between presses (seconds) 1.5
Execute Single Press Immediately Run single press action without waiting Yes
Single Press Action Action(s) to run on single press None
Double Press Action Action(s) to run on double press None
Triple Press Action Action(s) to run on triple press None
Quad Press Action Action(s) to run on quad press (4 times) None

Usage Examples

Example 1: Light Switch with Scene Control

Use Case: Normal switch operation, but double-press for bright scene

Configuration:

  • Trigger Entity: light.bedroom
  • Immediate Single Press: Enabled
  • Single Press Action: Leave empty (light toggles naturally)
  • Double Press Action:
  - choose:
      - conditions:
          - condition: sun
            after: sunset
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.bedroom_bright_night
      - conditions:
          - condition: sun
            before: sunset
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.bedroom_bright_day

Example 2: Button with Escalating Actions

Use Case: Button that does more based on number of presses

Configuration:

  • Trigger Entity: binary_sensor.my_button
  • Immediate Single Press: Disabled (wait to see if multi-press)
  • Single Press Action: Turn on TV
  • Double Press Action: Turn on TV + soundbar + dim lights
  • Triple Press Action: Full movie mode (TV + soundbar + lights off + close blinds)
  • Quad Press Action: Party mode

Example 3: Bathroom Light with Time-Based Logic

Configuration:

  • Trigger Entity: light.bathroom
  • Immediate Single Press: Enabled
  • Triple Press Action:
  - choose:
      - conditions:
          - condition: time
            after: "22:00:00"
            before: "06:00:00"
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.bathroom
            data:
              brightness_pct: 10
              color_temp: 454
      default:
        - service: light.turn_on
          target:
            entity_id: light.bathroom
          data:
            brightness_pct: 100

Updates

To get the latest version of this blueprint:

  1. Go to Settings → Automations & Scenes → Blueprints
  2. Find "Multi-Press Action" in your list
  3. Click the menu (three dots)
  4. Select "Re-import Blueprint"
  5. Your existing automations will automatically use the updated version

Changelog

v1.0.0 (2025-10-25)

  • Initial release
  • Support for single, double, triple, and quad press actions
  • Configurable time window
  • Optional immediate single-press mode
  • Full action sequence support with conditions

Tips

  • Immediate mode (default): Best for switches that control things directly (like lights). No delay on single press.
  • Delayed mode: Best for buttons that only trigger automations. Waits to see if you're doing a multi-press.
  • Time window: Start with 1.5s. Increase if you have trouble with multi-press detection, decrease for faster response.
  • Action complexity: Each action input supports full Home Assistant action sequences - use conditions, choose blocks, multiple services, etc.

Troubleshooting

Multi-press not detecting:

  • Increase the time window
  • Check that your entity is actually changing state rapidly
  • Look at Developer Tools → Events to watch state_changed events

Single press delayed even in immediate mode:

  • Make sure "Execute Single Press Immediately" is enabled
  • Check that your single press action isn't empty (unless you want the natural entity behavior)

Automation not working:

  • Check the automation trace (Settings → Automations → your automation → ⋮ → Traces)
  • Verify your trigger entity is the correct one
  • Test with simple actions first (like notifications)

Support

Found a bug or have a feature request? Open an issue on the repository!

License

Feel free to use, modify, and share this blueprint!

Description
No description provided
Readme 193 KiB
Languages
Markdown 100%