Skip to content

Latest commit

ย 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FritzTrack4U โ€” Indoor-Ortung mit der Hardware, die du schon hast

๐Ÿ“ก FritzTrack4U

Raumgenaue Indoor-Ortung per WLAN โ€” mit den FritzBox-Routern, die ohnehin an der Wand haengen. Room-level indoor positioning over Wi-Fi โ€” using only the routers you already own. Sahip oldugun WLAN router'lariyla, ev ici oda-bazli konum tespiti.

Python Home Assistant Extra Hardware License: MIT made with

๐ŸŒ Sprache / Language / Dil: ย  ๐Ÿ‡ฉ๐Ÿ‡ช Deutsch ย ยทย  ๐Ÿ‡ฌ๐Ÿ‡ง English ย ยทย  ๐Ÿ‡น๐Ÿ‡ท Tuerkce

โš–๏ธ Trademark / Marken-Hinweis DE โ€” FRITZ! und FRITZ!Box sind eingetragene Marken der FRITZ! GmbH (vormals AVM GmbH). Dieses Projekt ist ein unabhaengiges, von der Community entwickeltes Werkzeug und steht in keiner Verbindung zu FRITZ!/AVM. Produktnamen werden ausschliesslich zu Identifikationszwecken genannt, um die Kompatibilitaet zu beschreiben. EN โ€” FRITZ! and FRITZ!Box are registered trademarks of FRITZ! GmbH (formerly AVM GmbH). This project is an independent, community-developed tool, neither affiliated with, authorized, sponsored nor endorsed by FRITZ!/AVM. Product names are used for identification purposes only to describe compatibility.

โš ๏ธ Haftungsausschluss / Disclaimer / Sorumluluk Reddi โ€” bitte lesen / please read / lutfen oku DE โ€” FritzTrack4U ist ein Eigen-Lern- und Bastel-System zum selber Aufbauen, Lernen und Experimentieren. Die Nutzung erfolgt vollstaendig auf eigene Gefahr. Jeder ist fuer sein eigenes System, seine FritzBoxen, seine Daten und seine Automationen selbst verantwortlich. Es wird keine Haftung uebernommen โ€” fuer keinerlei Schaeden, Datenverluste, Fehlfunktionen, Folgeschaeden oder sonstige Nachteile, die direkt oder indirekt aus der Nutzung entstehen. Keine Gewaehr fuer Richtigkeit, Genauigkeit oder Eignung fuer einen bestimmten Zweck. EN โ€” FritzTrack4U is a self-learning, DIY hobby system for building, learning and experimenting yourself. Use is entirely at your own risk. Everyone is solely responsible for their own system, FritzBoxes, data and automations. No liability is accepted for any damage, data loss, malfunction, consequential harm or other disadvantage arising directly or indirectly from its use. No warranty of correctness, accuracy or fitness for a particular purpose. TR โ€” FritzTrack4U, kendin kurup ogrenmen ve denemen icin bir kendin-yap / kendi-ogrenme sistemidir. Kullanim tamamen kendi sorumlulugundadir. Herkes kendi sistemi, FritzBox'lari, verileri ve otomasyonlarindan kendisi sorumludur. Kullanimdan dogabilecek hicbir zarar, veri kaybi, ariza veya dolayli zarardan sorumluluk kabul edilmez. Dogruluk veya belirli bir amaca uygunluk icin garanti verilmez.

๐ŸŽฌ Demo-GIF folgt ยท docs/images/demo.gif โ€” vier Etagen, Live-Punkte pro Person, ohne dass jemand eine App oeffnet.


๐Ÿ‡ฉ๐Ÿ‡ช Deutsch

Raumgenaue Ortung im ganzen Haus โ€” nur mit den FritzBoxen, die ohnehin an der Wand haengen. Keine Zusatz-Hardware. Kein ESP32. Keine API-Keys. Ein bis viele AVM-Router, TR-064 und die Sturheit, nicht zu glauben dass es nicht geht.

๐Ÿงญ Das Kern-Prinzip โ€” warum das funktioniert

GPS funktioniert draussen perfekt und drinnen gar nicht. Genau im Haus willst du aber wissen, wer wo ist. FritzTrack4U loest das mit einem einzigen Gedanken:

Mehrere FritzBoxen ergeben gemeinsam ein Signal-Muster โ€” verglichen gegen vorher eingelernte Raum-Profile.

Ein Handy haengt zu jedem Zeitpunkt an einer Box โ€” aber ueber kurze Zeit und mehrere Boxen-Standorte entsteht ein Signal-Muster (Vektor). Welche Box es haelt, verraet die Etage; das Muster, verglichen gegen eingelernte Raum-Fingerprints, verraet den Raum.

flowchart LR
    P(("๐Ÿ“ฑ Ein Handy<br/>im Kaminraum"))
    P -. "stark" .-> B1["๐Ÿ“ก Box A<br/>80%"]
    P -. "mittel" .-> B2["๐Ÿ“ก Box B<br/>40%"]
    P -. "schwach" .-> B3["๐Ÿ“ก Box C<br/>15%"]
    P -. "kaum" .-> B4["๐Ÿ“ก Box D<br/>5%"]
    B1 --> V["๐Ÿงฎ Vektor (Muster)<br/>{A:80, B:40,<br/>C:15, D:5}"]
    B2 --> V
    B3 --> V
    B4 --> V
    V --> M{{"Vergleich gegen<br/>eingelernte Raum-Profile<br/>(mittlere Abweichung)"}}
    M --> R(["๐Ÿ  Position:<br/>Kaminraum"])
Loading

Der Punkt: Die Position kommt aus dem Vergleich des Signal-Musters gegen vorher eingelernte Raum-Fingerprints โ€” nicht aus einer gleichzeitigen Mehrfach-Messung. Je mehr Boxen im Haus verteilt sind, desto dichter das Muster und desto stabiler die Raum-Erkennung.

So wird aus einer einzelnen Box ein grober Etagen-Sensor โ€” und aus mehreren Boxen ein raumgenaues Ortungssystem:

