pyadtpulse - Python interface for ADT Pulse
Python client interface to the ADT Pulse security system.
UNSUPPORTED
This is an unsupported interface provided only as a basis for others to explore integrating their ADT system with their own tools. PLEASE FEEL FREE TO CONTRIBUTE CHANGES! Pull requests are accepted.
pyadtpulse reads the zones (motion sensors, door sensors, etc.) and alarm state of an ADT Pulse site, and arms and disarms it. Its main user is the Home Assistant ADT Pulse integration.
NOTE: Since this interacts with the unofficial ADT Pulse web portal, the behavior is subject to change by ADT without notice.
Making Contributions
Want to contribute? See the Development documentation for setup instructions.
WARNING
Do not reauthenticate to the ADT service frequently as ADT's service is not designed for high volume requests. E.g. every 5 minutes, not seconds. Keep your authenticated session to avoid logging in repeatedly.
Installation
pip install pyadtpulse
pyadtpulse needs Python 3.10 or newer.
Usage
ADT Pulse logs out other sessions that use the same account and fingerprint, so a best practice is to create a separate username/password for each client accessing ADT Pulse.
pyadtpulse uses one site (premises/location) per login. If your account has several sites, create a separate username/password for each site, with access to only that site. This ensures that clients are always interacting with that one site (and not accidentally with another site location).
Changes to the name or number of sites are not picked up by an existing client; create a new one.
Example
PyADTPulseAsync is the client to use. It logs in, keeps the session alive in the
background and tells you when something changes:
import asyncio
from pyadtpulse import PyADTPulseAsync
async def main() -> None:
adt = PyADTPulseAsync("user@example.com", "password", "my-fingerprint")
await adt.async_login()
try:
site = adt.site
print(site.name, site.alarm_control_panel.status)
for zone in site.zones or []:
print(zone["zone"], zone["name"], zone["state"], zone["status"])
while True:
alarm_changed, zone_ids = await adt.async_wait_for_update()
if alarm_changed:
print("Alarm is now", site.alarm_control_panel.status)
for zone_id in zone_ids:
zone = site.zones_as_dict[zone_id]
print(zone.name, "is now", zone.state)
finally:
await adt.async_logout()
asyncio.run(main())
async_login()raisesPulseMFARequiredErrorwhen ADT wants a verification code first; see Verification code (MFA) login. Other failures raisePulseAuthenticationError(wrong username or password),PulseAccountLockedError, or a connection error, all frompyadtpulse.exceptions.adt.siteis the site the login belongs to.site.zonesis a list of dicts (zone,name,id_,tags,status,state,last_activity_timestamp);site.zones_as_dictmaps zone ids to the same data as objects.site.alarm_control_panel.statusis one of"off","away","stay","night","arming","disarming"or"unknown". The panel also hasis_disarmed,is_away,is_home,is_armed_night,is_force_armed,is_armingandis_disarming.async_wait_for_update()waits until ADT reports a change and returns whether the alarm state changed, plus the ids of the zones that did. It raises the error the background tasks hit, for examplePulseGatewayOfflineErrororPulseNotLoggedInError; callasync_login()again after aPulseNotLoggedInError.adt.is_connectedsays whether the client currently has a working session.
To arm or disarm the site:
await site.async_disarm()
await site.async_arm_home() # "stay"
await site.async_arm_away()
await site.async_arm_night()
await site.async_arm_away(force_arm=True) # arm even with open zones
Each returns True if ADT accepted the command.
Verification code (MFA) login
ADT trusts a device by its fingerprint. The first login with a fingerprint ADT doesn't
know makes async_login() raise PulseMFARequiredError. Finish that login with a
verification code:
from pyadtpulse import PyADTPulseAsync
from pyadtpulse.exceptions import (
PulseMFARequiredError,
PulseNotLoggedInError,
PulseAuthenticationError,
)
async def login(adt: PyADTPulseAsync) -> None:
try:
await adt.async_login()
except PulseMFARequiredError:
method = await adt.async_request_mfa_code() # ADT sends the code, e.g. by email
code = input(f"Code sent by {method}: ")
try:
await adt.async_complete_mfa_login(code, device_name="my-script")
except PulseAuthenticationError:
... # wrong code: ask again, or request a new code
except PulseNotLoggedInError:
... # the login failed after the code: start over with async_login()
async_request_mfa_code(method_id=None)asks ADT to send a code with the first verification method on the account, or withmethod_id(such as"EMAIL"). It returns the method used. It raisesPulseAuthenticationErrorif ADT refuses, andPulseNotLoggedInErrorif no verification is pending (log in again first).async_complete_mfa_login(code, device_name="pyadtpulse")checks the code and finishes the login, likeasync_login().PulseAuthenticationError: ADT rejected the code. The verification is still pending, so you can callasync_complete_mfa_login()again with the right code, orasync_request_mfa_code()for a new one.PulseNotLoggedInError: no verification was pending, or ADT accepted the code but the login still failed. The code is spent; start over withasync_login().
- After a correct code, pyadtpulse adds the fingerprint to the account's trusted devices
under
device_name(with a short suffix if the name is taken). Later logins with the same fingerprint skip the code. If ADT refuses to trust the device, the login still succeeds, a warning is logged, and the next login asks for a code again.
Fingerprint
The fingerprint argument is the device fingerprint ADT uses to recognise a trusted
device. It doesn't have to come from a browser: pick a string, trust it once with the
verification code flow above, then reuse the same string for every login. To make one:
from pyadtpulse.util import generate_random_fingerprint
fingerprint = generate_random_fingerprint() # store it and reuse it
A new fingerprint means a new verification code, and adds another trusted device to the account.
Warning: ADT allows one session per account and fingerprint. If another connection logs in to the Pulse portal with the same fingerprint, the first connection is logged out. Use a fingerprint only one client uses, and don't reuse one from a browser you log in to Pulse with.
Using a browser's fingerprint
Before the verification code flow existed, the only way to get a trusted fingerprint was to trust a browser on the Pulse website and copy that browser's fingerprint. This still works if you already have one. Either:
- Open the fingerprint detector (source) in the browser you trusted, or
- Follow homebridge-adt-pulse's instructions.
A browser's fingerprint changes when the browser or OS is upgraded, and you then need to trust it again.
Options
PyADTPulseAsync(username, password, fingerprint, ...) also takes:
| Argument | Default | Meaning |
|---|---|---|
service_host |
"https://portal.adtpulse.com" |
Portal to use. Canadian accounts use "https://portal-ca.adtpulse.com" (pyadtpulse.const.API_HOST_CA). |
user_agent |
a desktop Chrome user agent | User-Agent header sent to ADT. |
keepalive_interval |
5 |
Minutes between keepalive requests that keep the session open. Must be from 1 to 15. |
relogin_interval |
120 |
Minutes between background re-logins. Each re-login happens at a random point between 75% and 100% of the interval. Must be at least 20. |
detailed_debug_logging |
False |
Log more detail, such as each request and how long updates take. |
keepalive_interval, relogin_interval and detailed_debug_logging are also properties
you can change on a running client. Setting keepalive_interval or relogin_interval to
None restores the default; a value out of range raises ValueError.
adt.keepalive_interval = 10 # minutes
adt.relogin_interval = 60 # minutes
adt.site.gateway.poll_interval = 2.0 # seconds between update checks (the default)
poll_interval belongs to the site's gateway and is only available after login. When the
gateway goes offline, pyadtpulse backs off from it, up to 10 minutes between checks.
Upgrading to 3.0
pyadtpulse 3.0 finishes the API cleanup:
-
PyADTPulseAsync.sitesis removed. UsePyADTPulseAsync.site. -
PulseNotLoggedInErrorsubclassesPulseConnectionErrorinstead ofPulseLoginException. It means the session ended, not that the credentials were rejected, soexcept PulseLoginExceptionno longer catches it. Catch it on its own (or as aPulseConnectionError) and log in again. -
Every public coroutine now starts with
async_:2.x 3.0 PyADTPulseAsync.wait_for_update()async_wait_for_update()PulseBackoff.wait_for_backoff()async_wait_for_backoff()ADTPulseSite.set_device()async_set_device()ADTPulseSite.fetch_devices()async_fetch_devices()PulseConnection.quick_logout()async_quick_logout()PulseQueryManager.query_orb()async_query_orb()PulseConnectionProperties.clear_session()async_clear_session()wait_for_update()andwait_for_backoff()still work but raise aDeprecationWarning; they will be removed in 4.0. -
The
debug_locksparameter is removed fromPyADTPulseAsyncand the other classes, along withutil.DebugRLockandutil.set_debug_lock(). The internal threading locks are gone too: the client runs on one event loop, where they never stopped coroutines from interleaving. Pass the other arguments by keyword.
Upgrading to 2.0
pyadtpulse 2.0 removes code that was deprecated or never worked:
- The synchronous
PyADTPulseclient, along with the syncADTPulseSitemethodsarm_home(),arm_away(),disarm()andupdate_zones(). UsePyADTPulseAsyncand the site'sasync_arm_home(),async_arm_away(),async_arm_night()andasync_disarm()methods instead. util.generate_fingerprint_from_browser_json(). Pass the fingerprint string itself (see Fingerprint).- The deprecated
ADTPulseSitemembersupdates_may_exist,update(),async_update()andsite_lock.PyADTPulseAsync.wait_for_update()reports updates. ADTPulseZones.update_status(),update_state()andupdate_last_activity_timestamp(). Useupdate_device_info().PyADTPulseAsync.sync_check_exception, which was documented as internal.- The event-loop helpers left from the sync client:
check_sync(),check_async()andlooponPulseConnectionProperties, andPulseConnection.check_sync(). - The unused constants
ADT_ZONES_URI,ADT_STATES_URI,ADT_ARM_URI,STATE_OPEN,STATE_MOTION,STATE_TAMPER,STATE_ALARM,STATE_UNKNOWNandADT_SENSOR_*.
Other changes:
ADTPulseFlattendZoneis renamedADTPulseFlattenedZone.PyADTPulseAsync.sitesnow raises aDeprecationWarningand will be removed in 3.0. UsePyADTPulseAsync.site.wait_for_update()returns aPulseUpdatenamed tuple withalarm_changedandupdated_zonesfields. It still unpacks and indexes like the old tuple.ADTPulseSite.zonesandzones_as_dictreturn an empty list orADTPulseZoneswhen the site has no zones, instead of raisingRuntimeError.
See Also
- ADT Pulse Portal
- Home Assistant ADT Pulse integration
- adt-pulse-mqtt – MQTT integration with ADT Pulse alarm panels
Future Enhancements
Feature ideas:
- Cameras (via Janus)
Feature ideas, but no plans to implement:
- support OFFLINE status checking
- support multiple sites (premises/locations) under a single ADT account
- alarm history (/ajax/alarmHistory.jsp)
Metadata
Release files for pyadtpulse 3.0.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 | Provenance | Actions |
|---|---|---|---|---|
| pyadtpulse-3.0.0.tar.gz | 45.7 kB | With provenance | Details for pyadtpulse-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyadtpulse-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for pyadtpulse-3.0.0-py3-none-any.whl |
Total release size: 97.7 kB
Release files / pyadtpulse-3.0.0.tar.gz
| Download URL | pyadtpulse-3.0.0.tar.gz |
|---|---|
| Size | 45.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bab4cc1f4f9b57f193de33f14ba5f08ccb842f6fd6a45509f97cecf110c0b690
|
|
BLAKE2b-256 checksum How to use checksums |
42089c1d20e15f648261a01cf965f807df90486da637747e5c47b5d609aad8e3
|
| 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 24, 2026.
Transparency logRelease files / pyadtpulse-3.0.0-py3-none-any.whl
| Download URL | pyadtpulse-3.0.0-py3-none-any.whl |
|---|---|
| Size | 52.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96dff20085e82b93146cc500e784182eb534d8ce9c049dc9b7e000f480ce834d
|
|
BLAKE2b-256 checksum How to use checksums |
ff64118b0b4b42798eddfe00fd69a1736ce0cb1c50f17b8f9fdadf830dfd7be1
|
| 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 24, 2026.
Transparency logSecurity for pyadtpulse 3.0.0
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.
Attestation for pyadtpulse-3.0.0.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 24, 2026.
Transparency logA 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.