Skip to main content

Crate alarm_dot_com

Crate alarm_dot_com 

Source
Expand description

§alarm-dot-com

A Rust library for interfacing with Alarm.com security panels.

This library reverse-engineers the Alarm.com web portal’s AJAX API to provide programmatic access to your alarm panel, sensors, locks, garage doors, lights, and thermostats.

§Quick Start

use alarm_dot_com::AlarmDotCom;

#[tokio::main]
async fn main() -> alarm_dot_com::error::Result<()> {
    let mut alarm = AlarmDotCom::new("user@example.com", "password");

    // For accounts with 2FA, set the trusted device cookie from your browser:
    // alarm.set_trusted_device_cookie("cookie-value-from-browser");

    alarm.login().await?;

    let status = alarm.fetch_status().await?;
    for partition in &status.partitions {
        println!("{}: {}", partition.name, partition.state);
    }
    Ok(())
}

Modules§

auth
Authentication flow for Alarm.com systems.
client
HTTP client for the Alarm.com API.
controllers
error
models

Structs§

AlarmDotCom
High-level API entry point for Alarm.com.
SystemStatus
A snapshot of the full system state.