← 返回 Skills 市场
wolf128058

Fritz Connection

作者 Wolf · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
170
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fritz-connection
功能描述
Dieser Skill ermöglicht die Abfrage von Statusinformationen und die Steuerung einer AVM FRITZ!Box über die TR-064 Schnittstelle. Er bietet Funktionen für Sta...
使用说明 (SKILL.md)

Fritz Connection

FritzBox Router-Status über die TR-064 API mit fritzconnection.

⚠️ Sicherheitshinweise

Folgende Befehle erfordern IMMER eine Rückfrage vor der Ausführung:

  • reconnect – Kappt die Internetverbindung für alle Geräte kurzzeitig (10-30 Sekunden)
  • reboot – Startet den Router neu, alles fällt aus (Internet, WLAN, Telefonie) für 2-5 Minuten
  • wlan on/off – Systemweite Auswirkung auf alle Geräte
  • Router-Konfiguration ändern – Kann alle Devices betreffen

Ausnahme: Nur wenn explizit genehmigt ("mach mal", "ja bitte", etc.)

Diese Befehle betreffen nicht nur den User, sondern alle Geräte und Personen im Netzwerk.

Voraussetzungen

cd ~/.openclaw/workspace/skills/fritz-status
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

Konfiguration

In ~/.openclaw/skills/.env:

FRITZBOX_HOST=192.168.178.1
FRITZBOX_PASSWORD=dein_passwort

Hinweis: FritzBox nutzt nur Passwort-Auth, kein Username.

Nutzung

cd ~/.openclaw/workspace/skills/fritz-status

# Router-Status (Model, Uptime, WAN-IP)
.venv/bin/python scripts/fritz_status.py status

# Traffic-Statistiken (Bytes In/Out, Downstream/Upstream)
.venv/bin/python scripts/fritz_status.py traffic

# Verbundene Geräte (Name, IP, MAC, Status)
.venv/bin/python scripts/fritz_status.py hosts -v

# WLAN-Status (2.4GHz, 5GHz, Gastzugang)
.venv/bin/python scripts/fritz_status.py wlan

# Anrufliste (letzte 10 Anrufe)
.venv/bin/python scripts/fritz_status.py calls

# Anrufliste (letzte 20 Anrufe)
.venv/bin/python scripts/fritz_status.py calls -n 20

# Reconnect (neue IP anfordern) ⚠️ Rückfrage erforderlich!
.venv/bin/python scripts/fritz_status.py reconnect

# Reboot (Router neu starten) ⚠️ Rückfrage erforderlich!
.venv/bin/python scripts/fritz_status.py reboot

Verfügbare Befehle

status

Router-Status und Verbindungsinformationen.

Output:

🖥️  AVM FRITZ!Box 6660 Cable
📍 Host: 192.168.178.1
🔌 Connection: Connected
⏱️  Uptime: 456789 seconds (126h 49m)
🌐 External IP: 203.0.113.42

traffic

Bandbreite und Datenvolumen.

Output:

📥 Max Downstream: 274 Mbit/s
📤 Max Upstream: 52 Mbit/s
📊 Total Received: 299.68 GB
📊 Total Sent: 20.34 GB

hosts

Alle bekannten Geräte mit Status.

Output:

📱 Verbundene Geräte: 5

   ✅ Smartphone (192.168.178.10, AA:BB:CC:DD:EE:01)
   ✅ Laptop (192.168.178.20, AA:BB:CC:DD:EE:02)
   ✅ fritz.box (192.168.178.1, AA:BB:CC:DD:EE:03)
   ⏸️  Tablet (192.168.178.30, AA:BB:CC:DD:EE:04)
   ⏸️  SmartTV (192.168.178.40, AA:BB:CC:DD:EE:05)

Legende: ✅ = aktiv, ⏸️ = offline/inaktiv

wlan

WLAN-Status aller Netzwerke (2.4 GHz, 5 GHz, Gastzugang).

Output:

📡 WLAN-Status

