A powerful Home Assistant integration that allows you to apply and manage multiple "layers" of states to your entities. This is incredibly useful for handling multiple notifications, alerts, and temporary states without losing the original states.
For example: Imagine your porch lights are on a dim, warm white for the evening. If your security camera detects motion, you can use Layer Manager to apply a high-priority "bright white" layer. When the motion clears, you simply remove that layer, and the lights automatically revert to their previous dim, warm state.
- Layered State Management: Apply scenes or states in layers with different priorities. The highest priority layer is always the one that is active.
- UI-Based Configuration: No YAML required for setup. Configure everything from the Home Assistant frontend.
- State Persistence: Layers are saved and restored across Home Assistant restarts.
- Adaptive Lighting: Automatically adjust the color temperature and brightness of your lights based on the sun's position or other sensor values.
- Advanced Per-Entity Settings: Override global adaptive lighting settings for individual lights that have special requirements.
- Status Sensor: A detailed sensor (
sensor.layer_manager_status) exposes the integration's state for monitoring and advanced automations.
- Ensure you have HACS (Home Assistant Community Store) installed.
- In the HACS interface, go to Integrations.
- Click the three dots in the top right and select "Custom repositories".
- In the "Repository" field, paste the URL of this GitHub repository.
- For "Category," select "Integration".
- Click "Add".
- Find the "Layer Manager" card and click "Install".
- Restart Home Assistant after the installation is complete.
Configuration is handled entirely through the Home Assistant UI.
- Go to Settings -> Devices & Services.
- Click the + ADD INTEGRATION button in the bottom right.
- Search for "Layer Manager" and click on it.
- The integration will be added. Now, click the cog on the newly added card to set it up.
You will be presented with a menu:
- Manage Managed Lights: Select all the supported entities you want this integration to control. This is the most important step.
- Global Settings: Configure the default parameters for Adaptive Lighting that will apply to all managed lights.
- Configure advanced settings for a specific light: Fine-tune the adaptive lighting behavior for individual lights, overriding the global settings.
The integration creates two sensors:
sensor.layer_manager_status: The state of this sensor is the number of layers active. The real value is in its attributes, which contain a complete, real-time snapshot of all entity layers and adaptive tracks. This is perfect for diagnostics and complex automations.
These are the core tools you will use in your automations to control the light layers.
| Service | Description |
|---|---|
layer_manager.insert_scene |
Applies a pre-defined Home Assistant scene as a layer to all managed lights within that scene. |
layer_manager.insert_state |
Applies a custom state (e.g., on/off, color, brightness) as a layer to a specific light or group. |
layer_manager.remove_layer |
Removes a layer by its ID, causing the light to revert to the next highest priority layer (or turn off if no layers remain). |
layer_manager.add_adaptive |
Temporarily enables adaptive brightness and/or color temperature for a light or group. |
layer_manager.remove_adaptive |
Removes a light or group from adaptive tracking. |
layer_manager.refresh |
Forces a specific light or group to re-evaluate its current state. |
layer_manager.refresh_all |
Refreshes all managed lights. |
Applying a "Security Alert" Layer
This applies a high-priority (priority 100) layer that makes a light flash red.
service: layer_manager.insert_state
data:
entity_id: light.patio_light
id: "security_alert_patio" # A unique name for this layer
priority: 100
state: "on"
attributes:
rgb_color:
effect: "flash"When the alert is over, remove the layer by its unique ID. The light will revert to its previous state automatically.
service: layer_manager.remove_layer
data:
id: "security_alert_patio"This automation flashes the porch light when motion is detected and restores its previous state after one minute.
automation:
- alias: "Porch Motion Light Alert"
trigger:
- platform: state
entity_id: binary_sensor.porch_motion
to: "on"
action:
- service: layer_manager.insert_state
data:
entity_id: light.porch_main
id: "motion_alert"
priority: 50
attributes:
brightness: 255
effect: "fast_blink"
- delay: "00:01:00"
- service: layer_manager.remove_layer
data:
id: "motion_alert"