Crates.io | fritzctrl |
lib.rs | fritzctrl |
version | 0.3.6 |
source | src |
created_at | 2021-01-31 23:33:23.469769 |
updated_at | 2023-07-06 22:46:36.886224 |
description | Command line utility for controlling AVM Fritz devices |
homepage | |
repository | https://github.com/rksm/fritz-homeautomation-rs |
max_upload_size | |
id | 349047 |
size | 66,738 |
Small Rust project to inspect and control FRITZ!DECT devices.
The command line tool has several subcommands:
Pretty much all commands need the fritz.box user name and password. You can set it in an env vars FRTIZ_USER
and FRITZ_PASSWORD
or pass it as arguments to the subcommands (the user / password combo is the same you use for http://fritz.box).
$ fritzctrl list --user xxx --password yyy
id | product | name | state
---------------+----------------+-----------------------------+-------
11630 0069103 | FRITZ!DECT 200 | FRITZ!DECT 200 Laufband | on
11657 0272633 | FRITZ!DECT 210 | FRITZ!DECT 210 #2 | off
11630 0128064 | FRITZ!DECT 200 | FRITZ!DECT 200 Schreibtisch | on
09995 0335100 | FRITZ!DECT 301 | FRITZ!DECT 301 #4 |
11630 0123723 | FRITZ!DECT 200 | FRITZ!DECT 200 #5 | off
$ fritzctrl list --device "11630 0123723" --kinds temp --limit 3
time | Temperature (°C)
---------------------+------------------
2021-01-31 23:42:31 | 22.0
2021-01-31 23:27:31 | 23.0
2021-01-31 23:12:31 | 23.0
2021-01-31 22:57:31 | 23.0
$ fritzctrl switch --device "11630 0123723" --on
$ fritzctrl daylight --from-date 2021-02-01 --to-date 2021-02-03 --shift-from="-30min" --shift-to="30hour"
generates sunrise / sunset times shifted by -30 minutes (sunrise) and +30 minutes sunset:using device location (_, _)
sunrise: 2021-02-01 07:17:57
sunset: 2021-02-01 17:20:41
sunrise: 2021-02-02 07:16:20
sunset: 2021-02-02 17:22:36
sunrise: 2021-02-03 07:14:40
sunset: 2021-02-03 17:24:30
Then store some commands into a file:
fritz-commands.txt
:
2021-02-01 06:00:00 11630 0123723 on
2021-02-01 07:17:57 11630 0123723 off
2021-02-01 17:20:41 11630 0123723 on
2021-02-01 22:30:00 11630 0123723 off
You can run start processing those commands with
$ cat fritz-commands.txt | fritzctrl schedule
The program will wait until the next command should run and then toggle the device state. Once all commands are done the app will exit.
Useful for scheduling your Christmas lights!
Uses the fritz HTTP API.
If you want to integrate directly with the API have a look at the fritzapi crate.
License: MIT