📶 2.4 GHz:
   Status: ✅ Enabled
   SSID: MeinWLAN
   Kanal: 6
   Standard: ax

📡 5 GHz:
   Status: ✅ Enabled
   SSID: MeinWLAN
   Kanal: 36
   Standard: ax

🏠 Gastzugang:
   Status: ❌ Disabled
   SSID: MeinWLAN Gast

📡 WLAN ist AN

WLAN-Netzwerke:

  • 📶 2.4 GHz – Hauptnetz (WLANConfiguration:1)
  • 📡 5 GHz – Hauptnetz (WLANConfiguration:2)
  • 🏠 Gastzugang – Gäste-WLAN (WLANConfiguration:3)

calls

Anrufliste mit Typ, Nummer und Zeitstempel.

Output:

📋 Anrufliste (10 Einträge)

📞 Eingehend
   📞 01234567890
   🕐 03.03.2026 18:54 (0:39)

📵 Verpasst
   📞 09876543210
   🕐 02.03.2026 15:30 (0:00)

📱 Ausgehend
   📞 017000000000
   🕐 01.03.2026 12:15 (2:30)

📌 Letzter Anruf: 📞 Eingehend von 01234567890 am 03.03.26 18:54

Optionen:

  • -n, --limit N - Anzahl Einträge (default: 10)

Call-Typen:

  • 📞 Eingehend (Type 1) - Angenommene eingehende Anrufe
  • 📵 Verpasst (Type 2) - Verpasste eingehende Anrufe
  • 📱 Ausgehend (Type 3) - Ausgehende Anrufe

reconnect

Erzwingt einen Reconnect und fordert eine neue externe IP an.

.venv/bin/python scripts/fritz_status.py reconnect

Output:

🔄 Reconnect angefordert. Warte auf neue Verbindung...

⚠️ Systemweiter Eingriff:

  • Kappt die Internetverbindung für alle Geräte kurzzeitig
  • Neue externe IP wird zugewiesen
  • Dauert normalerweise 10-30 Sekunden
  • Niemals ohne Rückfrage ausführen!

reboot

Startet die FRITZ!Box neu.

.venv/bin/python scripts/fritz_status.py reboot

Output:

🔄 Reboot angefordert. Die FRITZ!Box startet jetzt neu.
   ⏱️  Das dauert normalerweise 2-5 Minuten.
   📡 Alle Geräte verlieren die Verbindung (Internet, WLAN, Telefonie).

⚠️ Systemweiter Eingriff:

  • Kappt ALLE Verbindungen (Internet, WLAN, Telefonie) für 2-5 Minuten
  • Alle Geräte im Netz verlieren die Verbindung
  • Router startet komplett neu
  • Niemals ohne Rückfrage ausführen!

fritzconnection Library

Python-Library für FritzBox TR-064 API.

Dokumentation: https://fritzconnection.readthedocs.io/

Zwei API-Interfaces

fritzconnection nutzt zwei unterschiedliche APIs:

API Methode Verwendung
TR-064 fc.call_action(service, action, args) Netzwerk, Status, Konfiguration, Smart Home
AHA-HTTP fc.call_http(command, ain) Smart Home DECT, Device Stats, XML-Responses

TR-064 gibt Python-Datentypen zurück (Dict mit konvertierten Werten). HTTP-Interface gibt rohe HTTP-Response (text/plain oder text/xml, braucht oft Parsen).

Grundlegende Nutzung

from fritzconnection import FritzConnection

fc = FritzConnection(address="192.168.178.1", password="pw")

# Router-Info
print(fc)  # Model-Informationen

# TR-064: Neue IP via Reconnect
fc.call_action("WANIPConn1", "ForceTermination")
fc.reconnect()  # Shortcut für obiges

# HTTP: Device-Stats für Smart-Home
response = fc.call_http("getbasicdevicestats", ain="12345 7891011")

Haupt-Services (TR-064)

