Open
Conversation
The v3→v4 switch→valve migration changed the zone unique_id suffix from `:switch` to `:valve` but left the old entries behind. HA's registry refuses cross-domain entity_id updates, so the orphaned switches stayed put and the auto-suggested entity_id for the new valve collided with them - surfacing as the Recorder "cannot migrate history" warning and a red/"Not provided" valve tile. Drop any switch entity whose unique_id still ends in `:switch` during `async_setup_entry`, before platforms initialise, so the v4 valve is the sole zone control in the registry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unique_idending in:switch) duringasync_setup_entry, before platforms initialise, so the v4 valve is the sole zone control in the registry.switch.zone_1_zonetoswitch.pond" warning and the red/"Not provided" valve tile reported in v4 valve entities - no control and not provided #403.Why the orphan matters
The v3→v4 switch→valve conversion changed the zone
unique_idsuffix from:switchto:valve. HA's registry refuses cross-domain entity_id updates, so the old switch entries stayed behind after upgrade. HA's auto-suggested entity_id for the new valve then collided with the orphaned switch, producing the Recorder warning and leaving the valve in an error state in the UI.History on the old switch is not preserved - the platform migration already broke continuity.
Fixes #403.
Test plan
pytest tests/test_migration.py- 5 new tests: orphan removal, existing v4 valve preserved, non-zone switches (rain delay / smart watering / program) left alone, idempotence, config-entry scopingpytest tests/- 158 passed, 5 skipped./scripts/lint