Skip to content

Migrate vacuum_mode switch from legacy to modern template format#53

Merged
basnijholt merged 6 commits intomainfrom
fix/migrate-vacuum-mode-template-switch
Jan 4, 2026
Merged

Migrate vacuum_mode switch from legacy to modern template format#53
basnijholt merged 6 commits intomainfrom
fix/migrate-vacuum-mode-template-switch

Conversation

@basnijholt
Copy link
Owner

Summary

  • Migrates switch.vacuum_mode from deprecated platform: template format to modern template integration
  • Removes now-empty includes/switches.yaml file
  • Updates configuration.yaml to remove unused switch include
  • Updates utils/update-readme.py to reference templates.yaml for switch entities

Context

Home Assistant repair issue: template: deprecate_legacy_templates_switch_vacuum_mode_2bcf32cc858bf04ac982e4af80628f87

The legacy template switch format using - platform: template under the switch: domain is deprecated. The modern format uses the template: integration with a switch: section.

Test plan

  • Verify HA config validation passes after merge
  • Check that switch.vacuum_mode entity still works correctly
  • Confirm the repair issue is resolved in Settings → System → Repairs

The legacy `platform: template` switch format is deprecated.
This moves the vacuum_mode switch to the modern template integration
format in templates.yaml and removes the now-empty switches.yaml file.

Entity ID changes from switch.vacuum_mode to switch.vacuum_mode
(same ID since unique_id is now set).
…cript

The update-readme.py script now properly handles sensors, binary_sensors,
and switches defined in templates.yaml, not just the legacy YAML files.
Also regenerate README.md with updated entity links that now correctly
reference templates.yaml for template-based sensors, binary_sensors,
and switches.
The script now searches for both legacy format (entity_name:) and
modern template format (unique_id: entity_name), allowing it to
properly link to entities defined in templates.yaml.
The script now also searches for entities by their friendly name
(e.g., "name: activity in living room" for entity_id
"binary_sensor.activity_in_living_room"). This finds more entities
defined in templates.yaml without unique_id.

Note: Some entities still can't be found due to naming mismatches
(e.g., entity_id has "activity_in_living_room" but template name
is "Activity in the living room" with extra "the"). These would
need unique_id added to templates.yaml to be found reliably.
@basnijholt basnijholt merged commit 3001655 into main Jan 4, 2026
1 of 3 checks 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.

1 participant