flowchart TD
    Phone["๐Ÿ“ฑ Handy im Raum"]

    Phone -.->|"80%"| B1["๐Ÿ“ก FritzBox 1"]
    Phone -.->|"40%"| B2["๐Ÿ“ก FritzBox 2"]
    Phone -.->|"15%"| B3["๐Ÿ“ก FritzBox 3"]
    Phone -.->|"5%"| B4["๐Ÿ“ก FritzBox 4"]

    B1 --> V["๐Ÿงฎ Signal-Vektor (Muster)<br/>[80, 40, 15, 5]"]
    B2 --> V
    B3 --> V
    B4 --> V

    V ==>|"Vergleich gegen eingelernte Raum-Profile<br/>mittlere Abweichung"| Match{"๐Ÿ” Bester Treffer?"}

    Match --> Pos["๐Ÿ“ Raum: Buero"]

    subgraph Kalibriert ["Gespeicherte Raum-Fingerprints"]
        FP1["Buero: [78, 42, 14, 6]"]
        FP2["Kueche: [20, 75, 30, 10]"]
        FP3["Schlafzimmer: [10, 25, 70, 40]"]
    end

    Kalibriert -.-> Match

    classDef phone fill:#a855f7,stroke:#7c3aed,color:#fff,stroke-width:2px
    classDef box fill:#1e293b,stroke:#475569,color:#e2e8f0
    classDef vector fill:#7c3aed,stroke:#a855f7,color:#fff,stroke-width:2px
    classDef result fill:#16a34a,stroke:#15803d,color:#fff,stroke-width:2px
    classDef fp fill:#0f172a,stroke:#334155,color:#94a3b8

    class Phone phone
    class B1,B2,B3,B4 box
    class V vector
    class Pos result
    class FP1,FP2,FP3 fp
Loading

Kernaussage: Nicht die staerkste Box entscheidet, sondern der volle Vektor aller Boxen gegen die kalibrierten Raum-Fingerprints. Staerkste Box = Etage, voller Vektor = Raum, keine Box = abwesend.

โœจ Features

  • ๐Ÿชœ Etagen-Erkennung ueber die staerkste Box โ€” funktioniert sofort, schon ab einer Box.
  • ๐Ÿ  Raum-Erkennung ueber Multi-Box-Signalvektor + kalibrierte Fingerprints โ€” nach dem Einlernen pro Raum (Kalibrierung noetig, siehe unten).
  • ๐Ÿšช Anwesenheit/Abwesenheit: Sieht keine Box das Handy โ†’ die Person ist nicht zu Hause.
  • ๐Ÿ‘ฅ Gaeste-Erkennung: Unbekannte Geraete werden als Gast erkannt, nicht still ignoriert.
  • ๐Ÿ—„๏ธ SQLite-Verlauf mit 60-Tage-Auto-Cleanup โ€” wer war wann in welchem Raum.
  • โฑ๏ธ Adaptiver Takt: schnell bei Bewegung, sparsam bei Ruhe โ€” schont die FritzBox.
  • ๐Ÿ”Œ Home Assistant ueber MQTT-Auto-Discovery โ€” pro Person ein Sensor, ohne Handarbeit.
  • ๐Ÿงฉ Config-getrieben, 1 bis N Boxen: funktioniert mit einer einzigen Box, skaliert auf beliebig viele.
  • ๐Ÿ’ธ 0 โ‚ฌ Zusatz-Hardware. Keine API-Keys. Keine Cloud.

๐Ÿ“ˆ Hardware-Skalierung โ€” je mehr Boxen, desto genauer

Boxen Was du bekommst Genauigkeit
1 Box Welche Box haengt das Handy? โ†’ grobe Etage + Anwesenheit ๐ŸŸข sofort, ohne Setup
2โ€“3 Boxen Signalvektoren โ†’ Raum โ€” nach Kalibrierung pro Raum ๐ŸŸก raumgenau nach Einlernen
4+ Boxen Dichterer Vektor โ†’ stabiler Raum, weniger Schwankung ๐ŸŸก raumgenau, robuster

Ehrlich: Etage + Anwesenheit laufen sofort. Raum-Genauigkeit braucht Kalibrierung (einmal pro Raum einlernen) โ€” und haengt davon ab, ob ein Handy ueberhaupt von mehreren Boxen gesehen wird (WLAN-Physik: ein Handy ist meist nur mit einer Box verbunden). Das ist ein Lern-/Bastel-Projekt, kein Zentimeter-GPS.

โœ… Was es kann โ€” und โŒ was es ehrlich NICHT kann

Damit niemand falsche Erwartungen hat (und das Projekt glaubwuerdig bleibt):

