Skip to content

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Oct 10, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ThermoZone thermostat support for Plugwise Anna heating systems.
  • Changes

    • Reorganized climate entity structure and naming for Plugwise devices to improve clarity.
    • Updated sensor entity classification and naming conventions.
    • Enhanced support for multiple temperature sensors and device scheduling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

The climate entity creation logic is simplified to accept any device with DEV_CLASS == "climate" instead of gateway-based filtering. Internal location handling is refactored from deriving self._location to storing device_id as self._location_id. Test fixtures reorganize climate data by separating overall climate control from individual thermostat representations, and entity references are updated accordingly.

Changes

Cohort / File(s) Summary
Core Climate Entity Logic
custom_components/plugwise/climate.py
Removed gateway and MASTER_THERMOSTATS-based filtering for climate entity addition; now accepts any device with DEV_CLASS == "climate". Replaced internal location derivation with direct device_id assignment to self._location_id. Updated temperature, schedule, and preset API calls to reference self._location_id instead of derived self._location.
Test Fixture Data
tests/components/plugwise/fixtures/anna_heatpump_heating/data.json, tests/components/plugwise/fixtures/anna_v4/data.json, tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json, tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json
Reorganized fixture data to separate climate control device entry from thermostat representation. Removed climate-related fields (active_preset, available_schedules, climate_mode, preset_modes, select_schedule) from primary device; introduced new dedicated climate device entry with full climate attributes, thermostat bounds, and thermostats mapping. Consolidated multiple setpoint fields into single setpoint per device. Added vendor field.
Climate Snapshot Tests
tests/components/plugwise/snapshots/test_climate.ambr
Updated entity IDs and friendly names from anna-based to living_room; refreshed state values and unique IDs corresponding to the new entity naming.
Sensor Snapshot Tests
tests/components/plugwise/snapshots/test_sensor.ambr
Renamed entity IDs (anna_cooling_setpoint → anna_setpoint); reclassified illuminance sensors to temperature sensors; updated translation keys, unit_of_measurement, and unique_ids. Synchronized registry and state snapshots with new entity naming conventions.
Climate Test Code
tests/components/plugwise/test_climate.py
Updated test references from anna climate entity to living_room across set temperature, preset mode, and hvac mode scenarios.
Select Test Code
tests/components/plugwise/test_select.py
Changed target entity in test_anna_select_unavailable_schedule_mode from select.anna_thermostat_schedule to select.living_room_thermostat_schedule.
Changelog
CHANGELOG.md
Added "Add a ThermoZone to Anna" entry to Ongoing section; removed "New Feature: add initial support for the Emma via plugwise [v1.8.0]" entry.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The changes involve a coherent refactor with mixed complexity: the core logic change removes gateway-based filtering and refactors location handling (moderate logic density), while the bulk of the diff consists of fixture reorganization and corresponding test updates (repetitive patterns across multiple files). The fixture changes follow a consistent structure across multiple files, reducing per-file cognitive load, though the logic change requires careful verification of API call updates and entity creation behavior.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • CoMPaTech

Poem

🐰 No more gateway gates to pass through,
Just check the class—if "climate" rings true!
Device IDs mark each location with care,
Thermozones bloom in the fresh Polish air! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Add a ThermoZone to Anna" is directly supported by the changeset. The core changes refactor climate entity logic to support climate-class-based device detection and reorganize test fixtures to represent a ThermoZone as a separate logical entity with dedicated climate attributes and thermostats mapping. The changelog explicitly includes "Add a ThermoZone to Anna" as an ongoing feature entry, confirming this is the intended main change. The title is concise, specific, and clearly conveys the primary objective from the developer's perspective without unnecessary noise or vagueness.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch anna_thermozone

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a74da9 and 255e427.

📒 Files selected for processing (10)
  • custom_components/plugwise/climate.py (5 hunks)
  • custom_components/plugwise/manifest.json (1 hunks)
  • tests/components/plugwise/fixtures/anna_heatpump_heating/data.json (2 hunks)
  • tests/components/plugwise/fixtures/anna_v4/data.json (1 hunks)
  • tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json (1 hunks)
  • tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json (1 hunks)
  • tests/components/plugwise/snapshots/test_climate.ambr (10 hunks)
  • tests/components/plugwise/snapshots/test_sensor.ambr (9 hunks)
  • tests/components/plugwise/test_climate.py (5 hunks)
  • tests/components/plugwise/test_select.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
