#home-automation #smart-home #avm #fritz

fritzapi

Library for interfacing with the "AVM Home Automation" API

8 releases

0.4.0 Nov 28, 2023
0.3.6 Jul 6, 2023
0.3.5 Feb 13, 2023
0.3.3 Feb 1, 2021
0.3.2 Jan 31, 2021

#3 in #home-automation

Download history 17/week @ 2024-02-19 16/week @ 2024-02-26 26/week @ 2024-03-11 140/week @ 2024-04-01

166 downloads per month
Used in fritzctrl

MIT license

37KB
982 lines

fritzapi

Library for interfacing with the "AVM Home Automation" API https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AHA-HTTP-Interface.pdf.

It is used by the fritzctrl utility.

Example

List devices

// Get a session id
let sid = fritzapi::get_sid(&user, &password)?;

// List devices
let mut devices = fritzapi::list_devices(&sid)?;

// If the first device is of, turn it on
let dev = devices.first_mut().unwrap();
if !dev.is_on() {
    dev.turn_on(&sid)?;
}

License: MIT


lib.rs:

Library for interfacing with the "AVM Home Automation" API https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AHA-HTTP-Interface.pdf.

It is used by the fritzctrl utility.

Example

    let mut client = fritzapi::FritzClient::new(user, password);
    // List devices
    let mut devices = client.list_devices()?;
    // If the first device is off, turn it on
    let dev = devices.first_mut().unwrap();
    if !dev.is_on() {
        dev.turn_on(&mut client)?;
    }

Dependencies

~0.7–15MB
~176K SLoC