feat: Add generic Home Assistant Inverter interface#207
Open
chriszero wants to merge 4 commits intoohAnd:developfrom
Open
feat: Add generic Home Assistant Inverter interface#207chriszero wants to merge 4 commits intoohAnd:developfrom
chriszero wants to merge 4 commits intoohAnd:developfrom
Conversation
|
awesome PR! |
Owner
|
thanks for contributing ... sounds great in parallel there is a bigger change in the inverter interface to support easier different types of interfaces see PR #170 --- if we are done here and in dev - let's go directly this extension maybe you want to have a look in advance and sync with the other PR to prepare for a faster merge later |
- Add inverter_ha.py with HA inverter control via REST API - Support power limiting and status monitoring through Home Assistant - Update config.py with HA inverter configuration options - Register HA inverter interface in eos_connect.py
Document the new `homeassistant` inverter type: - configuration.html: parameters, info box, and Marstek config example - README.md: mention in features and minimal config comment
- Add BaseInverter-compatible attributes (address, is_authenticated, inverter_type)
- Add supports_extended_monitoring_default class attribute
- Return bool from _call_service, _execute_sequence, set_mode_* methods
- Rename parameter: power -> charge_power_w (set_mode_force_charge)
- Rename parameter: power -> max_pv_charge_rate (api_set_max_pv_charge_rate)
- Add BaseInverter stub methods: initialize, authenticate, connect/disconnect_inverter,
set_battery_mode, set_allow_grid_charging, get_battery_info, fetch_inverter_data
- Add shutdown logging for consistency
- Remove unused import time
0fc70df to
ee73c0c
Compare
Cover initialization, _call_service, _execute_sequence, all mode setters, BaseInverter stubs, set_battery_mode dispatch, grid charging, and shutdown.
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.
Adds a new homeassistant inverter type that controls any inverter/battery system via Home Assistant service calls, making EOS Connect compatible with a much wider range of hardware.
Motivation
Many inverter/battery systems (Marstek, Sungrow, Goodwe, etc.) don't have a direct API but are controllable through Home Assistant entities — whether via
native HA integrations, ESPHome (e.g., RS485/Modbus), or other custom components. This interface bridges that gap by translating EOS optimization results into
HA service calls.
How it works
For each EOS state (charge_from_grid, avoid_discharge, discharge_allowed), the user defines a sequence of HA service calls in config.yaml. Each step specifies
a service, entity_id, and data or data_template (with {{ power }} for dynamic values from EOS).
Example use case: A Marstek battery connected via https://gist.github.com/chriszero/6940087c4fb3ef7552305602096f9d35 exposes select and number entities in
HA, which are then used by EOS Connect to switch operating modes and set charge/discharge limits.
Changes
Tested since 26.12.2025 on my installation.