custom_components/plugwise/climate.py (1)
custom_components/plugwise/entity.py (1)
  • device (91-93)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Setup for HA-core (dev)
  • GitHub Check: Setup for HA-core (release/master)
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (12)
custom_components/plugwise/climate.py (3)

75-75: LGTM! Climate entity creation broadened correctly.

The change from gateway-specific filtering to device[DEV_CLASS] == "climate" successfully removes the gateway-name gating and allows climate entities to be created for any device with the appropriate device class. This aligns with the PR objectives.


259-259: LGTM! API calls consistently use location_id.

All climate control API calls (set_temperature, set_schedule_state, set_preset) have been correctly updated to use self._location_id instead of the previous self._location. The changes are consistent throughout the file.

Also applies to: 269-269, 293-293


113-113: ```bash
#!/bin/bash
echo "=== Locate climate.py ==="
fd --type f climate.py -x echo {}

echo -e "\n=== Preview class definition and init ==="
rg -n -C3 'class .*Climate' custom_components/plugwise/climate.py
rg -n -C5 'def init' -C5 custom_components/plugwise/climate.py

echo -e "\n=== Check for self._location_id usage ==="
rg -n -C3 'self._location_id' custom_components/plugwise/climate.py

echo -e "\n=== Check for data mapping for location field ==="
rg -n -C3 'data["location"]' custom_components/plugwise/climate.py


</blockquote></details>
<details>
<summary>tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json (3)</summary><blockquote>

`72-73`: **Thermostat sensors switched to single setpoint: looks good**

Consolidating to sensors.setpoint for the thermostat matches the zone’s hi/low split. Please confirm no code still expects setpoint_low/high on the thermostat device.

---

`81-82`: **Adding vendor is correct**

Manufacturer info on the thermostat device improves device_info; no issues spotted.

---

`83-109`: **New ThermoZone device schema looks coherent; confirm dual 'thermostat' vs 'thermostats' usage**

The zone object (dev_class: climate) with active_preset, schedules, control_state=cooling, and sensors setpoint_high/low/temperature aligns with the PR goals. It also includes:
- thermostat: bounds + setpoints
- thermostats: mapping to primary thermostat device

If both keys are required by plugwise 1.8.0a0, all good. Please confirm both are expected in the library response and by our parser.

</blockquote></details>
<details>
<summary>tests/components/plugwise/snapshots/test_sensor.ambr (6)</summary><blockquote>

`4266-4318`: **Anna illuminance snapshot entries align with thermostat sensors**

Device class, unit (lx), and unique_id mapping to the thermostat device are consistent.

---

`4320-4373`: **Anna setpoint entries match thermostat’s single setpoint**

Correct temperature device_class, translation_key=setpoint, precision=1, and state=20.5 as per fixture.

---

`4375-4429`: **Anna temperature snapshot is consistent**

Unique_id and state align with thermostat temperature; duplication with zone temperature is expected if both are exposed.


Please confirm exposing both thermostat and zone temperatures is intentional to avoid UX confusion.

---

`4431-4485`: **Living room cooling setpoint mapping looks correct**

Uses translation_key=cooling_setpoint, unique_id -> setpoint_high, precision=1, state=30.0; consistent with zone data.


Ensure translation keys cooling_setpoint exist in the integration constants/translations for UI strings.

---

`4487-4541`: **Living room heating setpoint mapping looks correct**

Uses translation_key=heating_setpoint, unique_id -> setpoint_low, precision=1, state=20.5; consistent with zone data.


Similarly, verify heating_setpoint translations/keys are present.

---

`4543-4597`: **Living room temperature snapshot aligns with zone device**

Unique_id ties to the ThermoZone device, correct temperature device_class and unit. Value change vs cooling fixture is expected across fixtures.


Confirm corresponding fixture for anna_heatpump_heating provides this value to keep snapshots stable.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines 10 to 11
"requirements": [
"https://test-files.pythonhosted.org/packages/e7/1c/fd68b64e588cae5d1426693e24b01ff6076d3510b1e361214bd84d990c28/plugwise-1.8.0a0.tar.gz#plugwise==1.8.0a0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Do not use test-files.pythonhosted.org URLs in production.

The test-files.pythonhosted.org domain is PyPI's test environment and is not intended for production dependencies. Using this URL can lead to:

  • Installation failures if the test file is removed
  • Security concerns as test files may not undergo the same vetting
  • Unpredictable availability

Either:

  1. Wait for the official plugwise 1.8.0 release on PyPI and use the standard version string
  2. If testing is required, use a git+https URL to the source repository instead

Example for option 2:

-  "requirements": [
-    "https://test-files.pythonhosted.org/packages/e7/1c/fd68b64e588cae5d1426693e24b01ff6076d3510b1e361214bd84d990c28/plugwise-1.8.0a0.tar.gz#plugwise==1.8.0a0"
-  ],
+  "requirements": [
+    "git+https://github.com/plugwise/python-plugwise.git@v1.8.0a0#plugwise==1.8.0a0"
+  ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"requirements": [
"https://test-files.pythonhosted.org/packages/e7/1c/fd68b64e588cae5d1426693e24b01ff6076d3510b1e361214bd84d990c28/plugwise-1.8.0a0.tar.gz#plugwise==1.8.0a0"
"requirements": [
"git+https://github.com/plugwise/python-plugwise.git@v1.8.0a0#plugwise==1.8.0a0"
],

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 255e427 and f5ac623.

📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • custom_components/plugwise/manifest.json (1 hunks)
  • pyproject.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • custom_components/plugwise/manifest.json
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md

9-9: No empty links

(MD042, no-empty-links)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Setup for HA-core (dev)
  • GitHub Check: Setup for HA-core (release/master)
  • GitHub Check: Prepare and validate pre-commit

CHANGELOG.md Outdated

- Fix mypy errors in Core (not accepted in HA Core)
- Introduce Snapshot testing for all platforms (requirement from HA Core)
- Add a ThermoZone to Anna via plugwise [v1.8.0]()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fill in the plugwise release URL.

[v1.8.0]() is an empty Markdown link and is flagged by markdownlint (MD042). Point it to the actual plugwise v1.8.0 release (or drop the brackets) so lint passes and the changelog stays navigable.

As per static analysis hints

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

9-9: No empty links

(MD042, no-empty-links)

🤖 Prompt for AI Agents
In CHANGELOG.md around line 9, the markdown entry uses an empty link
`[v1.8.0]()`, which fails markdownlint MD042; replace the empty link by pointing
it to the actual Plugwise v1.8.0 release URL (e.g.
https://github.com/plugwise/plugwise/releases/tag/v1.8.0) or remove the link
brackets so the version is plain text, keeping the rest of the changelog line
unchanged.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

})
# ---
# name: test_anna_2_climate_snapshot[platforms0-True-m_anna_heatpump_cooling][climate.anna-entry]
# name: test_anna_2_climate_snapshot[platforms0-True-m_anna_heatpump_cooling][climate.living_room-entry]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a huge red flag/breaking change - we change the entity_id AND the unique_id

CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.anna", ATTR_HVAC_MODE: HVACMode.AUTO},
{ATTR_ENTITY_ID: "climate.living_room", ATTR_HVAC_MODE: HVACMode.AUTO},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same breaking change applies here

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
custom_components/plugwise/climate.py (1)

159-159: Critical: Unique ID change requires migration logic.

The unique_id now uses the ThermoZone device_id instead of the thermostat device_id, which breaks existing installations. This change was flagged in past review comments as "a huge red flag/breaking change."

For a production release, you need:

  1. Migration logic to preserve the old unique_id OR
  2. A migration path that allows Home Assistant to recognize the entity as the same (using previous_unique_id in entity registry) OR
  3. Clear documentation that users will lose their entity history and need to reconfigure

Since this PR is marked as DRAFT, this might be intentional for testing, but it must be addressed before merging.

Based on learnings (from past review comment).

tests/components/plugwise/snapshots/test_sensor.ambr (1)

4544-4581: Remove entity_category from ATTR_TEMPERATURE sensor to expose as primary

The ATTR_TEMPERATURE sensor (sensor.py line 123-128) is currently marked with entity_category=EntityCategory.DIAGNOSTIC, which incorrectly hides the room's primary ambient temperature reading from the main sensor view. Other temperature readings like OUTDOOR_TEMP correctly have no entity_category, exposing them as primary. Since ATTR_TEMPERATURE represents the current room temperature used by climate entities (not an internal setpoint or diagnostic), it should follow the same pattern: remove the entity_category line entirely so it appears as a primary sensor.

This change also applies to the second snapshot entry at lines 4584-4597.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5ac623 and ebaee5f.

📒 Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • custom_components/plugwise/climate.py (5 hunks)
  • tests/components/plugwise/fixtures/anna_heatpump_heating/data.json (2 hunks)
  • tests/components/plugwise/fixtures/anna_v4/data.json (1 hunks)
  • tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json (1 hunks)
  • tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json (1 hunks)
  • tests/components/plugwise/snapshots/test_climate.ambr (10 hunks)
  • tests/components/plugwise/snapshots/test_sensor.ambr (9 hunks)
  • tests/components/plugwise/test_climate.py (5 hunks)
  • tests/components/plugwise/test_select.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/components/plugwise/test_climate.py
🧰 Additional context used
🧬 Code graph analysis (1)
custom_components/plugwise/climate.py (1)
custom_components/plugwise/entity.py (1)
  • device (91-93)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (13)
tests/components/plugwise/fixtures/anna_heatpump_heating/data.json (1)

83-110: Verify the temperature sensor values are intentionally different.

The new ThermoZone device shows temperature: 23.3 (line 96) while the Anna thermostat device shows temperature: 19.3 (line 73). This 4°C difference should be verified:

  • Is this intentional test data representing zone vs. local thermostat readings?
  • Should the zone temperature be derived from or match the thermostat temperature?
  • Is this inconsistency present in the actual backend implementation?

Please verify the temperature handling logic and confirm whether having different temperature readings for the zone and thermostat is the expected behavior.

custom_components/plugwise/climate.py (2)

79-79: LGTM - Simplified entity creation logic.

The change from gateway-based filtering to a direct dev_class == "climate" check is cleaner and aligns with the new ThermoZone architecture. This makes the code more maintainable and extensible.


152-152: Verify that ThermoZone device_id is compatible with Plugwise Smile API methods.

The change from self._location (previously derived from device LOCATION data) to self._location_id = device_id (ThermoZone device identifier) is a material API contract change. The Plugwise Smile API documentation suggests location_id and zone_id/device_id are used interchangeably, but web sources do not explicitly confirm that the ThermoZone device_id format is accepted by set_temperature, set_schedule_state, and set_preset methods.

Confirm this works by:

  • Running integration tests with climate control operations (set temperature, change schedule state, switch presets)
  • Verifying no API errors occur when these methods receive the ThermoZone device_id
tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json (1)

69-69: Verify the cooling_activation_outdoor_temperature discrepancy.

The cooling_activation_outdoor_temperature differs between the Anna thermostat device (21.0 at line 69) and the ThermoZone device (25.0 at line 94). This 4°C difference should be verified:

  • Is this intentional to represent different thresholds for the physical device vs. the zone?
  • Should these values be synchronized?
  • Does the backend implementation handle this correctly?

Please verify whether having different cooling activation thresholds is the expected behavior or if this is test data inconsistency.

Also applies to: 94-94

tests/components/plugwise/fixtures/anna_v4/data.json (1)

76-100: Fixture structure is consistent with heat-only configuration.

The anna_v4 fixture correctly uses a single setpoint (line 92) instead of setpoint_high/low, which aligns with a heating-only configuration where HVAC_MODE.HEAT_COOL is not applicable. The ThermoZone device structure is consistent with the other fixtures.

tests/components/plugwise/test_select.py (1)

123-123: Entity ID change aligns with the broader architectural shift.

The change from select.anna_thermostat_schedule to select.living_room_thermostat_schedule is consistent with the climate entity renaming throughout this PR. This is part of the breaking changes that need to be clearly documented for users.

tests/components/plugwise/snapshots/test_climate.ambr (1)

578-825: Snapshots confirm the breaking entity ID and unique ID changes.

These snapshot updates demonstrate the breaking changes:

  • entity_id changes from climate.anna to climate.living_room
  • unique_id changes to use the ThermoZone device ID (c784ee9fdab44e1395b8dee7d7a497d5-climate)
  • friendly_name changes from "Anna" to "Living room"

As noted in the past review comment, these are "huge red flag/breaking changes" that will impact existing users. The snapshots are correct reflections of the new implementation, but the breaking nature must be addressed through:

  1. Migration logic (preferred) or
  2. Clear upgrade documentation with manual steps

Based on learnings (from past review comment).

tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json (1)

73-73: Verify the 7°C temperature discrepancy between thermostat and zone.

The cooling fixture shows a significant temperature difference:

  • Anna thermostat: 19.3°C (line 73)
  • Living room zone: 26.3°C (line 96)

This 7°C difference is more pronounced than in other fixtures (~4°C). Please verify:

  • Is this intentional test data for cooling scenarios?
  • Could this be a copy-paste error from another fixture?
  • Does the backend correctly handle such large discrepancies?
  • Should the Anna temperature be updated to reflect a warm reading consistent with the cooling state?

Also applies to: 96-96

tests/components/plugwise/snapshots/test_sensor.ambr (5)

4376-4413: Snapshot entries are consistent; remove unclear verification requests

The sensor.anna_temperature entries in the snapshot appear stable with no ID conflicts. Since this is an auto-generated snapshot file, focus on verifying that the underlying sensor implementation correctly generates these identifiers—don't manually audit snapshot structure.


4266-4301: anna_illuminance is intentionally present and correct

Verification confirms the illuminance sensor is actively defined in the integration (custom_components/plugwise/sensor.py lines 405-411) as a standard sensor description with DIAGNOSTIC categorization. It's not device-specific filtering—it's part of the base sensor list. The snapshot correctly reflects this behavior. No changes needed.


4432-4469: No action required; review comment is based on incorrect assumptions about sensor scope.

The sensors are not duplicates. sensor.anna_setpoint (key="setpoint") and sensor.living_room_cooling_setpoint (key="setpoint_high") are intentionally distinct:

  • anna_setpoint (unique_id ending in -setpoint) is the gateway-level main setpoint for device 3cb70739...
  • living_room_cooling_setpoint (unique_id ending in -setpoint_high) is the zone-level cooling setpoint for device c784ee9f...

They are from different devices with different purposes, not duplicate surfaces of the same data. No gating or hiding is necessary.

Likely an incorrect or invalid review comment.


4488-4525: Heating setpoint wiring is correct; no migrations or visibility concerns found

The snapshot entries are properly configured: heating_setpoint correctly uses translation_key='heating_setpoint' with unique_id ending in '-setpoint_low', and cooling_setpoint uses translation_key='cooling_setpoint' with unique_id ending in '-setpoint_high'.

Verification shows:

  • No migration mappings exist for setpoint entities in async_migrate_entity_entry, indicating they were always named with current patterns
  • anna_setpoint entity does not exist in the codebase
  • No ThermoZone visibility hiding logic found

4320-4357: Verify migration coverage for anna_setpoint entities

The entity registry migration infrastructure exists and handles specific entity type migrations (slave_boiler_state → secondary_boiler_state, relative_humidity → humidity, plug → relay). However, no migration rules are defined for setpoint-related entities, including anna_setpoint.

Current investigation found:

  • async_migrate_entity_entry() and async_migrate_sensor_entities() have no handling for "setpoint", "setpoint_high", or "setpoint_low" keys
  • No references to old entity IDs like "anna_cooling_setpoint" or "anna_heating_setpoint" in the codebase
  • The snapshot shows anna_setpoint with current unique_id format ({id}-setpoint)

To resolve this concern: Confirm whether anna had separate cooling/heating setpoint entities exposed in previous releases. If yes, migration rules must be added to async_migrate_entity_entry() to map old IDs to the new consolidated structure. If no, the concern can be dismissed.

Comment on lines +5 to +8
## Ongoing

- Add a ThermoZone to Anna

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Document the breaking changes and provide migration guidance.

This change introduces breaking changes for Anna users (entity_id and unique_id changes from anna to living_room, as evidenced by the test snapshots). The changelog should:

  • Clearly mark this as a BREAKING change
  • Explain that existing climate.anna entities will become climate.living_room
  • Provide migration steps for users (automations, dashboards, etc. will need updates)
  • Explain the new ThermoZone concept and architecture

Consider adding something like:

 ## Ongoing
 
-- Add a ThermoZone to Anna
+- **BREAKING**: Add a ThermoZone to Anna - climate entities are now zone-based
+  - Climate entity IDs change from `climate.anna` to `climate.living_room` (or the zone name)
+  - Users will need to update automations, dashboards, and scripts that reference the old entity IDs
+  - The Anna device now represents the physical thermostat, while a new ThermoZone device represents the climate control zone
🤖 Prompt for AI Agents
In CHANGELOG.md around lines 5 to 8, mark the addition of ThermoZone as a
BREAKING change and expand the entry to document what changed and how to
migrate: state that entity_id and unique_id for Anna changed from anna to
living_room (e.g., climate.anna -> climate.living_room), add clear migration
steps for users to update automations, dashboards, and YAML/config references,
summarize the new ThermoZone concept and architecture at a high level, and
include any notes about compatibility or scripts/commands to help bulk-rename or
map old IDs to new ones.

@bouwew
Copy link
Contributor Author

bouwew commented Nov 2, 2025

Closing this, the P1 data on the Anna P1 is shown in the Home location, not in the Livingroom location.

@bouwew bouwew closed this Nov 2, 2025
@bouwew bouwew deleted the anna_thermozone branch November 5, 2025 18:43
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.

3 participants