Skip to main content

Async Python library for controlling Dimplex/Faber fireplaces via the Flame Connect cloud API

Project description

FlameConnect

CI PyPI Python

Async Python library for controlling Dimplex, Faber, and Real Flame fireplaces via the Flame Connect cloud API.

FlameConnect TUI

Installation

uv add flameconnect

To include the interactive terminal dashboard (TUI):

uv add flameconnect[tui]

Quick Start

import asyncio
from flameconnect import FlameConnectClient, MsalAuth

async def main():
    auth = MsalAuth()
    async with FlameConnectClient(auth=auth) as client:
        fires = await client.get_fires()
        for fire in fires:
            print(f"{fire.friendly_name} ({fire.fire_id})")

        # Turn on the first fireplace
        await client.turn_on(fires[0].fire_id)

        # Read current state
        overview = await client.get_fire_overview(fires[0].fire_id)
        for param in overview.parameters:
            print(param)

asyncio.run(main())

Authentication

FlameConnect supports two authentication modes depending on your use case.

Standalone (CLI / TUI)

Uses the built-in MsalAuth provider, which runs an interactive Azure AD B2C login through your browser. On first run a browser window opens for you to sign in with your Flame Connect account credentials. Subsequent runs reuse the cached token stored at ~/.flameconnect_token.json, refreshing it automatically when it expires.

from flameconnect import FlameConnectClient, MsalAuth

auth = MsalAuth()
async with FlameConnectClient(auth=auth) as client:
    ...

Integration (Home Assistant, etc.)

Use TokenAuth to inject your own bearer token or an async token provider function. This avoids any interactive browser flow and lets your integration manage tokens externally.

from flameconnect import FlameConnectClient, TokenAuth

# With a static token string:
auth = TokenAuth("your-bearer-token")

# Or with an async token provider:
auth = TokenAuth(my_async_token_func)

async with FlameConnectClient(auth=auth) as client:
    ...

You can also pass an existing aiohttp.ClientSession to share a session with your application:

async with FlameConnectClient(auth=auth, session=my_session) as client:
    ...

CLI Usage

The flameconnect command provides a straightforward interface for controlling your fireplace from the terminal. Add -v to any command for debug logging.

List registered fireplaces

flameconnect list

Show current status

flameconnect status <fire_id>

Turn on / off

flameconnect on <fire_id>
flameconnect off <fire_id>

Set parameters

# Set operating mode (standby or manual)
flameconnect set <fire_id> mode manual

# Set flame speed (1-5)
flameconnect set <fire_id> flame-speed 3

# Set brightness (0-255)
flameconnect set <fire_id> brightness 200

# Set heat mode (normal, boost, eco, fan-only)
flameconnect set <fire_id> heat-mode eco

# Set heater target temperature
flameconnect set <fire_id> heat-temp 22.5

# Set countdown timer in minutes (0 to disable)
flameconnect set <fire_id> timer 120

Launch the TUI

flameconnect tui

TUI

flameconnect tui launches an interactive terminal dashboard built with Textual. It requires the TUI extra:

uv add flameconnect[tui]

The dashboard displays real-time fireplace status and auto-refreshes every 10 seconds. Key bindings:

Key Action
p Toggle power on/off
r Manual refresh
q Quit

API Coverage

The table below lists all known Flame Connect cloud API endpoints and their implementation status in this library.

Fireplace Control (Core)

Endpoint Method Status
/api/Fires/GetFires GET Implemented
/api/Fires/GetFireOverview GET Implemented
/api/Fires/WriteWifiParameters POST Implemented

Fireplace Management

Endpoint Method Status
/api/Fires/AddFire POST Not implemented
/api/Fires/DeleteFire POST Not implemented
/api/Fires/VerifyFireIdAndCode POST Not implemented
/api/Fires/ClaimOwnership POST Not implemented
/api/Fires/GetFireUsers GET Not implemented
/api/Fires/DeleteFireUsersAccess POST Not implemented
/api/Fires/AcceptOrRejectRequest POST Not implemented
/api/Fires/RequestAccessToFire POST Not implemented
/api/Fires/UpdateFireDetails POST Not implemented

