Skip to main content

Client library for Fronius (Gen24) inverter using the web api

Project description

Fronius Gen24 Client (Python)

A lightweight Python client for Fronius Gen24 solar inverters that can authenticate like a browser (cookies + CSRF) and access endpoints that are not exposed by the public solar_api.

This is intended to be used later in a Home Assistant integration or other automations/scripts.

Features

  • Simple, synchronous Python API built on requests.
  • Browser-like session with cookies, CSRF token discovery, and configurable headers.
  • Public API helpers (e.g., power flow) using /solar_api/... endpoints.
  • Configurable "hidden" endpoints for settings that require login to the web UI.
  • Small CLI for quick testing.

Disclaimer

The Fronius Gen24 web UI and endpoints may vary by firmware. Some settings are intentionally not documented by the vendor, and may change without notice. Use at your own risk. This project aims to provide a flexible client that you can configure to match your device's behavior.

Installation

  • Local develop install:
pip install -e .
  • From source:
pip install .

Quick start

from fronius_gen24 import FroniusGen24Client

client = FroniusGen24Client(
    base_url="http://192.168.1.100",  # Change to your inverter IP or hostname
    verify_ssl=False,                  # Gen24 may use self-signed certs; set True if trusted
)

# Optional: login if you need access to protected settings
client.login(username="customer", password="your-password")

# Public API example
pf = client.get_power_flow()
print(pf)

# Access a protected (UI) endpoint (example, may vary by firmware)
# You should inspect your device (browser devtools) to find the URL and payload.
# client.set_setting("/rest/energy/settings", {"someSetting": 1})

CLI

A minimal CLI is available for smoke testing:

python -m fronius_gen24 --host 192.168.1.100 --username user --password pass --power-flow

Notes

  • This client now uses HTTP Digest authentication exclusively for web UI login.
  • By default it will try the endpoint /api/commands/Login. You can override the path by passing login_url to the client.

Notes for Home Assistant

  • The current client is synchronous. For optimal HA integration, wrap calls with async_add_executor_job or create an async wrapper later.
  • Expose timeouts and exception handling to avoid blocking the event loop.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fronius_web_api-0.2.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fronius_web_api-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file fronius_web_api-0.2.0.tar.gz.

File metadata

  • Download URL: fronius_web_api-0.2.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for fronius_web_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4b4066c7c0abfd6c4c03f4b47e0f991d6b62acb82f934c0ab304998e676f137f
MD5 ef579466c3132ba98f7630f23e32debe
BLAKE2b-256 5681b6c0f507f1f6899e4c95044eabd2c2b97cbb38cfef9779f6965580396cf9

See more details on using hashes here.

File details

Details for the file fronius_web_api-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fronius_web_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa5f79d6b8b3a64d0505567589f4c3b373894921eb3bc5a774469c6815043eb
MD5 998069bcf8a0ea8a1d636c5ef941b4a3
BLAKE2b-256 e0c72bf0cab3954f2863b6edc04c1cc4e788ab6a61b609c9d4acdb1b4912da87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page