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.

Contributing

See CONTRIBUTING.md for dev setup and how this repo relates to ha-resideo-firstalert. Agents/AI contributors should also read AGENTS.md.

License

MIT

Metadata

Release files for pyresideo-firstalert 1.3.1

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.3.1
File Size Uploaded Provenance Actions
pyresideo_firstalert-1.3.1.tar.gz 36.3 kB With provenance Details for pyresideo_firstalert-1.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 53.4 kB

Release files / pyresideo_firstalert-1.3.1.tar.gz

Download URL pyresideo_firstalert-1.3.1.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0ca4dbcc52cb32b5db2cf5c290d01267d3bb2303c819f32dd5458a9ebf6f8651
BLAKE2b-256 checksum
How to use checksums
98e8d2628860eaa027dbbf8549b46fdbec64496f0d7e1d2d9d6cdc70cf1d9118
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 4, 2026.

Transparency log

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

Download URL pyresideo_firstalert-1.3.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c826b8d993a5b45c9a8a444c11ccdb1f2ac81d7154971e2652b8bacd38c73dc
BLAKE2b-256 checksum
How to use checksums
a62fcba443f3407bb09b8726363d47db485e456030ee17b6c77c32c9a53dcde8
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 4, 2026.

Transparency log

Security for pyresideo-firstalert 1.3.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.

Select from 2 files

Attestation for pyresideo_firstalert-1.3.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 4, 2026.

Transparency log

A 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.

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