Skip to content

Remove hardcoded HA entity IDs from include files; expose all as substitution variables#7

Merged
f18m merged 30 commits intomainfrom
copilot/remove-hardcoded-sensor-ids
May 4, 2026
Merged

Remove hardcoded HA entity IDs from include files; expose all as substitution variables#7
f18m merged 30 commits intomainfrom
copilot/remove-hardcoded-sensor-ids

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

The package had Italian-installation-specific HA entity IDs hardcoded throughout include/, making it impossible to reuse without forking. All sensor/actuator entity IDs, room identifiers, display names, and scene references are now substitution variables.

New substitution variables (main.yaml / dev-sdl.yaml)

Group Variables
Rooms 1–4 room{N}_id, room{N}_name, room{N}_ha_temperature_sensor, room{N}_ha_humidity_sensor, room{N}_ha_window_contact_sensor, room{N}_ha_floor_heating_switch, room{N}_ha_cover
Temp settings 1–2 temp_setting{N}_id, temp_setting{N}_label, temp_setting{N}_icon, temp_setting{N}_ha_sensor
Target temp ha_temperature_target_sensor
Scenes 1–2 scene{N}_entity_id, scene{N}_name

Generic placeholders are the defaults; real values belong only in consumer configs.

include/ changes

  • sensors.yaml — room sensor packages + temp setting + target sensor now reference substitution vars via quoted "${...}" in flow-mapping vars blocks
  • sensors_temperature_target.yaml — internal ESPHome IDs (sensor_temp_${temp_setting1_id}) and LVGL label IDs (lbl_target_temp_heating_${room{N}_id}) use substitution vars
  • lvgl_tab_rooms.yaml, lvgl_tab_heating_details.yaml, lvgl_tab_covers.yaml — room boxes rendered in consistent room1room4 order using substitution vars
  • lvgl_tab_heating_set_temp.yaml — temp setting IDs, labels, icons, and HA input_number entity IDs via substitution vars
  • lvgl_tab_scenes.yaml — scene entity IDs and button labels via substitution vars

example-instance.yaml

All original Italian-installation entity IDs moved here as vars overrides:

vars:
  room1_id: "bagno_p1"
  room1_ha_temperature_sensor: "sensor.lumi_sensore_ambientale_bagno_p1_temperature"
  room1_ha_cover: "cover.tapparella_bagno_piano_primo"
  # ... all 4 rooms, 2 temp settings, target sensor, 2 scenes
  scene1_entity_id: "scene.tapparelle_aperte_max"

…bles

All installation-specific sensor/actuator entity IDs and room
configuration have been moved from include/ files to substitution
variables in main.yaml and dev-sdl.yaml. The original values from
the author's HA installation are now only present in example-instance.yaml.

Changes:
- main.yaml, dev-sdl.yaml: add room1-4, temp_setting1-2, scene1-2
  substitution variables with generic placeholder defaults
- include/sensors.yaml: use substitution vars for all 4 rooms,
  2 temp settings, and temperature target entity IDs
- include/sensors_temperature_target.yaml: use substitution vars
  for sensor ESPHome IDs and room label IDs
- include/lvgl_tab_covers.yaml: use substitution vars for room IDs,
  names, and cover entity IDs
- include/lvgl_tab_rooms.yaml: use substitution vars for room IDs
  and names
- include/lvgl_tab_heating_details.yaml: use substitution vars for
  room IDs and names
- include/lvgl_tab_heating_set_temp.yaml: use substitution vars for
  temp setting IDs, labels, icons, and HA sensor entity IDs
- include/lvgl_tab_scenes.yaml: use substitution vars for scene
  entity IDs and display names
- example-instance.yaml: add all installation-specific values as
  substitution overrides

Agent-Logs-Url: https://github.com/f18m/esphome-ha-interface-panel/sessions/d770f896-6853-47ae-94be-5a7206da98c3

Co-authored-by: f18m <9748595+f18m@users.noreply.github.com>
f18m and others added 2 commits May 3, 2026 23:00
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@f18m f18m marked this pull request as ready for review May 3, 2026 21:11
f18m and others added 23 commits May 3, 2026 23:19
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
f
Co-authored-by: Copilot <copilot@github.com>
f
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@f18m f18m merged commit 9af642f into main May 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants