Skip to main content

p3exporter collector module for FritzBox smarthome data

PyPI version Codacy Badge

This module provides collector for FritzBox smarthome device data. It can be enabled with a default p3exporter installation via p3.yml.

The collector is in a very early state and it provides temperature data from connected thermostat devices with temperature sensors.

Tested with:

  • Comet DECT thermostat

Installation and Running

You need to install p3exporter first. It is available on pypi so you can use pip to install the exporter and run it locally.

pip install p3exporter

Now you need to install p3exporter-fritzbox-smarthome. Choose one method mentioned below.

Install from pypi.org

We also provide a pypi.org package. You can install the collector with the following command:

pip install p3exporter-fritzbox-smarthome

Install from repository

You can install it from a local clone of our github repository.

$ git clone https://github.com/codeaffen/p3exporter-fritzbox-smarthome.git
Cloning into 'p3exporter-fritzbox-smarthome'...
...
$ cd p3exporter-fritzbox-smarthome
$ pip install -e .

Activation FritzBox smarthome collectors

To start p3exporter you need a valid p3.yml you can either edit an existing one or take the example from this repository.

curl --silent https://raw.githubusercontent.com/codeaffen/p3exporter-fritzbox-smarthome/develop/p3.yml.example --output ~/tmp/p3.yml

If you edit an existing p3.yml add the following content to activate the collector.

exporter_name: "Python prammable Prometheus exporter /w FritzBox collector"
collectors:
  - p3eFritzBox.collector.smarthome
collector_opts:
  smarthome:
    defaults:
      hostname: https://fb.example.com # use this hostname as default (if never set hostname defaults to 'https://fritz.box')
      username: smarthome # use this username as default
      ssl_verify: false # disable ssl certificate verification by default
    devices:
      - name: FB@home
        password: v3rys3cr3t
      - name: FB@cottage
        password: 4l5ov3rys3cr3t
        hostname: https://myfritzbox.example.com
        ssl_verify: true # enable ssl certificate verification for this device connection

After that you can start the p3exporter as usual:

$ p3exporter -c /tmp/p3.yml
INFO:root:Collector 'p3eFritzBox.collector.smarthome' was loaded and registred successfully
INFO:root:Start exporter, listen on 5876

Configuration

To configure this collector you need to create a dict with the connection parameters within the devices list. There are some parameters avaiable to configure the collector. In the following table all parameters are listed.

Name Default Mandatory Description
name device_<NUM> An arbitrary name to identify metrics according the device. If not given it will be generated as seen in default column. <NUM> stands for the list index, starting with 1.
username * Username used to authenticate against FritzBox
password * Password used to authenticate against FritzBox
hostname https://fritz.box Hostname of FritzBox to connect to. Protocol can be http or https. If no protocol is given default will be https.
device_types List of device type to enable. If List is empty all device types are activated. Possible values are:
  • temperature_sensor
ssl_verify True Set to True to disable ssl certificate verfication. This is useful in case of using self signed certificates.
Note: To use this parameter pyfritzhome from github is needed as the ssl_verify parameter is not yet available in pypi package. For details use requirements.txt.

All parameters from the table above except name can also be defined in defaults dict. Parameters defined here will be used as defaults for each device in devices list if the corresponding parameter is not defined there.

Metadata

Release files for p3exporter-fritzbox-smarthome 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for p3exporter-fritzbox-smarthome 1.1.0
File Size Uploaded Provenance
p3exporter-fritzbox-smarthome-1.1.0.tar.gz 17.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for p3exporter-fritzbox-smarthome 1.1.0
File Interpreter ABI Platform
p3exporter_fritzbox_smarthome-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.0 kB

Release files / p3exporter-fritzbox-smarthome-1.1.0.tar.gz

Download URL p3exporter-fritzbox-smarthome-1.1.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9a18b43f296afc76e83916a66d40bb64edbe49f3dc7f1ae74286802b6468c2a0
BLAKE2b-256 checksum
How to use checksums
67f734bcd5e9e6f5b63f96dd203d685ed56498e1024315f07ca6b125e6fbbaac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / p3exporter_fritzbox_smarthome-1.1.0-py3-none-any.whl

Download URL p3exporter_fritzbox_smarthome-1.1.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b7fc2c84150db4951226e033d04b694b6a002d0aa67cf4dd2d900c91db460de
BLAKE2b-256 checksum
How to use checksums
b552ceadd21e664d6d3b46257eb79dc5971d3b603a840725f4df60e7a4da44f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Security for p3exporter-fritzbox-smarthome 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page