Service Beschreibung Status
WANIPConnection WAN-Status, IP, Uptime, Reconnect ✅ Implementiert
WANCommonInterfaceConfig Traffic-Stats, Bandbreite ✅ Implementiert
Hosts Verbundene Geräte, MAC-Filter ✅ Implementiert
DeviceInfo Model, Firmware, Serial ✅ Implementiert
X_AVM-DE_OnTel Anrufliste, Telefonbuch ✅ Implementiert
WLANConfiguration WLAN-Netzwerke, Gäste-WLAN ✅ Implementiert
DeviceConfig Router-Reboot ✅ Implementiert
X_AVM-DE_Homeauto DECT-Smart-Home (Steckdosen, Thermostate) 🔲 Geplant
LANHostConfigManagement DHCP-Einstellungen 🔲 Geplant

Geräte-Unterstützung

  • Fritz!Box - Vollständig unterstützt (alle Services)
  • Fritz!Repeater - Teilweise unterstützt (TR-064, aber weniger Services)
  • Fritz!Fon - Nur über Box erreichbar

Die verfügbaren Services hängen vom Router-Modell und der Firmware ab.

Erweiterungsideen

WLAN-Steuerung

# Gäste-WLAN an/aus
fc.call_action('WLANConfiguration:3', 'SetEnable', NewEnable=True)

# Haupt-WLAN an/aus (2.4 GHz)
fc.call_action('WLANConfiguration:1', 'SetEnable', NewEnable=False)

# Alle WLANs global an/aus
fc.call_action('WLANConfiguration:1', 'SetWLANGlobalEnable', NewWLANGlobalEnable=True)

Smart Home (DECT via TR-064)

# DECT-Geräte auflisten
devices = fc.call_action('X_AVM-DE_Homeauto', 'GetGenericDeviceInfos')

# Steckdose schalten
fc.call_action('X_AVM-DE_Homeauto', 'SetSwitch', NewSwitchState='ON')

Smart Home (DECT via HTTP-Interface)

# Device-Stats für ein DECT-Gerät
response = fc.call_http("getbasicdevicestats", ain="12345")

# Response enthält:
# - content-type: 'text/plain' oder 'text/xml'
# - encoding: z.B. 'utf-8'
# - content: Rohe Daten (muss geparst werden)

Anrufliste (TR-064)

# CallList-URL holen
result = fc.call_action('X_AVM-DE_OnTel:1', 'GetCallList')
call_list_url = result.get("NewCallListURL")

# XML herunterladen und parsen
import urllib.request
import xml.etree.ElementTree as ET

with urllib.request.urlopen(call_list_url) as response:
    xml_data = response.read()

root = ET.fromstring(xml_data)
for call in root.findall(".//Call"):
    call_type = call.find("Type").text  # 1=eingehend, 2=verpasst, 3=ausgehend
    caller = call.find("Caller").text
    timestamp = call.find("Date").text

Call-Monitoring (Realtime)

from fritzconnection.lib.fritzcallmonitor import FritzCallMonitor

# Realtime-Monitor für eingehende/ausgehende Anrufe
monitor = FritzCallMonitor(address="192.168.178.1", password="pw")
monitor.connect()

# Events:
# - ring: Eingehender Anruf
# - call: Ausgehender Anruf
# - connect: Verbindung hergestellt
# - disconnect: Verbindung beendet

Reconnect (Neue IP)

# WANIPConn1 - ForceTermination
fc.reconnect()

# Oder manuell:
fc.call_action("WANIPConn1", "ForceTermination")

Reboot

# DeviceConfig:1 - Reboot
fc.call_action("DeviceConfig:1", "Reboot")

Python-API

from scripts.fritz_status import FritzBoxClient

client = FritzBoxClient()

# Status
info = client.get_status()
print(info['model'], info['uptime'])

# Traffic
traffic = client.get_traffic()
print(traffic['bytes_received'], traffic['bytes_sent'])

