Refactor room and light configurations for Node-RED integration
- Updated global variable lists in GVL_IO.gvl and GVL_NVL_placeholders.gvl to reflect new room naming conventions and structures. - Revised PLC_App.st to map new room configurations for lighting control. - Enhanced documentation in all-lights-and-rooms.md and ha-lights-and-rooms.md to align with updated room and light entity naming. - Adjusted room-config.js and related Node-RED flows to support the new configuration structure. This update improves the organization and clarity of room and light management within the Node-RED integration, ensuring consistency across the system.
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
|
||||
This guide covers how to create the light/switch entities that Node-RED and the PLC use, and how to assign them to **rooms** (HA **Areas**) so you can manage and display them by room.
|
||||
|
||||
Canonical naming in this project is now:
|
||||
|
||||
- `input_boolean.<area>_<room>_<light_type>_<index>`
|
||||
- Example: `input_boolean.open_plan_living_room_main_1`
|
||||
|
||||
Pre-generated helper YAML for the current electrical plan:
|
||||
|
||||
- [`lights_by_area_room_type_index.yaml`](lights_by_area_room_type_index.yaml)
|
||||
|
||||
---
|
||||
|
||||
## 1. Concepts
|
||||
@@ -41,18 +50,13 @@ Create one file per room (or one file with sections) so entities are grouped by
|
||||
|
||||
```yaml
|
||||
# PLC/Node-RED lights – entity_id must match room-config.js (entityToRoom, lightEntityMap)
|
||||
# Naming: <room>_<light_num> e.g. living_room_1, kitchen_2
|
||||
# Naming: <area>_<room>_<light_type>_<index> e.g. open_plan_living_room_main_1
|
||||
|
||||
input_boolean:
|
||||
# Living room
|
||||
living_room_1: { name: Living Room 1 }
|
||||
living_room_2: { name: Living Room 2 }
|
||||
# Kitchen
|
||||
kitchen_1: { name: Kitchen 1 }
|
||||
kitchen_2: { name: Kitchen 2 }
|
||||
# Hallway
|
||||
hallway_1: { name: Hallway 1 }
|
||||
# Add more: master_bedroom_1, bathroom_1, entrance_1, etc.
|
||||
open_plan_living_room_main_1: { name: Open Plan Living Room Main 1 }
|
||||
open_plan_living_room_spots_1: { name: Open Plan Living Room Spots 1 }
|
||||
kitchen_kitchen_main_1: { name: Kitchen Main 1 }
|
||||
bedrooms_hallway_main_1: { name: Bedrooms Hallway Main 1 }
|
||||
```
|
||||
|
||||
Ensure `configuration.yaml` has:
|
||||
@@ -62,7 +66,7 @@ homeassistant:
|
||||
packages: !include_dir_named packages
|
||||
```
|
||||
|
||||
Restart Home Assistant. All entities are created. Entity IDs will be `input_boolean.living_room_1`, etc.
|
||||
Restart Home Assistant. All entities are created. Entity IDs will be `input_boolean.open_plan_living_room_main_1`, etc.
|
||||
|
||||
### Option B: UI (one by one)
|
||||
|
||||
@@ -99,9 +103,9 @@ Use the **same entity_id and room logic** in both places.
|
||||
|
||||
**Naming convention that works well:**
|
||||
|
||||
- Entity ID: `input_boolean.<room>_<number>`
|
||||
Examples: `living_room_1`, `kitchen_2`, `hallway_1`.
|
||||
- In **entityToRoom** use the part without the number: `living_room`, `kitchen`, `hallway` (and any alias like `living_room_new` → `cmd_livingroom`).
|
||||
- Entity ID: `input_boolean.<area>_<room>_<light_type>_<index>`
|
||||
Examples: `open_plan_living_room_main_1`, `kitchen_kitchen_island_1`, `exterior_yard_driveway_1`.
|
||||
- In **entityToRoom** use the part without trailing `_<index>`, e.g. `open_plan_living_room_main` or `exterior_yard_driveway`.
|
||||
|
||||
When you add a new light in HA (new entity_id), add or update:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user