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:
2026-04-01 19:09:59 +03:00
parent d755d3c1ed
commit 0af21f4dc3
16 changed files with 579 additions and 220 deletions

View File

@@ -0,0 +1,37 @@
# Validation report (uniform lighting naming migration)
## Static consistency checks completed
- Canonical lighting rows: `39` (`lights_zones_canonical.csv`)
- CODESYS `NVL_In` room structs: `16`
- CODESYS `NVL_Out` room structs: `16`
- Node-RED `roomNames` entries: `16`
- Node-RED `lightEntityMap` entries: `39`
## Mapping status
- `circuit_no -> area/room/type/index/light_no` is defined for all non-empty circuits.
- `codesys_in_key` / `codesys_out_key` are defined for every canonical row.
- `room-config.js` is aligned with canonical keys:
- `roomNames` matches the 16-room CODESYS layout.
- `lightEntityMap` has one entry per canonical row.
- `entityToRoom` base keys map all canonical HA entity patterns.
## Verified constraints
- Canonical naming style: `snake_case`
- Entity ID pattern: `input_boolean.<area>_<room>_<light_type>_<index>`
- CODESYS legacy room names replaced in `codesys/src` runtime files:
- `GVL_NVL_placeholders.gvl`
- `GVL_IO.gvl`
- `PLC_App.st`
## Residual runtime checks to perform on target system
Because this repository environment has no runtime binaries for Node-RED/CODESYS/HA validation, perform these on your deployed setup:
1. Deploy updated CODESYS project and confirm NVL sender/receiver symbol binding still resolves.
2. Load updated `/root/.node-red/room-config.js` and redeploy flows.
3. Import HA helpers from `lights_by_area_room_type_index.yaml`.
4. Test one circuit per area end-to-end:
- HA toggle -> Node-RED -> NVL_In -> PLC output -> NVL_Out -> HA sync.