# robbyatbln/t1000e-telemetry-bot architecture

> Architecture diagram of the GitHub repository robbyatbln/t1000e-telemetry-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/robbyatbln/t1000e-telemetry-bot
- Repository: https://github.com/robbyatbln/t1000e-telemetry-bot

## Overview

This fork adapts MeshCore firmware for the SenseCAP T1000-E as a chat-based telemetry tracker, and adds a Home Assistant integration. The main user flow is a button press or chat request producing location/environment telemetry for delivery through MeshCore, with an optional private-channel flood mode; users can also request a repeated on-device search signal. The tree and excerpts support the T1000-E sensor and mesh-routing layers, while README statements support the broader firmware and Home Assistant capabilities. Some integration wiring is documented but its implementation was not sampled.

Main entry points: [`variants/t1000-e/target.cpp`](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/target.cpp) (T1000-E target), [`src/Mesh.cpp`](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Mesh.cpp) (Mesh routing), [`src/Dispatcher.cpp`](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Dispatcher.cpp) (Packet dispatch), [`custom_components/meshcore_location/config_flow.py`](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/config_flow.py) (Integration setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mesh["MeshCore runtime"]
  node_meshcore["Mesh routing<br/>[Mesh.cpp]"]
  node_dispatch["Packet dispatch<br/>[Dispatcher.cpp]"]
  node_packet["Packet model<br/>[Packet.cpp]"]
  node_packet_pool["Packet queues"]
  node_identity["Node identity<br/>[Identity.cpp]"]
end

subgraph group_tracker["T1000-E firmware"]
  node_target["T1000-E target<br/>[target.cpp]"]
  node_sensors["Telemetry sensors<br/>[target.cpp]"]
  node_board["T1000-E board<br/>[T1000eBoard.h]"]
  node_location["Location provider<br/>[LocationProvider.h]"]
end

subgraph group_ha["Home Assistant"]
  node_ha_flow["Integration setup<br/>[config_flow.py]"]
  node_ha_parser["Location parser<br/>[parser.py]"]
  node_ha_tracker["GPS tracker<br/>[device_tracker.py]"]
  node_ha_button["Command buttons<br/>[button.py]"]
  node_ha_discovery["Entity discovery<br/>[discovery.py]"]
end

node_user(("Tracker user"))
node_client(("Chat client"))
node_private_channel(("Private channel"))
node_map(("Tracker map"))

node_user -->|"uses"| node_client
node_client -->|"requests telemetry"| node_target
node_target -->|"queries"| node_sensors
node_sensors -.->|"reads position"| node_location
node_target -->|"sends telemetry"| node_meshcore
node_meshcore -.->|"routes packets"| node_dispatch
node_dispatch -.->|"queues packets"| node_packet_pool
node_meshcore -.->|"uses identity"| node_identity
node_target -->|"runs on"| node_board
node_target -->|"returns telemetry"| node_client
node_target -->|"floods optionally"| node_private_channel
node_user -->|"requests search signal"| node_target
node_client -->|"configures channels"| node_ha_flow
node_private_channel -.->|"provides messages"| node_ha_parser
node_ha_parser -->|"extracts locations"| node_ha_tracker
node_ha_tracker -->|"updates position"| node_map
node_ha_flow -.->|"discovers entities"| node_ha_discovery
node_ha_button -->|"issues commands"| node_client

click node_target "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/target.cpp"
click node_sensors "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/target.cpp"
click node_board "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/T1000eBoard.h"
click node_meshcore "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Mesh.cpp"
click node_dispatch "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Dispatcher.cpp"
click node_packet "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Packet.cpp"
click node_packet_pool "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/helpers/StaticPoolPacketManager.cpp"
click node_identity "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Identity.cpp"
click node_location "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/helpers/sensors/LocationProvider.h"
click node_ha_flow "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/config_flow.py"
click node_ha_parser "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/parser.py"
click node_ha_tracker "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/device_tracker.py"
click node_ha_button "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/button.py"
click node_ha_discovery "https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/discovery.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_meshcore,node_dispatch,node_packet,node_packet_pool,node_identity,node_user,node_client toneBlue
class node_target,node_sensors,node_board,node_location toneAmber
class node_ha_flow,node_ha_parser,node_ha_tracker,node_ha_button,node_ha_discovery toneMint
class node_private_channel,node_map toneIndigo
```

## Components

### MeshCore runtime

- [Mesh routing](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Mesh.cpp): `src/Mesh.cpp`
- [Packet dispatch](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Dispatcher.cpp): `src/Dispatcher.cpp`
- [Packet model](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Packet.cpp): `src/Packet.cpp`
- [Packet queues](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/helpers/StaticPoolPacketManager.cpp): `src/helpers/StaticPoolPacketManager.cpp`
- [Node identity](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/Identity.cpp): `src/Identity.cpp`

### T1000-E firmware

- [T1000-E target](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/target.cpp): `variants/t1000-e/target.cpp`
- [Telemetry sensors](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/target.cpp): `variants/t1000-e/target.cpp`
- [T1000-E board](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/variants/t1000-e/T1000eBoard.h): `variants/t1000-e/T1000eBoard.h`
- [Location provider](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/src/helpers/sensors/LocationProvider.h): `src/helpers/sensors/LocationProvider.h`

### Home Assistant

- [Integration setup](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/config_flow.py): `custom_components/meshcore_location/config_flow.py`
- [Location parser](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/parser.py): `custom_components/meshcore_location/parser.py`
- [GPS tracker](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/device_tracker.py): `custom_components/meshcore_location/device_tracker.py`
- [Command buttons](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/button.py): `custom_components/meshcore_location/button.py`
- [Entity discovery](https://github.com/robbyatbln/t1000e-telemetry-bot/blob/main/custom_components/meshcore_location/discovery.py): `custom_components/meshcore_location/discovery.py`

### Other components

- **Tracker user**
- **Chat client**
- **Private channel**
- **Tracker map**

## Connections

- Tracker user → Chat client: uses (evidence: `README.md`)
- Chat client → T1000-E target: requests telemetry (evidence: `README.md`)
- T1000-E target → Telemetry sensors: queries (evidence: `variants/t1000-e/target.cpp`)
- Telemetry sensors → Location provider: reads position
- T1000-E target → Mesh routing: sends telemetry (evidence: `README.md`)
- Mesh routing → Packet dispatch: routes packets
- Packet dispatch → Packet queues: queues packets
- Mesh routing → Node identity: uses identity
- T1000-E target → T1000-E board: runs on (evidence: `variants/t1000-e/target.cpp`)
- T1000-E target → Chat client: returns telemetry (evidence: `README.md`)
- T1000-E target → Private channel: floods optionally (evidence: `README.md`)
- Tracker user → T1000-E target: requests search signal (evidence: `README.md`)
- Chat client → Integration setup: configures channels (evidence: `README.md`)
- Private channel → Location parser: provides messages
- Location parser → GPS tracker: extracts locations (evidence: `README.md`)
- GPS tracker → Tracker map: updates position (evidence: `README.md`)
- Integration setup → Entity discovery: discovers entities
- Command buttons → Chat client: issues commands (evidence: `README.md`)
