Latest 0.3.1
Homepage https://github.com/r-dent/FritzBoxKit
License MIT
Platforms ios 9
Dependencies AEXML, XMLMapper
Authors

Fritz!Box Kit

CocoaPods
Travis

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

Features

  • [x] Authentication with API
  • [x] Load device information (currently limited to thermostats and switches)
  • [ ] Set Thermostat temperature
  • [ ] Toggle switches
  • [ ] 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: "https://YOURID.myfritz.net:46048",
    user: "foo",
    password: "bar"
)

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

fritzBox.login { (info, error) in
    if error == nil {
        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: { (devices, deviceError) in
    if deviceError == nil {
        print("Devices: (String(describing: devices))")
        // Prints a list of devices and their properties.
    }
})

Hardware

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

Installation

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

pod 'FritzBox-Kit'

Latest podspec

{
    "name": "FritzBox-Kit",
    "version": "0.3.1",
    "summary": "Swift SDK for communicating with Fritz! smart home devices.",
    "authors": {
        "Roman Gille": "[email protected]"
    },
    "homepage": "https://github.com/r-dent/FritzBoxKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/r-dent/FritzBoxKit.git",
        "tag": "v0.3.1"
    },
    "source_files": "Sources/**/*.swift",
    "swift_version": "4.2",
    "dependencies": {
        "AEXML": [],
        "XMLMapper": []
    },
    "platforms": {
        "ios": "9"
    }
}

Pin It on Pinterest

Share This