Code Monkey home page Code Monkey logo

fritzctl's Introduction

fritzctl - console AVM FRITZ!Box client

fritzctl


Project is archived and no longer maintained

Due to a lack of time to work on this project, I have decided to archive it as of April 2021. Of course, the source code will stay public. Finally, I wish to express my deep gratitude to everyone who contributed. Thanks!


Usage

Demo usage

About Wiki

fritzctl is a command line client for the AVM FRITZ!Box primarily focused on the AVM Home Automation HTTP Interface.

It should work out-of-the-box with most FRITZ!Boxes running a recent FRITZ!OS version. It has been explicitly tested with

FRITZ!Box FRITZ!OS
FRITZ!Box Fon WLAN 7390 06.51, 06.80, 06.83
FRITZ!Box 6490 Cable 06.63, 06.83, 06.84, 06.87, 07.00
FRITZ!Box 7490 06.83, 06.90, 06.93

CI Actions AppVeyor

Code Go Report Card codecov codebeat badge Codacy Badge BCH compliance Maintainability CodeFactor

Releases

  • release downloads github release
  • Download .deb .deb packages
  • Download .rpm .rpm packages
  • Download .zip windows

Install

Debian/Ubuntu

Add the repository (replace stretch by buster, jessie, wheezy or sid depending on your distribution)

echo "deb https://dl.bintray.com/bpicode/fritzctl_deb stretch main" | sudo tee -a /etc/apt/sources.list

and its signing key

wget -qO - https://api.bintray.com/users/bpicode/keys/gpg/public.key | sudo apt-key add -

The fingerprint of the repository key 3072D/35E71039 is 93AC 2A3D 418B 9C93 2986 6463 15FC CFC9 35E7 1039. Update your local repository data and install

sudo apt update
sudo apt install fritzctl

Upgrades for fritzctl will now be detected by apt update and can be installed via apt upgrade.

openSUSE

Add the repository

wget https://bintray.com/bpicode/fritzctl_rpm/rpm -O bintray-bpicode-fritzctl_rpm.repo && sudo zypper ar -f bintray-bpicode-fritzctl_rpm.repo && rm bintray-bpicode-fritzctl_rpm.repo

Update your local repository data and install

sudo zypper refresh
sudo zypper in fritzctl

MacOS

Install using homebrew

brew install bpicode/tap/fritzctl

Windows

Windows binaries can found in the windows directory.

From Source

fritzctl is go-gettable. Set up a go environment guided by How To Write Go Code and then run

go get github.com/bpicode/fritzctl

As Library GoDoc

Example:

package main

import "github.com/bpicode/fritzctl/fritz"

func main() { 
	h := fritz.NewHomeAuto(
		fritz.SkipTLSVerify(),
		fritz.Credentials("", "password"),
	)

	err := h.Login()
	if err != nil {
		panic(err)
	}

	h.Off("Socket_Bedroom")
	h.Temp(18.5, "Heating_Bedroom")
}

Reproducing binaries

Versions >= 1.4.16 can be checked for reproducibility. There is a ready-to-go Dockerfile which prepares an appropriate environment. Of course, the setup instructions can applied to any other build platform. To reproduce a release, prepare a docker image with the help of build-args

docker build -t fritzctl/build docker/build \
   --build-arg go_version=1.9.2 \
   --build-arg fritzctl_version=1.4.16 \
   --build-arg fritzctl_revision=v1.4.16

Building the binaries is done in the container phase:

docker run --rm -v fritzctl_build_folder:/root/go/src/github.com/bpicode/fritzctl/build fritzctl/build

The above command will create a docker volume fritzctl_build_folder containing the binaries. Those can be checked for equality with the distributed ones.

License License FOSSA Status

This project is licensed under the terms of the MIT license, see LICENSE.

The fritzctl image is licensed under the Creative Commons 3.0 Attributions license. It is build upon the following work:

  • The Go gopher was designed by Renee French, licensed under the Creative Commons 3.0 Attributions license.
  • The Go gopher w/ patch cable image was created by Egon Elbre, licensed under CC0 1.0 Universal.

fritzctl's People

Contributors

bpicode avatar codacy-badger avatar dep-bot avatar dependabot-preview[bot] avatar jayme-github avatar mvo5 avatar wassereimer86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fritzctl's Issues