โœ… Das kann FritzTrack4U โŒ Das kann es NICHT
Erkennen in welchem Raum / auf welcher Etage jemand ist Zentimeter-genaue Position im Raum (kein โ€žX steht am Schreibtisch")
Anwesend / abwesend zuverlaessig melden Geraete sehen, die nicht im WLAN verbunden sind (z.B. fremde Gast-Handys ausser Reichweite)
Mehrere Personen gleichzeitig (je 1 getrackt. Geraet) Personen ohne Handy orten
Gaeste (unbekannte Geraete) melden Eine fremde MAC zuverlaessig wiedererkennen (iPhones randomisieren MACs)
Mit 1 Box (Etage) bis N Boxen (Raum) skalieren Mit Hardware-Praezision von UWB / BLE-Beacons mithalten

Physikalische Grenze, ehrlich gesagt: WLAN-Signal schwankt von Natur aus ein paar Prozent (auch wenn man stillsteht). Darum ist die Aufloesung raum-genau, nicht punkt-genau. Wer Zentimeter braucht, nutzt UWB oder BLE-Beacons. Wer wissen will in welchem Zimmer jemand ist โ€” ohne Zusatz-Hardware โ€” ist hier richtig.

โš”๏ธ Vergleich โ€” FritzTrack4U vs. ESP32-Bermuda

Ehrlich bleiben: ESP32 ist der genauere Profi-Standard. FritzTrack4U gewinnt, wenn du null Zusatz-Hardware willst.

Kriterium FritzTrack4U ESP32 Bermuda / ESPresense
Hardware-Kosten 0 โ‚ฌ (Boxen vorhanden) ~5 โ‚ฌ pro Chip, einer pro Raum
Zusatz-Geraete im Haus keine viele (ein Chip je Raum)
Genauigkeit raumgrob โ†’ raumgenau (mit Vektor) raumgenau, <10 s
Reifegrad Eigenbau, hier dokumentiert Profi-Standard
Einrichtung 1 Router-User pro Box Chips flashen + verteilen
Stromverbrauch zusaetzlich 0 (Boxen laufen eh) gering, aber vielfach
Wann gewinnt es du willst nichts dazukaufen du willst maximale Genauigkeit

Fazit: Kein โ€žbesser als ESP32" โ€” sondern umsonst und gut genug, mit Luft nach oben.

๐Ÿ’ก Anwendungs-Ideen (Vision)

Diese Szenarien sind die Richtung, nicht alle schon fertig. Was geplant ist, ist als geplant markiert.

Smart-Home-Komfort im eigenen Zuhause (der Kern):

  • ๐Ÿ”† Kind betritt sein Zimmer โ†’ Licht geht an. Verlaesst es โ†’ nach Puffer wieder aus.
  • ๐Ÿ–ฅ๏ธ Du verlaesst das Buero โ†’ Monitore aus, PC sperrt, Heizung runter. (geplant โ€” benoetigt schaltbare Geraete)
  • ๐Ÿ”ฅ Heizung folgt den Menschen statt der Uhr โ€” warm, wo jemand ist. (geplant)
  • ๐Ÿšช โ€žWer ist zu Hause?" als Karte fuers ganze Haus โ€” Etage, Raum, Anwesenheit.
  • ๐Ÿ‘‹ Gaeste-Hinweis: ein unbekanntes Handy taucht im WLAN auf.

Bewusst NICHT das Ziel: Mitarbeiter-Ueberwachung am Arbeitsplatz oder Kunden-Tracking im Laden. Das waere in Deutschland datenschutzrechtlich heikel (DSGVO, Betriebsrat) โ€” FritzTrack4U ist ein Werkzeug fuers eigene Zuhause, mit deiner eigenen Familie und deiner eigenen Einwilligung.

๐Ÿ”ง Architektur โ€” wie die Daten fliessen

flowchart LR
    subgraph Boxes ["FritzBoxen"]
        F1["๐Ÿ“ก FritzBox 1"]
        F2["๐Ÿ“ก FritzBox 2"]
        F3["๐Ÿ“ก FritzBox 3"]
        F4["๐Ÿ“ก FritzBox 4"]
    end

    F1 -->|"TR-064 / Port 49000"| D
    F2 -->|"TR-064 / Port 49000"| D
    F3 -->|"TR-064 / Port 49000"| D
    F4 -->|"TR-064 / Port 49000"| D

    D["๐Ÿ Python-Daemon<br/>sammelt Signal-Vektoren"]

    D -->|"speichert"| DB[("๐Ÿ’พ SQLite-Verlauf<br/>60 Tage")]
    D -->|"publiziert"| MQTT["๐Ÿ“จ MQTT-Broker"]

    MQTT --> HA["๐Ÿ  Home Assistant"]

    HA --> S1["๐Ÿ‘ค Person A: Buero"]
    HA --> S2["๐Ÿ‘ค Person B: Kueche"]

    classDef box fill:#1e293b,stroke:#475569,color:#e2e8f0
    classDef daemon fill:#7c3aed,stroke:#a855f7,color:#fff,stroke-width:2px
    classDef store fill:#0ea5e9,stroke:#0284c7,color:#fff
    classDef bus fill:#f59e0b,stroke:#d97706,color:#1e293b
    classDef ha fill:#16a34a,stroke:#15803d,color:#fff,stroke-width:2px
    classDef person fill:#0f172a,stroke:#334155,color:#cbd5e1

    class F1,F2,F3,F4 box
    class D daemon
    class DB store
    class MQTT bus
    class HA ha
    class S1,S2 person
Loading

๐Ÿš€ Schnellstart

git clone https://github.com/Aslan4u73/FritzTrack4u.git
cd FritzTrack4u

# Nur noetig wenn du MQTT/Home Assistant nutzt (sonst laeuft es ohne Abhaengigkeiten):
pip install -r requirements.txt

# Konfiguration aus der Vorlage anlegen und ausfuellen:
cp config.example.json config.json
nano config.json

python3 fritztrack4u.py --config ./config.json

Pflicht-Schritt fuer Multi-Box (der eigentliche Trick): Lege auf jeder FritzBox einen eigenen Benutzer mit dem Recht โ€žFRITZ!Box Einstellungen" an. Nur dann liefert jede Box per TR-064 ihre eigene Signalstaerke. Fragst du nur den Master, bekommst du nur einen Wert โ€” und damit keinen Vektor. Komplette Anleitung: docs/INSTALL.de.md.

// config.example.json (Auszug โ€” volle Vorlage im Repo)
{
  "boxes": [
    { "name": "Buero",        "ip": "192.168.178.1", "floor": "Erdgeschoss",  "floor_nr": 0, "user": "tracker", "password": "DEIN_PASSWORT" },
    { "name": "Schlafzimmer", "ip": "192.168.178.2", "floor": "Obergeschoss", "floor_nr": 1, "user": "tracker", "password": "DEIN_PASSWORT" }
  ],
  "devices": { "AA:BB:CC:DD:EE:FF": "Person1" },
  "mqtt": { "enabled": true, "host": "192.168.178.50", "port": 1883, "user": "ha", "password": "..." },
  "intervals": { "normal": 60, "movement": 15, "idle": 300, "live": 3 },
  "retention_days": 60
}

๐Ÿ› ๏ธ Wie es technisch laeuft

   N x FritzBox (Mesh)              Host (Mini-Server, LAN-only)        Home Assistant
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ Box A (Master)โ”‚  TR-064 / 49000 โ”‚  fritztrack4u.py         โ”‚  MQTT โ”‚  Sensor je    โ”‚
   โ”‚ Box B        โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  - Login pro Box (SID)   โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  Person       โ”‚
   โ”‚ Box C        โ”‚                 โ”‚  - SignalStrength % je Boxโ”‚ 1883 โ”‚  Anwesenheit  โ”‚
   โ”‚ Box D        โ”‚                 โ”‚  - Vektor + Fingerprint   โ”‚       โ”‚  + Live-Btn   โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚  - SQLite 60-Tage-Verlauf โ”‚       โ”‚  + (3D-Viz)   โ”‚
                                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Login: AVM-Challenge-Response (MD5 ueber UTF-16LE โ€” der Stolperstein), SID wird ~900 s wiederverwendet, um die Box zu schonen.
  • Datenquelle: TR-064 GetGenericAssociatedDeviceInfo pro Box โ†’ SignalStrength (%) je Handy.
  • Vektor: alle Box-Werte pro Handy einsammeln โ†’ [Box A%, Box B%, โ€ฆ].
  • Match: best_room() vergleicht den Vektor gegen kalibrierte Raum-Fingerprints (mittlere Abweichung ueber alle Boxen).
  • Haertung: Retries + Pausen gegen FritzBox-Ueberlast, grosse Normal-Intervalle als Schutz.

๐Ÿ–ผ๏ธ Screenshots folgen ยท docs/images/3d-haus.png, docs/images/ha-sensoren.png


๐Ÿ”ฅ Die Geschichte โ€” wie aus โ€žunmoeglich" ein Beweis wurde

Diese README dokumentiert die Reise ehrlich, inklusive aller Sackgassen. Es gab keinen genialen Trick โ€” es gab Sturheit.

  1. Der erste Konsens: โ€žFritzBox kann kein Indoor-Tracking, eine Box meldet pro Handy nur einen Wert โ€” alle nehmen ESP32." Klingt fundiert. War unvollstaendig.
  2. Mesh-Sticking entdeckt: Ein Handy klebt an einer alten Box, obwohl die Person laengst weg ist. โ€žAn welcher Box haengt es" โ‰  โ€žwo ist die Person". Erster Beweis, dass die naive Annahme falsch ist.
  3. ~12 API-Wege ueber 3 Test-Runden: viele Sackgassen โ€” edit_device (1 Wert), meshlist.lua (404), meshTopo (Daten, aber keine rssi-Felder), homeNet/meshNet (kein dBm). Jeder Weg ehrlich getestet, nicht โ€žgefuehlt" verworfen.
  4. Dreimal โ€žunmoeglich" โ€” dreimal widersprochen: Die KI erklaerte drei Mal selbstbewusst โ€žTriangulieren mit FritzBox geht nicht". Murat widersprach jedes Mal โ€” auf Basis Physik: Nachbarboxen hoeren das Handy schwach durch die Waende (genau das nutzt die FritzBox intern fuers Mesh-Steering). Er hatte jedes Mal recht.
  5. ๐Ÿ’ฅ Der Durchbruch: Nicht nur den Master fragen โ€” eigener Login PRO Box. Dann liefert TR-064 GetGenericAssociatedDeviceInfo pro Box den SignalStrength. Beobachtet: In Grenzfaellen sieht eine Nachbarbox dasselbe Handy schwach durch die Wand โ€” z.B. {Buero 35%, SARA 10%}. Das ist die Ausnahme (meist haengt ein Handy nur an einer Box), reicht aber mit Etagen-Info und kalibrierten Fingerprints fuer eine Raum-Zuordnung.
  6. Anwesenheits-Bug gefunden & gefixt: Ein offline gegangenes Handy klebte auf dem alten Raum โ€” jetzt gilt: keine Box sieht das Handy = abwesend.
  7. iPhone-Standby-Falle: iPhones verschwinden im Standby kurz aus der Assoziationsliste, ohne den Raum zu verlassen. Loesung: 2-Minuten-Puffer, bevor ein Raum als โ€žverlassen" gilt.

Der Strategie-Wechsel, der alles drehte: weg von โ€žeine Box abfragen" hin zu โ€žMulti-Box-Datensammler". Aus einer Momentaufnahme wurde ein dynamisches Ortungssystem. Murat hatte bei allem recht.

Die Lektion: Dreimal โ€žgeht nicht" ist kein Beweis, dass es nicht geht. Frag alle Knoten, nicht nur den naechstliegenden.


๐Ÿ“œ Changelog

Version Was dazukam
v1 Eine Box, nur grobe Etage (โ€žan welcher Box haengt das Handy").
v5 Fingerprint-Kalibrierung pro Raum โ€” 1 Box + dBm, erste Raum-Genauigkeit.
v6 Multi-Box-Datensammler: alle Boxen einzeln per TR-064, Anwesenheits-Check (offline = abwesend), SQLite-Verlauf, adaptiver Takt.
v6.1 Gaeste-Erkennung + 60-Tage-Auto-Cleanup.
FritzTrack4U (public) Config-getrieben 1โ€“N Boxen, anonymisiert, voller-Vektor-Match ueber alle Boxen.

๐Ÿ‡ฌ๐Ÿ‡ง English

Room-level positioning for a whole house โ€” using only the FritzBoxes already on your walls. No extra hardware. No ESP32. No API keys. One to many AVM routers, TR-064, and the stubbornness to not believe it can't be done.

๐Ÿงญ The Core Principle โ€” why this works

GPS works perfectly outdoors and not at all indoors. Yet indoors is exactly where you want to know who is where. FritzTrack4U solves it with a single idea:

Several FritzBoxes together form a signal pattern โ€” matched against room profiles you trained beforehand.

A phone is associated with one box at any moment โ€” but across a short time span and several box locations a signal pattern (vector) emerges. The box it's on reveals the floor; the pattern, matched against trained room fingerprints, reveals the room.

flowchart LR
    P(("๐Ÿ“ฑ One phone<br/>in the den"))
    P -. "strong" .-> B1["๐Ÿ“ก Box A<br/>80%"]
    P -. "medium" .-> B2["๐Ÿ“ก Box B<br/>40%"]
    P -. "weak" .-> B3["๐Ÿ“ก Box C<br/>15%"]
    P -. "faint" .-> B4["๐Ÿ“ก Box D<br/>5%"]
    B1 --> V["๐Ÿงฎ Vector<br/>{A:80, B:40,<br/>C:15, D:5}"]
    B2 --> V
    B3 --> V
    B4 --> V
    V --> M{{"Match vs.<br/>trained room profiles<br/>(mean absolute deviation)"}}
    M --> R(["๐Ÿ  Position:<br/>the den"])
Loading

The point: position comes from matching the signal pattern against room fingerprints trained beforehand โ€” not from a simultaneous multi-box measurement. The more boxes spread across the house, the denser the pattern and the more stable the room detection.

   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚   ๐Ÿ“ฑ  ONE room (e.g. the office)                                   โ”‚
   โ”‚       โ”‚                                                           โ”‚
   โ”‚       โ”œโ”€โ”€โ”€โ”€ ๐Ÿ“ก Box 1  โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–‘โ–‘  80%   โ† strong, same room       โ”‚
   โ”‚       โ”œโ”€โ”€โ”€โ”€ ๐Ÿ“ก Box 2  โ–“โ–“โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  40%   โ† next room               โ”‚
   โ”‚       โ”œโ”€โ”€โ”€โ”€ ๐Ÿ“ก Box 3  โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  15%   โ† through a wall          โ”‚
   โ”‚       โ””โ”€โ”€โ”€โ”€ ๐Ÿ“ก Box 4  โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   5%   โ† other floor             โ”‚
   โ”‚                          โ–ผ                                        โ”‚
   โ”‚              Vector {80, 40, 15, 5}  โ”€โ”€โ–บ  ROOM: office โœ…         โ”‚
   โ”‚                                                                   โ”‚
   โ”‚   Strongest box = FLOOR        Full vector = ROOM                 โ”‚
   โ”‚   No box sees the phone       = AWAY                              โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Features

  • ๐Ÿ  Room-level positioning via multi-box signal pattern + calibrated fingerprints (matched against trained room profiles).
  • ๐Ÿชœ Floor detection from the strongest box โ€” works with just one box.
  • ๐Ÿšช Presence/absence: if no box sees the phone โ†’ the person is away.
  • ๐Ÿ‘ฅ Guest detection: unknown devices are flagged as guests, not silently dropped.
  • ๐Ÿ—„๏ธ SQLite history with 60-day auto-cleanup โ€” who was in which room, when.
  • โฑ๏ธ Adaptive polling: fast on movement, gentle at rest โ€” protects the FritzBox.
  • ๐Ÿ”Œ Home Assistant via MQTT auto-discovery โ€” one sensor per person, zero manual setup.
  • ๐Ÿงฉ Config-driven, 1 to N boxes: works with a single box, scales to as many as you like.
  • ๐Ÿ’ธ โ‚ฌ0 extra hardware. No API keys. No cloud.

๐Ÿ“ˆ Hardware scaling โ€” more boxes, more accuracy

Boxes What you get Accuracy
1 box Which box is the phone on? โ†’ rough floor ๐ŸŸก floor-level
2โ€“3 boxes First signal vectors โ†’ room (with fingerprint) ๐ŸŸข room-level
4+ boxes Dense vector โ†’ robust room, basis for position within a room ๐ŸŸข๐ŸŸข room-level +

Rule of thumb: Strongest box = floor. Full vector = room. No box = away.

โš”๏ธ Comparison โ€” FritzTrack4U vs. ESP32-Bermuda

Let's be honest: ESP32 is the more accurate, professional standard. FritzTrack4U wins when you want zero extra hardware.

Criterion FritzTrack4U ESP32 Bermuda / ESPresense
Hardware cost โ‚ฌ0 (boxes already there) ~โ‚ฌ5 per chip, one per room
Extra devices in the house none many (one chip per room)
Accuracy coarse โ†’ room-level (with vector) room-level, <10 s
Maturity DIY, documented here professional standard
Setup 1 router user per box flash + distribute chips
Extra power draw 0 (boxes run anyway) low, but multiplied
When it wins you want to buy nothing you want max accuracy

Bottom line: not "better than ESP32" โ€” but free and good enough, with room to grow.

๐Ÿš€ Quick start

git clone https://github.com/Aslan4u73/FritzTrack4u.git
cd FritzTrack4u

# Only needed if you use MQTT/Home Assistant (otherwise it runs dependency-free):
pip install -r requirements.txt

# Create your config from the template and fill it in:
cp config.example.json config.json
nano config.json

python3 fritztrack4u.py --config ./config.json

Required for multi-box (the actual trick): create a dedicated user with the "FRITZ!Box settings" permission on every box. Only then does each box return its own signal strength over TR-064. Query only the master and you get a single value โ€” and therefore no vector. Full guide: docs/INSTALL.de.md (German).

// config.example.json (excerpt โ€” full template in the repo)
{
  "boxes": [
    { "name": "Office",  "ip": "192.168.178.1", "floor": "Ground floor", "floor_nr": 0, "user": "tracker", "password": "YOUR_PASSWORD" },
    { "name": "Bedroom", "ip": "192.168.178.2", "floor": "Upper floor",  "floor_nr": 1, "user": "tracker", "password": "YOUR_PASSWORD" }
  ],
  "devices": { "AA:BB:CC:DD:EE:FF": "Person1" },
  "mqtt": { "enabled": true, "host": "192.168.178.50", "port": 1883, "user": "ha", "password": "..." },
  "intervals": { "normal": 60, "movement": 15, "idle": 300, "live": 3 },
  "retention_days": 60
}

๐Ÿ› ๏ธ How it works

   N x FritzBox (mesh)              Host (mini-server, LAN-only)        Home Assistant
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ Box A (master)โ”‚  TR-064 / 49000 โ”‚  fritztrack4u.py         โ”‚  MQTT โ”‚  sensor per   โ”‚
   โ”‚ Box B        โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  - login per box (SID)   โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  person       โ”‚
   โ”‚ Box C        โ”‚                 โ”‚  - SignalStrength % / box โ”‚ 1883 โ”‚  presence     โ”‚
   โ”‚ Box D        โ”‚                 โ”‚  - vector + fingerprint   โ”‚       โ”‚  + live btn   โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚  - SQLite 60-day history  โ”‚       โ”‚  + (3D viz)   โ”‚
                                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Login: AVM challenge-response (MD5 over UTF-16LE โ€” the gotcha), SID reused ~900 s to spare the box.
  • Data source: TR-064 GetGenericAssociatedDeviceInfo per box โ†’ SignalStrength (%) per phone.
  • Vector: collect every box value per phone โ†’ [Box A%, Box B%, โ€ฆ].
  • Match: best_room() compares the vector against calibrated room fingerprints (mean deviation over all boxes).
  • Hardening: retries + pauses against FritzBox overload, large normal intervals as protection.

๐Ÿ”ฅ The Story โ€” how "impossible" became proof

This README documents the journey honestly, dead ends included. There was no genius trick โ€” there was stubbornness.

  1. The first consensus: "FritzBox can't do indoor tracking, a box reports only one value per phone โ€” everyone uses ESP32." Sounds solid. It was incomplete.
  2. Mesh-sticking discovered: a phone clings to an old box even after the person has left. "Which box it's on" โ‰  "where the person is." First proof the naive assumption is wrong.
  3. ~12 API routes across 3 test rounds: many dead ends โ€” edit_device (1 value), meshlist.lua (404), meshTopo (data, but no rssi fields), homeNet/meshNet (no dBm). Every route actually tested, not dismissed "by feel."
  4. Three times "impossible" โ€” three times contradicted: the AI confidently declared "you can't triangulate with a FritzBox" three times. Murat disagreed each time โ€” on physics: neighbor boxes hear the phone faintly through the walls (exactly what the FritzBox uses internally for mesh steering). He was right every time.
  5. ๐Ÿ’ฅ The breakthrough: don't query only the master โ€” a dedicated login PER box. Then TR-064 GetGenericAssociatedDeviceInfo returns each box's SignalStrength. Observed: in edge cases a neighbor box sees the same phone faintly through the wall โ€” e.g. {Office 35%, Sara 10%}. That is the exception (usually a phone is attached to only one box), but combined with floor info and calibrated fingerprints it is enough for a room assignment.
  6. Presence bug found & fixed: a phone gone offline stuck to its old room โ€” now: no box sees the phone = away.
  7. The iPhone standby trap: iPhones briefly vanish from the association list in standby without leaving the room. Fix: a 2-minute buffer before a room counts as "left."

The strategy shift that turned everything: away from "query one box" toward "multi-box data collector." A snapshot became a dynamic positioning system. Murat was right about all of it.

The lesson: three "can't be done" is not proof it can't be done. Ask all nodes, not just the nearest.


๐Ÿ“œ Changelog

Version What was added
v1 One box, rough floor only ("which box is the phone on").
v5 Per-room fingerprint calibration โ€” 1 box + dBm, first room accuracy.
v6 Multi-box data collector: all boxes individually via TR-064, presence check (offline = away), SQLite history, adaptive polling.
v6.1 Guest detection + 60-day auto-cleanup.
FritzTrack4U (public) Config-driven 1โ€“N boxes, anonymized, signal-pattern match against trained room fingerprints.

๐Ÿ‡น๐Ÿ‡ท Tuerkce

Tum ev icin oda-bazli konum tespiti โ€” sadece zaten duvarda asili olan FritzBox router'larla. Ekstra donanim yok. ESP32 yok. API anahtari yok. Bir ila cok sayida AVM router, TR-064 ve "olmaz" demeye inanmama inadi.

๐Ÿงญ Temel Prensip โ€” neden calisir

GPS disarida mukemmel, iceride hic calismaz. Oysa kimin nerede oldugunu tam da ev icinde bilmek istersin. FritzTrack4U bunu tek bir fikirle cozer:

Her FritzBox ayni telefonu AYNI ANDA olcer โ€” her biri kendi sinyal gucuyle.

Bir odadaki telefon tek bir deger degil, tum kutular uzerinde bir vektor uretir. En guclu kutu kati belli eder. Tam vektor odayi belli eder. Eslestirme, kalibre edilmis oda parmak izlerine karsi yapilir โ€” sadece en guclu kutuya degil, tum kutulara gore.

flowchart LR
    P(("๐Ÿ“ฑ Bir telefon<br/>calisma odasinda"))
    P -. "guclu" .-> B1["๐Ÿ“ก Kutu A<br/>80%"]
    P -. "orta" .-> B2["๐Ÿ“ก Kutu B<br/>40%"]
    P -. "zayif" .-> B3["๐Ÿ“ก Kutu C<br/>15%"]
    P -. "cok zayif" .-> B4["๐Ÿ“ก Kutu D<br/>5%"]
    B1 --> V["๐Ÿงฎ Vektor<br/>{A:80, B:40,<br/>C:15, D:5}"]
    B2 --> V
    B3 --> V
    B4 --> V
    V --> M{{"Oda parmak izleriyle<br/>karsilastir<br/>(TUM kutular uzerinde<br/>ortalama sapma)"}}
    M --> R(["๐Ÿ  Konum:<br/>calisma odasi"])
Loading

Onemli nokta: konum, tam vektor karsilastirmasindan gelir (tum kutular uzerinde ortalama mutlak sapma), yalnizca en guclu kutudan degil. Ne kadar cok kutu dinlerse, o kadar isabetli olur.

   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚   ๐Ÿ“ฑ  BIR oda (orn. ofis)                                          โ”‚
   โ”‚       โ”‚                                                           โ”‚
   โ”‚       โ”œโ”€โ”€โ”€โ”€ ๐Ÿ“ก Kutu 1  โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–‘โ–‘  80%   โ† guclu, ayni oda        โ”‚
   โ”‚       โ”œโ”€โ”€โ”€โ”€ ๐Ÿ“ก Kutu 2  โ–“โ–“โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  40%   โ† yan oda                โ”‚
   โ”‚       โ”œโ”€โ”€โ”€โ”€ ๐Ÿ“ก Kutu 3  โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  15%   โ† duvarin ardindan       โ”‚
   โ”‚       โ””โ”€โ”€โ”€โ”€ ๐Ÿ“ก Kutu 4  โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   5%   โ† baska kat              โ”‚
   โ”‚                          โ–ผ                                        โ”‚
   โ”‚              Vektor {80, 40, 15, 5}  โ”€โ”€โ–บ  ODA: ofis โœ…            โ”‚
   โ”‚                                                                   โ”‚
   โ”‚   En guclu kutu = KAT          Tam vektor = ODA                   โ”‚
   โ”‚   Hicbir kutu telefonu gormez = EVDE DEGIL                        โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Ozellikler

  • ๐Ÿ  Oda-bazli konum: cok-kutulu sinyal vektoru + kalibre parmak izleri (tum kutular uzerinde ortalama sapma).
  • ๐Ÿชœ Kat tespiti: en guclu kutudan โ€” tek bir kutuyla bile calisir.
  • ๐Ÿšช Var/yok: hicbir kutu telefonu gormuyorsa โ†’ kisi evde degil.
  • ๐Ÿ‘ฅ Misafir tespiti: bilinmeyen cihazlar misafir olarak isaretlenir, sessizce atlanmaz.
  • ๐Ÿ—„๏ธ SQLite gecmisi ve 60 gunluk otomatik temizlik โ€” kim ne zaman hangi odadaydi.
  • โฑ๏ธ Uyarlanabilir tarama: harekette hizli, dingin durumda tutumlu โ€” FritzBox'i korur.
  • ๐Ÿ”Œ Home Assistant MQTT otomatik kesfi ile โ€” kisi basina bir sensor, elle ayar yok.
  • ๐Ÿงฉ Yapilandirma-tabanli, 1 ila N kutu: tek kutuyla calisir, istedigin kadar olceklenir.
  • ๐Ÿ’ธ 0 โ‚ฌ ekstra donanim. API anahtari yok. Bulut yok.

๐Ÿ“ˆ Donanim olcekleme โ€” cok kutu, cok isabet

Kutu Ne elde edersin Isabet
1 kutu Telefon hangi kutuda? โ†’ kaba kat ๐ŸŸก kat seviyesi
2โ€“3 kutu Ilk sinyal vektorleri โ†’ oda (parmak iziyle) ๐ŸŸข oda seviyesi
4+ kutu Yogun vektor โ†’ saglam oda, oda icinde konum temeli ๐ŸŸข๐ŸŸข oda seviyesi +

Pratik kural: En guclu kutu = kat. Tam vektor = oda. Kutu yok = evde degil.

โš”๏ธ Karsilastirma โ€” FritzTrack4U vs. ESP32-Bermuda

Durust olalim: ESP32 daha isabetli, profesyonel standarttir. FritzTrack4U sifir ekstra donanim istedigin zaman kazanir.

Olcut FritzTrack4U ESP32 Bermuda / ESPresense
Donanim maliyeti 0 โ‚ฌ (kutular hazir) cip basina ~5 โ‚ฌ, oda basina bir tane
Evdeki ekstra cihaz yok cok (her odaya bir cip)
Isabet kaba โ†’ oda-bazli (vektorle) oda-bazli, <10 sn
Olgunluk kendin yap, burada belgeli profesyonel standart
Kurulum kutu basina 1 router kullanicisi cipleri flashla + dagit
Ek guc tuketimi 0 (kutular zaten calisir) dusuk ama katlanmis
Ne zaman kazanir hicbir sey almak istemiyorsan maksimum isabet istiyorsan

Sonuc: "ESP32'den iyi" degil โ€” bedava ve yeterince iyi, gelisime acik.

๐Ÿš€ Hizli baslangic

git clone https://github.com/Aslan4u73/FritzTrack4u.git
cd FritzTrack4u

# Sadece MQTT/Home Assistant kullaniyorsan gerekli (yoksa bagimliliksiz calisir):
pip install -r requirements.txt

# Sablondan kendi yapilandirmani olustur ve doldur:
cp config.example.json config.json
nano config.json

python3 fritztrack4u.py --config ./config.json

Cok-kutu icin zorunlu adim (asil puf nokta): her FritzBox'ta "FRITZ!Box ayarlari" yetkisine sahip ozel bir kullanici olustur. Ancak o zaman her kutu TR-064 uzerinden kendi sinyal gucunu verir. Sadece master'i sorgularsan tek deger alirsin โ€” ve vektor olmaz. Tam kilavuz: docs/INSTALL.de.md (Almanca).

// config.example.json (kesit โ€” tam sablon repo'da)
{
  "boxes": [
    { "name": "Ofis",    "ip": "192.168.178.1", "floor": "Zemin kat", "floor_nr": 0, "user": "tracker", "password": "SIFREN" },
    { "name": "Yatak",   "ip": "192.168.178.2", "floor": "Ust kat",   "floor_nr": 1, "user": "tracker", "password": "SIFREN" }
  ],
  "devices": { "AA:BB:CC:DD:EE:FF": "Kisi1" },
  "mqtt": { "enabled": true, "host": "192.168.178.50", "port": 1883, "user": "ha", "password": "..." },
  "intervals": { "normal": 60, "movement": 15, "idle": 300, "live": 3 },
  "retention_days": 60
}

๐Ÿ› ๏ธ Nasil calisir

   N x FritzBox (mesh)              Sunucu (mini, sadece LAN)           Home Assistant
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ Kutu A (master)โ”‚ TR-064 / 49000 โ”‚  fritztrack4u.py         โ”‚  MQTT โ”‚  kisi basina  โ”‚
   โ”‚ Kutu B       โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  - kutu basina giris (SID)โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  sensor       โ”‚
   โ”‚ Kutu C       โ”‚                 โ”‚  - kutu basina % sinyal   โ”‚ 1883 โ”‚  var/yok      โ”‚
   โ”‚ Kutu D       โ”‚                 โ”‚  - vektor + parmak izi    โ”‚       โ”‚  + canli btn  โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚  - SQLite 60 gun gecmis   โ”‚       โ”‚  + (3D goruntu)โ”‚
                                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Giris: AVM challenge-response (MD5, UTF-16LE uzerinden โ€” puf nokta), SID kutuyu yormamak icin ~900 sn tekrar kullanilir.
  • Veri kaynagi: kutu basina TR-064 GetGenericAssociatedDeviceInfo โ†’ telefon basina SignalStrength (%).
  • Vektor: telefon basina her kutu degerini topla โ†’ [Kutu A%, Kutu B%, โ€ฆ].
  • Eslestirme: best_room() vektoru kalibre oda parmak izleriyle karsilastirir (tum kutular uzerinde ortalama sapma).
  • Saglamlastirma: FritzBox asiri yukune karsi yeniden deneme + bekleme, koruma icin genis normal araliklar.

๐Ÿ”ฅ Hikaye โ€” "imkansiz" nasil kanita donustu

Bu README yolculugu durustce belgeler, cikmaz sokaklar dahil. Dahiyane bir numara yoktu โ€” inat vardi.

  1. Ilk uzlasi: "FritzBox ev ici takip yapamaz, bir kutu telefon basina yalnizca tek deger verir โ€” herkes ESP32 kullanir." Saglam gorunur. Eksikti.
  2. Mesh-yapismasi kesfi: telefon, kisi coktan gitse bile eski bir kutuya yapisir. "Hangi kutuda" โ‰  "kisi nerede". Naif varsayimin yanlis oldugunun ilk kaniti.
  3. 3 turda ~12 API yolu: cok cikmaz โ€” edit_device (1 deger), meshlist.lua (404), meshTopo (veri var ama rssi yok), homeNet/meshNet (dBm yok). Her yol gercekten denendi, "hissederek" elenmedi.
  4. Uc kez "imkansiz" โ€” uc kez itiraz: yapay zeka uc kez kendinden emin "FritzBox ile uclulama olmaz" dedi. Murat her seferinde fizikle itiraz etti: komsu kutular telefonu duvarlardan zayifca duyar (FritzBox bunu mesh yonlendirme icin zaten kullanir). Her seferinde haklฤฑ cikti.
  5. ๐Ÿ’ฅ Atilim: sadece master'i degil โ€” her kutu icin ayri giris. O zaman TR-064 GetGenericAssociatedDeviceInfo her kutunun SignalStrength degerini verir. Kanitlandi: ayni telefon iki kutu tarafindan ayni anda gorulur โ€” {Ofis %35, Sara %10}. Gercek bir 2-kutu grubu; aralarinda duvar oldugu icin ikinci kutuda daha zayif.
  6. Var/yok hatasi bulundu & duzeltildi: cevrimdisi olan telefon eski odaya yapisiyordu โ€” artik: hicbir kutu gormezse = evde degil.
  7. iPhone bekleme tuzagi: iPhone'lar beklemede odadan cikmadan kisaca iliski listesinden kaybolur. Cozum: bir oda "terk edildi" sayilmadan once 2 dakikalik tampon.

Her seyi ceviren strateji degisimi: *"bir kutuyu sorgula"*dan *"cok-kutulu veri toplayici"*ya. Anlik goruntu, dinamik bir konum sistemine donustu. Murat her konuda haklฤฑydฤฑ.

Ders: uc kez "olmaz" demek, olmayacaginin kaniti degildir. En yakin dugumu degil, tum dugumleri sor.


๐Ÿ“œ Degisiklik gunlugu

Surum Ne eklendi
v1 Tek kutu, sadece kaba kat ("telefon hangi kutuda").
v5 Oda basina parmak izi kalibrasyonu โ€” 1 kutu + dBm, ilk oda isabeti.
v6 Cok-kutulu veri toplayici: tum kutular TR-064 ile tek tek, var/yok kontrolu (cevrimdisi = yok), SQLite gecmisi, uyarlanabilir tarama.
v6.1 Misafir tespiti + 60 gun otomatik temizlik.
FritzTrack4U (public) Yapilandirma-tabanli 1โ€“N kutu, anonimlestirilmis, tum kutular uzerinde tam vektor eslestirmesi.

๐Ÿ“„ Lizenz / License / Lisans

MIT โ€” frei nutzbar, frei aenderbar, ohne jede Gewaehr und ohne Haftung (siehe Haftungsausschluss oben). / Free to use and modify, no warranty, no liability. / Ozgurce kullan ve degistir, garanti ve sorumluluk yok.


๐Ÿ™‹ Ueber das Projekt / About

Gebaut von Murat Danis (aslan4u.de) โ€” AI-Engineer & E-Commerce-Entwickler.

Ehrlich gesagt: Die Idee und das Durchhalten (nicht aufgeben) kamen von mir โ€” gebaut habe ich es aber gemeinsam mit meiner KI-Assistentin LISA. Allein haette ich das so nicht geschafft. Das ist Mensch + KI als Team, und ich finde, das darf man auch so sagen. ๐Ÿ–ค

Honestly: the idea and the persistence are mine โ€” but I built this together with my AI assistant LISA. I couldn't have done it alone. Human + AI as a team, and I'm happy to say so.

๐Ÿ‘‰ Weitere Projekte / More projects: aslan4u.de


โš–๏ธ DE โ€” FRITZ! und FRITZ!Box sind eingetragene Marken der FRITZ! GmbH (vormals AVM GmbH). Dieses Projekt ist ein unabhaengiges, von der Community entwickeltes Werkzeug und steht in keiner Verbindung zu FRITZ!/AVM. Produktnamen werden ausschliesslich zu Identifikationszwecken genannt, um die Kompatibilitaet zu beschreiben.

EN โ€” FRITZ! and FRITZ!Box are registered trademarks of FRITZ! GmbH (formerly AVM GmbH). This project is an independent, community-developed tool, neither affiliated with, authorized, sponsored nor endorsed by FRITZ!/AVM. Product names are used for identification purposes only to describe compatibility.

Gebaut aus Sturheit, FritzBoxen und einem Mini-Server ohne WLAN-Karte. Built from stubbornness, FritzBoxes, and a mini-server with no Wi-Fi card. Inattan, FritzBox'lardan ve WLAN karti olmayan bir mini sunucudan dogdu.

โญ Wenn dich das hier ueberzeugt hat โ€” gib einen Stern. / If this convinced you โ€” drop a star. / Ikna olduysan โ€” bir yildiz birak.


๐Ÿ”Ž Keywords / Schlagwoerter / Anahtar kelimeler

#IndoorGPS ยท #IndoorPositioning ยท #IndoorPersonTracking ยท #IndoorLocalization ยท #WiFiPositioning ยท #WiFiSensing ยท #WiFiTracking ยท #WiFiFingerprinting ยท #RSSI ยท #PresenceDetection ยท #RoomPresence ยท #OccupancySensing ยท #DeviceFree ยท #Trilateration ยท #HomeAssistant ยท #SmartHome ยท #SmartHomeDE ยท #Hausautomatisierung ยท #HomeAutomation ยท #IoT ยท #FritzBox ยท #AVM ยท #TR064 ยท #NoESP32 ยท #ESPresenseAlternative ยท #PrivacyFirst ยท #OpenSource

FritzBox Anwesenheitserkennung ยท Home Assistant Anwesenheitserkennung ยท Raumerkennung Home Assistant ยท Praesenzerkennung Smart Home ยท WLAN Personen erkennen ยท Anwesenheitserkennung ohne ESP32 ยท wer ist zuhause Smart Home ยท Etage erkennen Smart Home ยท Gaeste erkennen WLAN ยท indoor ortung WLAN open source ยท raumgenaue Ortung per WLAN ยท router-based presence detection ยท WiFi RSSI room-level presence ยท device-free indoor localization ยท multi-floor indoor positioning ยท self-hosted indoor positioning ยท ESPresense alternative without ESP32 ยท FRITZ!Box Home Assistant device tracker

About

Room & floor presence detection for Home Assistant using the WiFi signal of FRITZ!Box routers you already own (TR-064). No ESP32, no cloud - pure Python. MIT.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages