You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ⚠️ **Update Required:** Analysis for v1.0.0. Code is v1.2.0.
20
-
21
-
The **Room Automation** package provides a standardized, scalable framework for managing room states (e.g., Occupied, Idle, Sleep) and automation parameters (e.g., lighting delays, lux thresholds) dynamically. It utilizes **MQTT discovery** to generate entities for each room on-the-fly, allowing for decentralized configuration without restarting Home Assistant. Admin users can "initialize" a room from a dashboard, which triggers scripts to publish MQTT configuration payloads, creating a suite of helpers (timers, selects, sensors) specific to that room. It effectively acts as a "factory" for room controllers.
19
+
The **Room Automation Manager** is a dynamic configuration engine that enables the decentralized creation of smart room controllers. Unlike static YAML configuration, this package allows administrators to "initialize" a room directly from the dashboard. This triggers a script that publishes **MQTT Discovery** payloads to Home Assistant, effectively factory-generating a standardized suite of entities for that room (Automation Mode, Idle Timers, Occupancy Sensors, etc.) without requiring a system restart. It acts as a "Room Controller Factory," ensuring every smart room has a consistent interface and logic structure.
22
20
<!-- END_SUMMARY -->
23
21
24
22
## Process Description (Non-Technical)
25
23
<!-- START_DETAILED -->
26
-
> ⚠️ **Update Required:** Analysis for v1.0.0. Code is v1.2.0.
27
-
28
-
This system allows you to turn any "Area" in your home into a Smart Room without writing code.
29
-
1.**Creation:** You select a room (like "Kitchen") from a list in the Settings Dashboard.
30
-
2.**Generation:** The system instantly creates a set of controls for that room, including:
31
-
***Mode Selector:** Choose how the room behaves (e.g., "Presence Control" vs. "Manual").
32
-
***Timers:** Set how long lights stay on after you leave.
33
-
***Sensors:** Link motion sensors and light sensors to the room.
34
-
3.**Operation:** Once created, these controls appear in your dashboards, letting you tweak settings like "turn off lights after 5 minutes" individually for every room.
24
+
This system allows you to turn any standard "Area" in your home into a fully functional Smart Room with a single click.
25
+
1.**Select & Initialize:** Go to the **Room Management** dashboard, pick a room (e.g., "Kitchen") from the list, and click "Initialize".
26
+
2.**Automatic Creation:** The system instantly builds a "Control Panel" for that room behind the scenes. It creates:
27
+
***Mode Switch:** To set the room to "Automatic", "Manual", or "Guest Mode".
28
+
***Timers:** Dials to set how long lights stay on (e.g., 5 minutes).
29
+
***Sensor Links:** Dropdown menus to choose which Motion Sensor and Bed Sensor belongs to this room.
30
+
3.**Instant Control:** New controls appear immediately. You can now tweak the "Kitchen" settings without ever touching a code file. If you delete the room, all these controls vanish cleanly.
35
31
<!-- END_DETAILED -->
36
32
37
33
## Dashboard Connections
38
34
<!-- START_DASHBOARD -->
39
-
This package powers the following dashboard views:
35
+
***[Room Management](../dashboards/room-management/room_management.md)**: The primary admin interface. Used to Create (Initialize) and Delete rooms. It also lists all active rooms and their configuration state.
36
+
***[Settings (System)](../dashboards/main/settings.md)**: Displays the global list of active rooms and their current modes (Occupied/Idle).
37
+
38
+
### Embedded Card: Configured Rooms List
39
+
The following `auto-entities` configuration is used to dynamically list all rooms:
40
40
41
-
***[Living Room](../dashboards/main/living_room.md)**: *The Living Room dashboard is a media and comfort hub. It features in-depth environmental monitoring (Radon, VOCs, CO2) via Airthings Wave, displaying historical trends. Entertainment controls are central, with remotes for the TV and Soundbar, plus power management for the media wall. The view also includes specific controls for the fireplace, air purifier modes, and various lighting scenes, alongside standard occupancy settings.* (Uses 1 entities)
42
-
***[Notifications Management](../dashboards/notification-center/notifications_management.md)**: *The Notification Center dashboard provides a comprehensive interface for managing the smart home's notification system. Administrators can add or remove users for mobile app notifications and define notification categories (e.g., 'Garage', 'Electricity'). The view allows for granular control over subscriptions, enabling individual users to opt-in or out of specific notification types, and includes tools to map and monitor notification-related automations.* (Uses 1 entities)
43
-
***[Room Management](../dashboards/room-management/room_management.md)**: *The Room Management dashboard serves as the administrative backend for the home's room logic. It allows users to initialize new rooms (creating necessary helper entities) or delete existing ones. It features a dynamic "Configured Rooms" section powered by `auto-entities`, which automatically lists all configured rooms and provides collapsible controls for their automation modes, occupancy sensors, and timeouts.* (Uses 4 entities)
41
+
```yaml
42
+
type: custom:auto-entities
43
+
show_empty: true
44
+
card:
45
+
type: entities
46
+
show_header_toggle: false
47
+
filter:
48
+
template: |
49
+
{% set ns = namespace(rows=[]) %}
50
+
{% set mode_selectors = states.select | selectattr('entity_id','search','automation_mode') | sort(attribute='entity_id') | list %}
51
+
52
+
{% for sel in mode_selectors %}
53
+
{# Extract base id and normalize to room_key #}
54
+
{% set raw_id = sel.entity_id.split('.')[1] %}
55
+
{% set base = raw_id.replace('_automation_mode','') %}
56
+
{% if base.startswith('room_') %}
57
+
{% set room_key = base[5:] %}
58
+
{% else %}
59
+
{% set room_key = base %}
60
+
{% endif %}
61
+
{% set name = room_key.replace('_',' ') | title %}
62
+
63
+
{# Entity IDs #}
64
+
{% set state_select = 'select.room_' ~ room_key ~ '_state' %}
65
+
{% set auto_switch = 'switch.room_' ~ room_key ~ '_automation' %}
66
+
{% set occ_sensor = 'binary_sensor.room_' ~ room_key ~ '_occupancy' %}
67
+
{% set idle_entity = 'number.room_' ~ room_key ~ '_presence_idle_time' %}
68
+
{% set delay_entity = 'number.room_' ~ room_key ~ '_lights_presence_delay' %}
69
+
{% set bed_s = 'select.room_' ~ room_key ~ '_bed_sensor' %}
70
+
{% set sleep_entry = 'number.room_' ~ room_key ~ '_sleep_entry_delay' %}
71
+
{% set sleep_exit = 'number.room_' ~ room_key ~ '_sleep_exit_delay' %}
72
+
{% set occ_source = 'select.room_' ~ room_key ~ '_occupancy_source' %}
73
+
{% set timer_entity = 'sensor.room_' ~ room_key ~ '_timer' %}
> ⚠️ **Update Required:** Analysis for v1.0.0. Code is v1.2.0.
49
-
50
-
The sequence diagram below illustrates the "Room Initialization" process. When a user selects a room (e.g., "Kitchen") and clicks "Initialize", the `create_room_settings` script is triggered. This script iterates through a predefined list of required entities (Mode Select, Idle Timer, Occupancy Sensor, etc.) and publishes **MQTT Configuration Payloads** to the `homeassistant/` discovery topic. Home Assistant's MQTT integration detects these payloads and dynamically duplicates the "Room Controller" entity structure for the new room. Finally, the script sets default values (e.g., 120s delay) via retained MQTT messages, ensuring the room is ready for immediate use.
177
+
The sequence diagram below illustrates the **Room Initialization Flow**. When a user clicks "Initialize" for a specific room (e.g., "Kitchen"), the `create_room_settings` script triggers. It loops through a definition of required entities (Automation Mode, Idle Timer, Occupancy Sensor Link) and publishes **MQTT Configuration Payloads** to the `homeassistant/` discovery topic. Home Assistant detects these payloads and dynamically creates the entities in its registry. Finally, the script publishes default state values (retained) to ensure the new controls are immediately usable.
51
178
<!-- END_MERMAID_DESC -->
52
179
53
180
<!-- START_MERMAID -->
54
-
> ⚠️ **Update Required:** Analysis for v1.0.0. Code is v1.2.0.
55
-
56
181
```mermaid
57
182
sequenceDiagram
58
-
participant Admin as 👤 Admin
59
-
participant Dash as 📱 Dashboard (Settings)
60
-
participant Script as 📜 Script: create_room_settings
0 commit comments