pyresideo-firstalert
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
Browser-assisted login (recommended)
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
Release files for pyresideo-firstalert 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyresideo_firstalert-1.3.0.tar.gz | 36.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyresideo_firstalert-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.1 kB
Release files / pyresideo_firstalert-1.3.0.tar.gz
| Download URL | pyresideo_firstalert-1.3.0.tar.gz |
|---|---|
| Size | 36.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0308abcf5fc076cd3e7f5735c9f41e531a3b074074a16fdbde47de7a85416731
|
|
BLAKE2b-256 checksum How to use checksums |
04d63e4015e1f66ec4697e8e727a574a1c7da454b976b03d83885b7f5bcd154f
|
| 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 logRelease files / pyresideo_firstalert-1.3.0-py3-none-any.whl
| Download URL | pyresideo_firstalert-1.3.0-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f00f4c459e290ce70dd66202e114a5d1e6b6b1f2cc33711b0b186d27632cd7f
|
|
BLAKE2b-256 checksum How to use checksums |
87421f94fd2c713c4c9edc868ef958fa8f8d490eedd7cd1648ffcc22377c30f4
|
| 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