Skip to content

Migrate SAJ eSolar integration to the current Elekeeper API client#121

Open
jaesbit wants to merge 1 commit into
djansen1987:beta-1.6.0from
jaesbit:feature/pysaj-elekeeper-v2
Open

Migrate SAJ eSolar integration to the current Elekeeper API client#121
jaesbit wants to merge 1 commit into
djansen1987:beta-1.6.0from
jaesbit:feature/pysaj-elekeeper-v2

Conversation

@jaesbit

@jaesbit jaesbit commented May 14, 2026

Copy link
Copy Markdown
Contributor

Hi,

This PR proposes a larger modernization of the integration by moving the SAJ eSolar cloud communication into a dedicated Python client library: pysaj-elekeeper.

The current implementation still relies on the older portal/API flow and keeps a lot of request, parsing and authentication logic inside the Home Assistant integration itself. This change moves that responsibility into the library and updates the integration to consume the current Elekeeper API used by the newer SAJ web portal.

What this brings

  • Uses the current Elekeeper API flow instead of the legacy portal scraping/request logic.
  • Moves API-specific details out of the Home Assistant integration and into pysaj-elekeeper.
  • Centralizes Elekeeper authentication, request signing and password encryption in the library.
  • Uses Home Assistant's shared async HTTPX client, avoiding blocking SSL/client setup inside the event loop.
  • Simplifies the integration code by using a DataUpdateCoordinator.
  • Keeps the Home Assistant layer focused on configuration, coordination and sensors.
  • Refreshes sensor icons so the entities are easier to read in the UI.

Why a separate library

The Elekeeper API requires several details that are not ideal to keep duplicated inside a Home Assistant custom component:

  • signed request parameters
  • encrypted password handling
  • bearer-token authentication
  • endpoint-specific parsing
  • plant/device/energy-flow mapping

The client library is available here: https://github.com/giovadroid/pysaj-elekeeper

Keeping this logic in a standalone package should make it easier to maintain, test and reuse outside this custom component if other SAJ/Elekeeper integrations need the same API layer.

Notes

This is a bigger change than the previous small fixes I contributed in #85 and #88. Those were targeted fixes around the existing API flow; this PR moves the integration toward the newer Elekeeper API model and should make future maintenance easier if the older endpoints are changed or deprecated.

The library currently exposes the import module as elekeeper, while the package requirement is pysaj-elekeeper.

Validation

  • python3 -m py_compile custom_components/saj_esolar/*.py
  • git diff --check
  • Tested locally against a Home Assistant setup with the custom integration installed

@djansen1987

Copy link
Copy Markdown
Owner

Hi @jaesbit,

Would you be intrested in becoming the maintainer of the integration ? i do not use it anymore and also @santiagozky is not using it anymore. There for you PR was missed. I Think it would be a great addition. Let me know and i can add you to the list.

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