How mariofritzer/opple-smart-connect-box-diy works
SkyBridge turns an ESP32 into a local Bluetooth Mesh-to-Home Assistant bridge. The user imports a Telink mesh export and Wi-Fi/MQTT settings through the setup portal; the bridge persists the keys, discovers lamps, and joins the mesh. MQTT Discovery exposes individual lamps and an all-lamps group to Home Assistant. Commands travel back through MQTT and the mesh, while polled or changed lamp state is published for Home Assistant. The excerpts show the main startup, portal, MQTT, and mesh responsibilities; some discovery and persistence wiring is documented but not fully sampled.
Main entry points: main.c Startup and Wi-Fi · mesh.c Mesh Runtime · portal.c Setup Portal · mqtt_ha.c MQTT Discovery and Commands
Components 12
Setup and Config
- Setup Portal
main/portal.c - Saved Config
main/portal.c - Board Profiles
main/boards.h
Connectivity
- Startup and Wi-Fi
main/main.c
Bluetooth Mesh
- Mesh Runtime
main/mesh.c
Home Assistant
- MQTT Discovery and Commands
main/mqtt_ha.c
Other components
- Installer
- Wi-Fi Network
- Telink Mesh Export
- Mesh Lamps
- MQTT Broker
- Home Assistant
Connections 20
- Installer → Setup Portal: configures
- Telink Mesh Export → Setup Portal: uploads keys
- Setup Portal → Saved Config: saves settings
- Startup and Wi-Fi → Saved Config: loads settings
- Startup and Wi-Fi → Board Profiles: applies profile
- Startup and Wi-Fi → Setup Portal: starts portal
- Startup and Wi-Fi → Wi-Fi Network: joins network
- Wi-Fi Network → Startup and Wi-Fi: provides IP
- Startup and Wi-Fi → Mesh Runtime: starts mesh
- Startup and Wi-Fi → MQTT Discovery and Commands: starts MQTT
- Setup Portal → Mesh Runtime: requests scan
- Mesh Runtime → Mesh Lamps: discovers and controls
- Mesh Lamps → Mesh Runtime: returns status
- Mesh Runtime → Saved Config: stores lamp data
- Mesh Runtime → MQTT Discovery and Commands: publishes lamp state
- MQTT Discovery and Commands → Mesh Runtime: submits commands
- MQTT Discovery and Commands → MQTT Broker: publishes and subscribes
- MQTT Broker → MQTT Discovery and Commands: delivers commands
- Home Assistant → MQTT Broker: sends commands
- MQTT Broker → Home Assistant: delivers discovery and state