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

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.2
File Size Uploaded Provenance Actions
pyresideo_firstalert-1.3.2.tar.gz 36.5 kB With provenance Details for pyresideo_firstalert-1.3.2.tar.gz

Built distribution (wheel)

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

Total release size: 53.6 kB

Release files / pyresideo_firstalert-1.3.2.tar.gz

Download URL pyresideo_firstalert-1.3.2.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
de519c4e97f3fe9846c7bafbea8424158079bf95de81a2fee5c2f13b4d526733
BLAKE2b-256 checksum
How to use checksums
5aad31961a3c1383596768893a3a0123aee80c2b29d8c8e83dea82ed569ffc18
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 11, 2026.

Transparency log

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

Download URL pyresideo_firstalert-1.3.2-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be719dc2bc06b33bcdfc6ddc2359eddf28cab48a956f3258e1357ba1d26fde65
BLAKE2b-256 checksum
How to use checksums
08b8c210c6cc14cc0ff5b0d3c1bfbe9c095c777cd0b66c54c149cbf71e82b197
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 11, 2026.

Transparency log

Security for pyresideo-firstalert 1.3.2

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.2.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 11, 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