fix: split Growatt suffix map for MIN vs SPH discovery (#111)#114
Merged
Conversation
ENTITY_SUFFIX_MAP was a single shared map for both MIN and SPH inverters. It only had tlx_* sensor keys (MIN) and missed the mix_* keys that SPH inverters use via growatt_server. This caused discovery to map 0 sensors for SPH users. Split into GROWATT_MIN_SUFFIX_MAP (tlx_* + number/switch entities) and GROWATT_SPH_SUFFIX_MAP (mix_* sensors only, no number/switch). Discovery now runs both maps and picks the platform with more matches. Also fixes CI scenario files for SPH that were copy-pasted from MIN with wrong entity names, wrong unique_ids, and detected_platform: null. Closes #111 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The ci-wizard-growatt-cloud-octopus scenario (issue #60) had MIN-style sensor entity names while the entity registry correctly used mix_* unique_ids. Fixed sensor states to match entity registry entity_ids, removed MIN-only sensors (local_load_power, lifetime_system_production, lifetime_self_consumption), added missing lifetime_import entity, and renamed file to ci-wizard-growatt-sph-cloud-octopus for clarity. Also added TODO for consolidating the two Growatt MIN/SPH detection paths (_parse_ha_metadata vs discover_sensors_from_registry), and updated stale ENTITY_SUFFIX_MAP references in existing TODO entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sensor entity names in ci-wizard-growatt-sph-cloud-octopus.json were MIN-style (battery_1_charging_w, import_power, internal_wattage) but entity registry had SPH entity_ids (battery_charge, import_from_grid, wattage_pv_all). Fixed sensors to match registry, removed MIN-only sensors, added missing lifetime_import registry entry and required_sensors_growatt_server_sph. Updated stale ENTITY_SUFFIX_MAP references in TODO.md and added consolidation TODO for the two MIN/SPH detection paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
ENTITY_SUFFIX_MAP was a single shared map for both MIN and SPH inverters. It only had tlx_* sensor keys (MIN) and missed the mix_* keys that SPH inverters use via growatt_server. This caused discovery to map 0 sensors for SPH users.
Split into GROWATT_MIN_SUFFIX_MAP (tlx_* + number/switch entities) and GROWATT_SPH_SUFFIX_MAP (mix_* sensors only, no number/switch). Discovery now runs both maps and picks the platform with more matches.
Also fixes CI scenario files for SPH that were copy-pasted from MIN with wrong entity names, wrong unique_ids, and detected_platform: null.
Closes #111