Identity

Endpoint Method Status
/api/Identity/RegisterNewUserReturnHubsAndSites GET Not implemented
/api/Identity/GetUserContext GET Not implemented
/api/Identity/AcceptTermsAndConditions POST Not implemented
/api/Identity/EditProfile POST Not implemented
/api/Identity/DeleteUser POST Not implemented
/api/Identity/AddOrUpdateMobileAppUserRecord POST Not implemented
/api/Identity/CheckAppUnderMaintenance GET Not implemented
/api/Identity/GetAppUrls GET Not implemented
/api/Identity/GetMinimumAppVersionByMobileAppName GET Not implemented

Favourites

Endpoint Method Status
/api/Fires/AddFavourite POST Not implemented
/api/Fires/UpdateFavourite POST Not implemented
/api/Fires/DeleteFavourite POST Not implemented

Schedules

Endpoint Method Status
/api/Fires/UpdateFireSchedule POST Not implemented

Guest Mode

Endpoint Method Status
/api/Fires/GetGuestMode GET Not implemented
/api/Fires/SaveGuestMode POST Not implemented

Notifications

Endpoint Method Status
/api/Fires/GetNotifications GET Not implemented
/api/Fires/DeleteInAppNotifications POST Not implemented

Hubs

Endpoint Method Status
/api/Hubs/FetchTimezoneDetails GET Not implemented
/api/Fires/UpdateFirmwareVersion POST Not implemented
/api/BluetoothFirmware/AddBluetoothFirmwareHistory POST Not implemented

Contributing

# Clone and install with dev dependencies
git clone https://github.com/deviantintegral/flameconnect.git
cd flameconnect
uv sync --dev

# Lint and type-check
uv run ruff check .
uv run mypy src/

# Run tests
uv run pytest

# Mutation testing (protocol layer)
uv run mutmut run --paths-to-mutate=src/flameconnect/protocol.py

Please follow Conventional Commits for commit messages.

Do you work at Dimplex, Faber, or Real Flame, or support the underlying web services?

This library and app aims to follow the same patterns as the official apps to minimize load on back-end infrastructure. We avoid making API calls whenever possible, and mirror the app by making data refreshes a specific user action. This library implementation is a last resort. We're glad to implement improvements if this library is causing any challenges on the back-end servers.

But really... making these remote calls is laggy and complex! As a comparison, take a look at the Lennox iComfort S30 and similar line of themostats. They have a cloud API, but also have a fully local API that works even when the internet is down. And, it's way, way faster to respond. If a local API is made available, I'd be glad to drop this library in favour of it. Let's talk!

License

Apache-2.0

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

flameconnect-0.1.0.tar.gz (748.6 kB view details)

Uploaded Source

Built Distribution

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

flameconnect-0.1.0-py3-none-any.whl (65.4 kB view details)

Uploaded Python 3

File details

Details for the file flameconnect-0.1.0.tar.gz.

File metadata

  • Download URL: flameconnect-0.1.0.tar.gz
  • Upload date:
  • Size: 748.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flameconnect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07cb695641be03b3304142d132c389dee1ae73853015d47757751ab4e65ea659
MD5 3f7d8f940d361d8c3728e05b247d9ffd
BLAKE2b-256 f1be08342446d02672587366d4e05cd4e5a8d2b1c1e55d8ef6f27efee5611373

See more details on using hashes here.

Provenance

The following attestation bundles were made for flameconnect-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on deviantintegral/flameconnect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flameconnect-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flameconnect-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 65.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flameconnect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ede3b9594fa7d439317cc44a16d2c3c91d5f6bf715091d2e01568d101499fbe9
MD5 15125f77583c7f054a5dc47fab3bb035
BLAKE2b-256 908adda592404ffb185ff858560efa3305be2300967b58fb209b224184db2f60

See more details on using hashes here.

Provenance

The following attestation bundles were made for flameconnect-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on deviantintegral/flameconnect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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