Skip to main content

pyresideo-firstalert

PyPI Tests License: MIT

Async Python client for the Resideo First Alert smart smoke/CO detector API.

Extracted from the ha-resideo-firstalert Home Assistant integration so the API layer can be used independently.

Installation

pip install pyresideo-firstalert

Usage

import aiohttp
from resideo_firstalert_api import ResideoApiClient

async with aiohttp.ClientSession() as session:
    client = ResideoApiClient(session, refresh_token="your-token")
    states = await client.get_all_device_states()
    for device_id, state in states.items():
        print(f"{state.name}: smoke={state.smoke_state}, co={state.co_state}")

Authentication

Resideo added a bot check (captcha) to its Auth0 login form, so the scripted ResideoAuth.authenticate() flow below no longer works — it fails with invalid_captcha even for correct credentials. A real browser passes the captcha invisibly, so the workaround is to have the user sign in themselves and hand the resulting authorization code back to your script:

from resideo_firstalert_api import (
    build_authorize_url,
    exchange_code_for_tokens,
    generate_pkce_pair,
    parse_authorization_code,
)

code_verifier, code_challenge, state = generate_pkce_pair()
print("Open this URL in a browser and sign in:")
print(build_authorize_url(code_challenge, state))

# After signing in, the browser lands on a page with the authorization code
# in the address bar (e.g. "https://login.resideo.com/.../callback?code=...").
# Paste that whole address, or just the code, back into your script.
pasted = input("Paste the address bar URL or code: ")
code = parse_authorization_code(pasted, expected_state=state)

async with aiohttp.ClientSession() as session:
    tokens = await exchange_code_for_tokens(session, code, code_verifier)
    refresh_token = tokens["refresh_token"]

The authorization code is single-use and expires quickly, so exchange it promptly after the user pastes it back.

Email/password login (currently blocked by Resideo's captcha)

from resideo_firstalert_api import ResideoAuth

async with aiohttp.ClientSession() as session:
    auth = ResideoAuth(session)
    tokens = await auth.authenticate("email@example.com", "password")
    refresh_token = tokens["refresh_token"]

Real-time Events

Subscribe to real-time device state changes via SignalR:

from resideo_firstalert_api import SignalRClient

client = SignalRClient(session, get_access_token=..., on_event=...)
await client.start(device_ids=["device1", "device2"])

API Reference

The full API is documented in an OpenAPI 3.1.0 spec covering all endpoints, schemas, and alarm state enums.

License

MIT

Release files for pyresideo-firstalert 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyresideo-firstalert 1.1.0
File Size Uploaded
pyresideo_firstalert-1.1.0.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyresideo-firstalert 1.1.0
File Interpreter ABI Platform
pyresideo_firstalert-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.4 kB

Release files / pyresideo_firstalert-1.1.0.tar.gz

Download URL pyresideo_firstalert-1.1.0.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9e1919de1b97ebe7a85f844539be04221c58835a1ad9a209f366c9db4cda2e3e
BLAKE2b-256 checksum
How to use checksums
48ca5f92c0080af9f22e6a524b0e14a0806e4fffc1d4fa53de89ab6ca36a935e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Release files / pyresideo_firstalert-1.1.0-py3-none-any.whl

Download URL pyresideo_firstalert-1.1.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
488b10c385512a5852f475e02222d4c9889c27dac67cb93db77fd13be3fe63c1
BLAKE2b-256 checksum
How to use checksums
c681030def7ddfed7b1b563f978c1681a3a07eabcae411c8535954c070316cb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.1

2 release files

This release

1.1.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page