Skip to content

Conversation

@johanzander
Copy link
Collaborator

Overview

Adds complete V1 API support for SPH (type 5) hybrid inverters

Design Rationale (per #125 discussion)

  • Zero breaking changes - all existing min_* methods unchanged, backward compatible
  • Follows the [perfect PR recommendations][perfect-pr]
  • Follows existing architectural patterns - sph_* methods mirror min_* structure exactly
  • Potential improvements can be done in subsequent PRs

What's Included

10 new SPH methods:

  api.sph_detail(device_sn)                    # Device details
  api.sph_energy(device_sn)                    # Current energy
  api.sph_energy_history(...)                  # History (7-day max)
  api.sph_settings(device_sn)                  # All settings
  api.sph_read_parameter(...)                  # Read parameter
  api.sph_write_parameter(...)                 # Write parameter
  api.sph_write_ac_charge_time(...)            # AC charge periods (1-3)
  api.sph_write_ac_discharge_time(...)         # AC discharge periods (1-3)
  api.sph_read_ac_charge_times(...)            # Read charge periods
  api.sph_read_ac_discharge_times(...)         # Read discharge periods

  DeviceType enum:
  from growattServer import DeviceType  # SPH=5, MIN=7, etc.

Documentation:

  • README updates with all method signatures
  • Example script (examples/sph_example.py)

Technical Details

  • Endpoints: device/mix/*, mixSet, readMixParam (SPH uses MIX endpoints)
  • Time Periods: 3 AC charge + 3 AC discharge periods per API specification
  • Review: Parameter ranges match official Growatt V1 API docs

Testing


Related: Based on #125 discussion; independent implementation from master branch.
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr

johanzander and others added 16 commits September 28, 2024 17:45
…_get_energy_overview(), tlx_get_energy_prod_con()
Co-authored-by: indykoning <15870933+indykoning@users.noreply.github.com>
Updates after review comments
Implements complete V1 API support for SPH (type 5) hybrid inverters,
parallel to existing MIN device support.

Changes:
- Add DeviceType enum to distinguish device types
- Implement 10 SPH methods in OpenApiV1:
  * sph_detail() - Get device details
  * sph_energy() - Get current energy data
  * sph_energy_history() - Get historical data (7-day max)
  * sph_settings() - Get all inverter settings
  * sph_read_parameter() - Read specific parameters
  * sph_write_parameter() - Write parameters
  * sph_write_ac_charge_time() - Configure AC charge periods (1-3)
  * sph_write_ac_discharge_time() - Configure AC discharge periods (1-3)
  * sph_read_ac_charge_times() - Read all charge periods
  * sph_read_ac_discharge_times() - Read all discharge periods
- Add comprehensive documentation to README
- Include working example script (examples/sph_example.py)

Technical details:
- SPH devices use 'mix' endpoints internally (device/mix/*)
- AC charge/discharge periods support 3 time windows each
- Methods follow same patterns as existing MIN implementation
- All endpoints match official Growatt V1 API documentation
@johanzander johanzander closed this Jan 8, 2026
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.

1 participant