Skip to content

feat: Add multi-inverter support with strict backwards compatibility#120

Open
ma27in wants to merge 3 commits into
djansen1987:mainfrom
ma27in:feature/support-multiple-sensors
Open

feat: Add multi-inverter support with strict backwards compatibility#120
ma27in wants to merge 3 commits into
djansen1987:mainfrom
ma27in:feature/support-multiple-sensors

Conversation

@ma27in

@ma27in ma27in commented Apr 1, 2026

Copy link
Copy Markdown

This MR introduces the ability to configure multiple SAJ/Greenheiss inverters simultaneously within configuration.yaml, while safely preserving existing user configurations and historical data.

Key Changes:

  • Multi-Inverter Support: Added a new optional provider_id to the PLATFORM_SCHEMA. When configured, this ID is injected into the sensor's name and unique_id (e.g., sensor.esolar_bir9_nowpower). This allows multiple integration blocks to run concurrently without entity ID collisions.
  • Prefix Cleanup: Removed an accidental trailing space from the global SENSOR_PREFIX definition.
  • Backwards Compatibility: To prevent orphaning existing users' sensors (which would wipe out their historical Energy Dashboard data), strict fallback logic was added to the SAJeSolarMeterSensor initialization. If provider_id is omitted (which defaults to None), the integration perfectly mirrors the legacy unique_id and naming structure, intentionally preserving the legacy spacing.

Testing:

  • Verified that adding a provider_id correctly generates isolated sensors for multiple logins.
  • Verified that omitting provider_id perfectly matches the legacy entity IDs, ensuring a seamless upgrade path for current users.

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.

2 participants