Monitor up-/downstream traffic as reported by the FB

Found by RE:

curl -k 'https://fritz.box/internet/inetstat_monitor.lua?sid=XXXXXXXXXX&useajax=1&action=get_graphic'

with response

[ { "dynamic" : true, "ds_current_bps" : [ 132894, 89739, 101361, 131205, 105378, 127740, 97006, 104110, 86457, 102314, 130923, 84997, 118656, 137208, 362064, 339300, 743, 72, 294, 146 ], "mc_current_bps" : [ 0, 0, 64, 0, 0, 258, 133, 17, 0, 0, 1043, 391, 84, 0, 201, 47, 0, 17, 0, 142 ], "max_us" : 299493, "_node" : "sg0", "downstream" : 30000000, "prio_realtime_bps" : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "name" : "sync_ata", "prio_default_bps" : [ 0, 0, 0, 42, 0, 0, 0, 0, 18, 0, 18, 0, 0, 0, 0, 3621, 1105, 0, 0, 0 ], "upstream" : 2000000, "prio_low_bps" : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "max_ds" : 3010632, "mode" : "ATA", "prio_high_bps" : [ 3209, 2360, 3694, 2452, 3560, 2598, 2973, 1702, 3044, 2410, 2997, 2150, 2619, 2834, 5445, 7106, 69, 0, 0, 13 ] } ]

Inferred from the GUI, it seems

prio_realtime_bps = Upstream/"Echtzeitanwendungen"
prio_high_bps = Upstream/"Priorisierte Anwendungen"
prio_low_bps = Upstream/"Hintergrundanwendungen"
prio_default_bps = Upstream/"Normale Anwendungen"
mc_current_bps = Downstream/"IPTV" media?"
ds_current_bps = Downstream/Internet

No error: fritzctl toggle

When using the command "fritzctl toggle" without an device the script is making the challenge instead of showing the usage of the command or an error.

fritzctl list switches

fritzctl list switches is also listing thermostats. Im pretty sure that shouldn´t be.

Error: fritzctl temperature

When using the command "fritzctl temperature x x" with an temperature above 28 degrees the script is giving out an error instead of showing a message with the allowed temperature range.

.deb Package

The .deb package is only indexed for jessie and wheezy. Shoulkd it be like this? I use it without problems on stretch.

Update

It would be great if the README.md would also contain an "How to update this tool" area depending on how it was installed.

Groups

It would be great to control groups specified in the FRITZ!Box. But only clean groups should be listet (only switches/only thermostats). And "fritzctl list groups" should also be added if the whole thing is possible and you want to do it.

Caching of sessionid and devicelist

Saving the sessionid and the devicelist locally can improve performance by saving on HTTP round-trips. The sessionid needs be renewed when the session expires. The devicelist is renewed whenever list * is called or when a command is called with a locally unknown device.

Replace gradle ospackage by fpm

Two advantages emerge from this:

  • faster release builds
  • puts the project in a better position for OSX and Arch/Pacman packages

New demo gif for README

The existing one is rather outdated.

If possible

  • Automatic way to generate the image.

If feasible:

  • asciinema.org ?

Silence logging at start phase

Stuff like

XX Reading config file /home/user/.fritzctl.json
XX FRITZ!Box challenge is zzzzzz
XX FRITZ!Box challenge solved, login successful

should be logged on level debug.

Display devicelock for switches and hkrs

There are now two fields indicating indicating if a device has been locked:

<devicelist version="1"> <device....> <switch> <lock>0</lock> <devicelock>0</devicelock> ... <device....> <hkr> <lock>1</lock> <devicelock>1</devicelock> ...
One is a software-defined locking ('lock'), the other stands for a lock directly configured at the device ('devicelock').

fritzctl temperature on/off

Is there a way to turn on/off the thermostats like direct in the Fritz!Box or at the device? In the help it says only: fritzctl temperature [value in °C] [device names] [flags]

Wrong temperatures

Hi,

first: thank you for this great console client! :) Hope you keep it updated! :) Im missing a link to spend a coffee. ;)

Now the issue: Only the first thermostat has the correct temperatures in the list. The other are false.

putty_2017-02-23_00-56-02

Best regards
Jens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.