philipplindner-media-network / fritzbox-to-mqtt-gw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fritzbox-to-mqtt-gw

mqtt-smarthome

Convert the FritzBox connection data for dsl to mqtt messages.

Example configuration

{
  "mqtt": {
    "url": "tcp://192.168.2.2:1883",
    "client-id": "fritzbox-mqtt-gw",
    "username": "mqtt-username",
    "password": "mqtt-password",
    "retain": true,

    "topic": "internet/connection"
  },

  "fritzbox": {
    "polling-interval": 60,
    "host": "192.168.2.1",
    "username": "fritzbox-username",
    "password": "fritzbox-password"
  }
}

Example message

{
  "NewTotalBytesSent": 2950666126,
  "NewDownstreamMaxRate": 280133,
  "NewATMCRCErrors": 0,
  "NewUpstreamMaxRate": 50012,
  "NewDownstreamCurrRate": 270157,
  "NewConnectionStatus": 1,
  "NewUptime": 5123,
  "NewUpstreamCurrRate": 48321,
  "NewAAL5CRCErrors": 0,
  "NewATMTransmittedBlocks": 1254889514,
  "NewExternalIPAddress": "XXX.XXX.XXX.XXX",
  "NewLayer1DownstreamMaxBitRate": 259117000,
  "NewBytesReceived": 0,
  "NewATMReceivedBlocks": 987654249,
  "NewBytesSent": 0,
  "NewLayer1UpstreamMaxBitRate": 50072000,
  "NewPhysicalLinkStatus": 1,
  "NewPacketsReceived": 0,
  "NewPacketsSent": 0,
  "NewTotalBytesReceived": 12345460744
}

build

build the docker container using build.sh

run

copy the config-example.json to /production/config/config.json

cd ./production
docker-compose up -d

Grafana Dashboard adapted from: https://blog.butenostfreesen.de/2018/10/11/Fritz-Box-Monitoring-mit-Grafana-und-Raspberry/

About

License:Apache License 2.0


Languages

Language:Java 94.9%Language:Dockerfile 3.9%Language:Shell 1.2%