Skip to content

Fix v4 room and frontend entity migration Issue #759 - #761

Merged
asantaga merged 6 commits into
asantaga:devfrom
andyblac:Issue759
Oct 25, 2026
Merged

asantaga merged 6 commits into
asantaga:devfrom
andyblac:Issue759

Conversation

@andyblac

@andyblac andyblac commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #759 by preserving existing room entities and their history when upgrading from 3.x to 4.x.

Root cause

The v4 migration converted legacy room unique IDs to UUIDs before they could be matched to the new stable room IDs. Home Assistant then created replacement entities, leaving the original entities duplicated or unavailable.

A separate edge case was also identified: rooms marked by the hub as Invalid: NothingAssigned could still contain a retired device. Migration correctly ignored these rooms, but entity setup processed them and recreated new room entities.

Changes

  • Run room migration before the catch-all UUID conversion.
  • Match legacy room entities to their stable room unique IDs.
  • Preserve existing entity IDs, history, customisations and area assignments.
  • Repair registries already affected by 4.0.0/4.0.1.
  • Remove replacement entities when an original historical entity is available.
  • Repair duplicate frontend update entities without unique-ID collisions.
  • Preserve room temperature, target temperature, heating demand, window detection, Include in Summer Comfort and passive-mode entities.
  • Consistently exclude NothingAssigned rooms from:
    • Climate entity setup
    • Room sensors
    • Room switches and passive mode
    • Integration options
    • Frontend room lists
  • Prevent retired SmartPlug-only rooms from recreating duplicate room devices and entities.
  • Keep the migration safe to rerun against an already-correct registry.

Validation

Tested upgrading from 3.4.20 on Home Assistant 2026.10.2 with two Wiser hubs:

  • Both config entries migrated to minor version 6.
  • 143/143 unique IDs converted.
  • Existing entity IDs were retained.
  • No duplicate devices or entities were created.
  • Temperature, target temperature, heating demand and passive mode remained correctly attached.
  • Heating and hot-water state values remained correct.
  • Re-running against an already-repaired registry left it unchanged.
  • The retired SmartPlug/NothingAssigned room edge case is now covered.

Automated validation:

  • 189 focused migration and platform tests passed.
  • 19 packaging tests passed.
  • 14 card-release tests passed.
  • Development package builds successfully as version 4.0.2b0 with aioWiserHeatAPI==1.7.5.

@andyblac
andyblac changed the base branch from master to dev October 21, 2026 14:31
@asantaga
asantaga merged commit 6ac485d into asantaga:dev Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants