pyfenixcontrol
Asynchronous Python client for the FENIX Control cloud, used by FENIX TFT WiFi thermostats. It powers the FENIX integration for Home Assistant, but has no Home Assistant dependency and can be used from any asyncio code.
- Fully typed (
py.typed),asyncio+aiohttp, Python 3.12+ - Read thermostats, rooms and installations; set target temperature and operating mode
- Installation-wide holiday schedules
- Room energy consumption at hourly … yearly aggregation
- Pluggable authentication: bundled e-mail/password login, or bring your own OAuth2 tokens
- Automatic token refresh, single retry on HTTP 401, backoff on HTTP 5xx
Installation
pip install pyfenixcontrol
Quick start
import asyncio
import aiohttp
from pyfenixcontrol import FenixControlClient, PasswordAuth, PresetMode
async def main() -> None:
async with aiohttp.ClientSession() as session:
auth = PasswordAuth(session, "you@example.com", "password")
client = FenixControlClient(auth)
for device in await client.get_devices():
print(device.name, device.room_temperature, device.target_temperature)
await client.set_target_temperature(device.id, 21.5)
await client.set_preset_mode(device.id, PresetMode.PROGRAM)
asyncio.run(main())
Authentication
The client never sees credentials. It asks an AbstractAuth for a bearer token:
from pyfenixcontrol import AbstractAuth
class MyAuth(AbstractAuth):
async def async_get_access_token(self) -> str:
return await my_token_store.get_valid_token()
async def async_invalidate_access_token(self) -> None:
# Called after an HTTP 401; optional.
await my_token_store.mark_expired()
PasswordAuth performs the OAuth2 authorization-code + PKCE login used by the
FENIX Control app and keeps tokens in memory. await auth.async_login() validates
credentials up front (e.g. in a setup wizard).
PasswordAuth needs an aiohttp session with a working cookie jar, because the
identity server tracks its login form with cookies. Cookies of the identity host
are cleared before each full login.
API overview
| Method | Description |
|---|---|
get_user_id() |
Account subject id (cached on the client) |
get_installations() |
Installations (homes) with their rooms and device ids |
get_devices(installations=None) |
Device state of every thermostat |
get_device_properties(device_id) |
Raw device twin properties |
trigger_installation_update(installation_id) |
Ask thermostats to report fresh values |
set_target_temperature(device_id, celsius) |
Set target °C (switches to manual) |
set_preset_mode(device_id, mode) |
PresetMode.OFF / PROGRAM / MANUAL / DEFROST / BOOST / HOLIDAYS |
set_holiday_schedule(installation_id, start, end, mode) |
Holiday for the whole installation |
cancel_holiday_schedule(installation_id) |
Remove the holiday schedule |
get_room_energy(installation_id, room_id, start, end, period) |
EnergyMetric buckets in Wh |
Errors
| Exception | Meaning |
|---|---|
FenixControlAuthError |
Credentials or tokens rejected – user action needed |
FenixControlConnectionError |
Network error or timeout – retry later |
FenixControlResponseError |
Unexpected status or body (.status holds the HTTP code) |
All inherit from FenixControlError.
Units and conventions
- Temperatures are °C. The API transports °F ×
divFactor;decode_temperature()/encode_temperature()convert. - Holiday
start/endare wall-clock times of the installation (no time zone conversion). Energy queries convert to UTC; naive datetimes are taken as UTC. - Every model keeps the original payload in
.rawfor fields not yet modelled.
Development
uv sync
uv run pytest --cov
uv run ruff check . && uv run ruff format --check . && uv run mypy
Tests run against a local fake of the cloud and identity server; no account is needed.
Releases: bump __version__, update CHANGELOG.md, publish a GitHub release
tagged vX.Y.Z. The release workflow publishes to PyPI via trusted publishing.
License
MIT – see LICENSE.
Developed in cooperation with FENIX Trading s.r.o. FENIX and FENIX Control are trademarks of their respective owners. The FENIX Control cloud is operated by the manufacturer; its API may change without notice.
Metadata
Release files for pyfenixcontrol 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfenixcontrol-0.1.1.tar.gz | 22.8 kB | With provenance | Details for pyfenixcontrol-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfenixcontrol-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyfenixcontrol-0.1.1-py3-none-any.whl |
Total release size: 40.1 kB
Release files / pyfenixcontrol-0.1.1.tar.gz
| Download URL | pyfenixcontrol-0.1.1.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5cfef2f73328fc6254d1f4b7f0dd10cfcb2c57a55bec309f4ff6afdc0425ddb
|
|
BLAKE2b-256 checksum How to use checksums |
123326f80e14fe2eccd77f336998537db3e98fcdd8db6c8c9202193571bacdfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / pyfenixcontrol-0.1.1-py3-none-any.whl
| Download URL | pyfenixcontrol-0.1.1-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d411a52091338329294c0351fd2f1316b468b2e78aef3d2f0ba9516586fef3f
|
|
BLAKE2b-256 checksum How to use checksums |
bccf21bebec3c9fced60b4f741a75a549456a1b102353ece51fd9629f6aa67a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for pyfenixcontrol 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pyfenixcontrol-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.