Skip to content

Eg4-Inverters

Choose a tag to compare

@Trixanna Trixanna released this 02 Aug 16:57
· 5 commits to master since this release

Added ability to add on additional EG4 inverters.

Summary of changes

  1. Data model
  1. Config flow: allow multiple entries and auto-assign index
  • Added _next_available_index() and modified Python.async_step_user() to:
    • Auto-compute next index across existing entries.
    • Inject entry_index into the created config entry’s data.
    • Set a unique_id that includes base_url and the index to avoid duplicate aborts.
      Format: f"{DOMAIN}|{base_url}|{index}"
  1. Migration for existing installs
  1. Device info naming only (no unique_id changes to entities)

Preserved stability

  • Entities’ unique_ids continue to be based on entry.entry_id and are unchanged, so history and associations remain intact for existing setups.

How this addresses the original issue

  • Previously, config flow unique_id was based on title and caused Home Assistant to abort when a second inverter with the same base URL was added. Now, unique_id includes the auto-assigned index, so multiple config entries can co-exist.
  • Devices are displayed distinctly: EG4 Inverter (first) and EG4 Inverter 2 (second), etc.
  • All sensors are grouped under the correct device and remain uniquely identified.

What to test

  • Restart Home Assistant to apply migration; verify existing device remains EG4 Inverter with entities intact.
  • Add a second entry with same/different credentials as needed; confirm device shows as EG4 Inverter 2 and entities appear correctly.
  • Optionally add a third to confirm EG4 Inverter 3.
  • Remove and re-add entries; index will keep incrementing by max+1 (current strategy).

Files modified

Documentation note

  • Add a README section: Multiple Inverters
    • Existing installs become index 1 automatically.
    • Adding another inverter will create EG4 Inverter 2, 3, …
    • Entity names remain the same; use device name to distinguish in UI.

Full Changelog: https://github.com/Trixanna/EG4-Inverter/commits/v1.1.0