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

fritzapi

Library for interfacing with the "AVM Home Automation" API

9 releases

new 0.4.1 Dec 29, 2024
0.4.0 Nov 28, 2023
0.3.6 Jul 6, 2023
0.3.5 Feb 13, 2023
0.3.2 Jan 31, 2021

#5 in #home-automation

Download history 4/week @ 2024-09-18 15/week @ 2024-09-25 6/week @ 2024-10-02 1/week @ 2024-11-06 14/week @ 2024-12-04 32/week @ 2024-12-11 107/week @ 2024-12-25

153 downloads per month
Used in fritzctrl

MIT license

37KB
985 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–13MB
~161K SLoC