# Hosts
hosts = client.get_hosts()
print(f"{hosts['count']} Geräte verbunden")
for device in hosts['devices']:
    print(f"  {device['name']}: {device['ip']} ({'active' if device['active'] else 'offline'})")

Architektur

fritz-status/
├── SKILL.md              # Diese Datei
├── requirements.txt      # fritzconnection>=1.15.0
├── .gitignore
└── scripts/
    └── fritz_status.py   # CLI-Interface

Links

安全使用建议
This skill legitimately controls a local FRITZ!Box and needs the router host and password stored in ~/.openclaw/skills/.env. Before installing: (1) verify you trust the skill source (no remote download was included), (2) keep FRITZBOX_PASSWORD secret and set restrictive permissions on the .env file, (3) be aware commands like reboot/reconnect and WLAN on/off affect all devices — don’t allow automated runs of those without explicit user confirmation, and (4) consider adding the required env vars to the skill metadata or asking the publisher to do so so the platform can warn you up front.
功能分析
Type: OpenClaw Skill Name: fritz-connection Version: 1.0.0 The skill provides legitimate tools for managing an AVM FRITZ!Box router via the TR-064 protocol using the 'fritzconnection' library. The Python script (scripts/fritz_status.py) implements standard administrative functions such as monitoring traffic, listing connected hosts, viewing call logs, and performing reboots or reconnects. Notably, the SKILL.md file includes proactive safety instructions for the AI agent, requiring explicit user confirmation before executing disruptive actions like rebooting or toggling WLAN. No evidence of data exfiltration, obfuscation, or malicious intent was found.
能力评估
Purpose & Capability
Name/description match the code and instructions: the files use the fritzconnection library and implement status, traffic, hosts, WLAN, calls, reconnect and reboot via TR-064/AHA-HTTP. The requested capabilities are appropriate for a router-control skill.
Instruction Scope
SKILL.md and the script operate only against the local FRITZ!Box (TR-064 and AHA-HTTP). The runtime instructions require creating a venv and installing requirements, and the script reads credentials from ~/.openclaw/skills/.env (or a skill-local .env). This is expected, but the skill can execute disruptive operations (reboot, reconnect, disable WLAN) — the docs require explicit confirmation for those, which you should enforce.
Install Mechanism
No automated install spec; user-guided pip install into a virtualenv is suggested. requirements.txt only lists fritzconnection and python-dotenv — reasonable and proportional for the stated functionality.
Credentials
The skill requires FRITZBOX_HOST and FRITZBOX_PASSWORD (used by the script), which are appropriate and minimal. However, the registry metadata shows no required env vars declared — a metadata inconsistency that should be corrected so users know the skill needs local router credentials.
Persistence & Privilege
No 'always: true' privilege; the skill does not modify other skills or system-wide settings. It can be invoked autonomously (platform default) — this increases impact if misused, but is not unusual for skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fritz-connection
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fritz-connection 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of Fritz Connection skill for AVM FRITZ!Box TR-064 interface. - Query and control Fritz!Box routers: model, uptime, bandwidth, connected devices, WLAN state, call lists, reconnect, and reboot. - Strong safety warnings and required confirmations for critical operations (reconnect, reboot, WLAN toggles). - Simple CLI usage with documented commands and example outputs for all major features. - Setup and configuration instructions included. - Based on the Python fritzconnection library; extension and customization examples provided.
元数据
Slug fritz-connection
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Fritz Connection 是什么?

Dieser Skill ermöglicht die Abfrage von Statusinformationen und die Steuerung einer AVM FRITZ!Box über die TR-064 Schnittstelle. Er bietet Funktionen für Sta... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 170 次。

如何安装 Fritz Connection?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fritz-connection」即可一键安装,无需额外配置。

Fritz Connection 是免费的吗?

是的,Fritz Connection 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Fritz Connection 支持哪些平台?

Fritz Connection 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Fritz Connection?

由 Wolf(@wolf128058)开发并维护,当前版本 v1.0.0。

💬 留言讨论