Merged
Conversation
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.
v2.4.14 Summary of Changes (SolarEdge Optimizers Integration)
This document summarizes the main changes made to the integration, including new features, lifetime energy logic, reliability improvements, code quality, and documentation updates.
1. New site-level sensors (SolarEdge One only)
Installation date
sensor.[prefix]installation_date_[site](orsensor.[prefix]installation_datewhen site ID is not in entity IDs).layout/information/site/{siteId}→installationDate.SITE_INFO_CACHE_TTL), same as layout.Peak power
sensor.[prefix]peak_power_[site](orsensor.[prefix]peak_powerwhen site ID is not in entity IDs).layout/information/site/{siteId}→peakPower(kW).Both values are fetched via
get_site_info_cached()in the SolarEdge One API and stored on the site aggregated data; the sensor platform exposes them only when using the One API.2. Lifetime energy: portal overrides and removal of threshold
Previous behaviour
RELIABLE_THRESHOLD_KWH).Current behaviour
Site lifetime
dashboard/energy/sites/{siteId}?start-date={installation_date}&end-date=...when that value is greater than the aggregated site total.
Inverter and string lifetime
layout/energy/site/{siteId}/by-inverter?start-date={installation_date}&...when the portal value is greater than the aggregated inverter or string total.
Removed
RELIABLE_THRESHOLD_KWHand all logic based on it.Implementation details
const.py
SITE_INFO_CACHE_TTL(2 h).SENSOR_TYPE_INSTALLATION_DATE,SENSOR_TYPE_PEAK_POWERand included them inSENSOR_TYPE_AGGREGATED_SITE.RELIABLE_THRESHOLD_KWH.solaredge_one_api.py
get_site_info_cached(): layout/information/site →installationDate,peakPower(kW).get_dashboard_site_production_cached(installation_date): dashboard/energy/sites →summary.production(Wh).get_layout_energy_by_inverter_cached(installation_date): layout/energy by-inverter → per-inverter and per-string energy (Wh).api_dual.py
coordinator.py
site_infoandportal_by_inverterinto aggregation.sensor.py
3. Reliability and resource handling
Unload / file descriptors
my_api.close()), and the coordinator is removed fromhass.data, even ifasync_unload_platforms()fails.requests.Sessionpool).SolarEdge One API
close()Dual API
close()4. Debug logging
max_active_power(kW).maxActivePower(kW) when present.isEnabledFor(logging.DEBUG)so there is no extra cost at info level.5. Code quality (CodeFactor / Pylint / pycodestyle)
Project root
.pylintrc: design limits relaxed (e.g.max-args=10,max-module-lines=2000) so coordinator/sensor and HA callback signatures are not flagged.setup.cfg:[pycodestyle]max-line-length = 159to align with Pylint.Inline disables
# pylint: disable=too-many-argumentsadded where the design requires more than five parameters (e.g._calculate_aggregated_data,_register_inverter_and_string_devices,_process_single_string, sensor builder functions,api_dual.__init__, config_flowasync_show_form).6. Translations and i18n
translations/*.json) include keys for the new site sensors:entity.sensor.installation_date.name,entity.sensor.peak_power.name.7. Documentation updates
README.md
.pylintrcandsetup.cfg.info.md
docs/Wiki-Home.md
SITE_INFO_CACHE_TTLin constants; file structure no longer references CODEQUALITY.md/pyproject.toml in the integration folder.docs/SolarEdge-One-API-Summary.md
docs/internationalization.md
8. New inverter-level sensor: Max active power (SolarEdge One only)
Max active power
sensor.[prefix]max_active_power_[site]_[inverter](orsensor.[prefix]max_active_power_[inverter]when site ID is not in entity IDs)..../layout/logical/generic/v2/site/{siteId}?include-optimizers=true→ per-inverterproperties.maxActivePower(watts). Displayed as kW (same as site Peak power).Implementation
SENSOR_TYPE_MAX_ACTIVE_POWER, added toSENSOR_TYPE_AGGREGATED_INVERTER._v2_build_inverter_logical_nodereadsmaxActivePower(W) from inverter properties, converts to kW, adds to inverterdatadict.SolarEdgeInverterhasmaxActivePower(fromdata.get("maxActivePower"));SolarEdgeAggregatedDatahasmax_active_power._create_inverter_aggregatedsetsinverter_aggregated.max_active_power = getattr(inverter, "maxActivePower", None); debug log includesmax_active_powerwhen creating inverter aggregated.entity.sensor.max_active_power.name(e.g. "Max active power", "Max. Wirkleistung").Inactive inverters: Max active power sensor is still created for inactive inverters (fixed inverter property); value may be unknown if layout does not provide it.
9. File descriptor and documentation refresh
File descriptor handling
close()docstring now states "Release resources, close sessions, and release file descriptors".close()closes all tracked sessions to avoid leaking file descriptors on unload/removal.close()clears tokens.Top-of-file / module comments
Documentation
close().10. Files touched (overview)
const.py(SENSOR_TYPE_*, SITE_INFO_CACHE_TTL, SENSOR_TYPE_MAX_ACTIVE_POWER),solaredgeoptimizers.py(SolarEdgeAggregatedData, SolarEdgeInverter.maxActivePower)solaredge_one_api.py(get_site_info_cached, layout inverter maxActivePower→kW, close/docstring)api_dual.pyapi.py(close docstring)coordinator.py(site info, portal overrides, inverter max_active_power, debug log, docstring)sensor.py(Installation date, Peak power, Max active power; docstrings)__init__.py(docstring, unload close)config_flow.py(docstring, async_remove_entry close).pylintrc,setup.cfg(project root)translations/*.json(installation_date, peak_power, max_active_power)README.md,info.md,docs/Wiki-Home.md,docs/SolarEdge-One-API-Summary.md,docs/internationalization.mdThis summary reflects the state of the integration after the above changes, including the post–v2.4.14 additions (inverter Max active power sensor and file-descriptor/documentation refresh). For version-specific release notes, see the repository releases.