Swift SDK to communicate with Fritz!Box routers.

What's New

Toggle Switches

  • Add the ability to toggle power switches
  • Add a logout method

Many thanks to @codeinho for the contribution! 🙏

Fritz!Box Kit

CocoaPods Swift Package Manager compatible GitHub GitHub Workflow Status

This aims to be a Framework that provides a clean and modern Swift API for communicating with Fritz!Box routers. The focus is on home automation features.


  • Authentication with API
  • Load device information (currently limited to thermostats and switches)
  • Toggle switches
  • Set Thermostat temperature
  • Load thermostat timetable
  • manipulate thermostat timetable

The Basics

Create an instance of the SDK with your myfritz URL and user credentials.

let fritzBox = FritzBox(
    host: "",
    user: "foo",
    password: "bar"

Get a session identifier by calling the login method. This will be used for all further requests.

fritzBox.login { result in
    if case .success(let info) = result {
        print("Info: \(String(describing: info))")
        // We are now ready to do further requests.

You can now get information about devices and then act on them.

fritzBox.getDevices(completion: { result in
    if case .success(let devices) = result {
        print("Devices: \(String(describing: devices))")
        // Prints a list of devices and their properties.


As I only have one home, this was only tested with the following setup.

  • Fritz!Box 7490 (FRITZ!OS 6.83)
  • 3x Fritz Dect 300 thermostat
  • 1x Fritz Dect 301 thermostat


When using Swift Package Manager add this:

.package(url: "", from: "0.5.0")

If you´re using CocoaPods, add this to your Podfile:

pod 'FritzBox-Kit'


  • Swift Tools 5.3.0
View More Packages from this Author


Last updated: Thu Mar 16 2023 11:05:28 GMT-0500 (GMT-05:00)