- 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.
1.6 KiB
1.6 KiB
Uniform lighting naming rules
This project uses one canonical naming strategy for CODESYS, Node-RED, and Home Assistant.
1) Canonical token format
- All tokens are
snake_case. - Allowed chars:
a-z,0-9,_. - Normalize free text by:
- lowercasing
- trimming spaces
- replacing spaces and dashes with
_ - collapsing repeated
_ - applying typo fixes (
ktchen -> kitchen,guiest -> guest,wachine -> laundry)
2) Canonical data columns
Source of truth is lights_zones_canonical.csv with:
circuit_nozonearearoomlight_typeindex(duplicate counter for same area+room+light_type)light_no(PLC light channel inside room, 1..6)codesys_in_keycodesys_out_keynodered_room_keyha_entity_id
3) ID generation formulas
codesys_in_key=<area>_<room>codesys_out_key=l_<area>_<room>nodered_room_key=<area>_<room>ha_entity_id=input_boolean.<area>_<room>_<light_type>_<index>
Examples:
input_boolean.open_plan_living_room_main_1open_plan_guest_wcl_master_bedroom_suite
4) PLC mapping rule
light_nomaps to CODESYSl_<N>and Node-REDlight:light_no = 1->l_1light_no = 2->l_2- ...
light_no = 6->l_6
5) Reserved room keys used in this migration
open_plan_living_roomopen_plan_dining_roomopen_plan_entranceopen_plan_guest_wckitchen_kitchenkitchen_pantrybedrooms_officebedrooms_hallwaybedrooms_laundrybedrooms_showerbedrooms_bedroommaster_bedroom_suitemaster_bedroom_bathroomexterior_verandaexterior_entranceexterior_yard