Automatically discover and integrate CoAP-enabled Thread devices into Home Assistant.
This add-on bridges CoAP devices on your Thread network to Home Assistant using MQTT Discovery. It:
- Automatically discovers Thread devices via CoAP multicast
- Monitors device state in real-time using CoAP Observe
- Creates Home Assistant entities automatically (lights, sensors, switches)
- Handles bidirectional control (HA → Device and Device → HA)
Before installing this add-on, you need:
- OpenThread Border Router (OTBR) add-on installed and running
- Mosquitto broker add-on installed and running
- At least one Thread device with CoAP server (e.g., nRF54L15 with Zephyr firmware)
- Navigate to Settings → Add-ons → Add-on Store
- Click the menu (⋮) → Repositories
- Add this repository URL:
https://github.com/yourusername/ha-addon-thread-coap-bridge - Find "Thread CoAP Bridge" in the list
- Click Install
mqtt_host: core-mosquitto
mqtt_port: 1883
mqtt_user: homeassistant
mqtt_password: your_secure_password
discovery_interval: 60
log_level: info
thread_interface: wpan0
multicast_address: ff03::fd| Option | Description | Default |
|---|---|---|
mqtt_host |
Hostname of MQTT broker | core-mosquitto |
mqtt_port |
MQTT broker port | 1883 |
mqtt_user |
MQTT username | homeassistant |
mqtt_password |
MQTT password | (empty) |
discovery_interval |
How often to scan for new devices (seconds) | 60 |
log_level |
Logging verbosity: debug, info, warning, error | info |
thread_interface |
Thread network interface name | wpan0 |
multicast_address |
CoAP multicast address for discovery | ff03::fd |
- Discovery: Periodically multicasts CoAP requests to find devices
- Resource Query: Queries each device's
/.well-known/coreendpoint - MQTT Publishing: Creates Home Assistant entities via MQTT Discovery
- Observation: Subscribes to device updates using CoAP Observe
- Control: Translates HA commands to CoAP PUT requests
Your Thread/CoAP devices must implement:
- CoAP server listening on port 5683
/.well-known/coreendpoint for resource discovery- Resources with CoRE Link Format attributes:
rt(resource type): e.g., "light", "sensor", "battery"if(interface): e.g., "actuator", "sensor"obsflag for observable resources
Example resource advertisement:
</led>;rt="light";if="actuator";obs,
</switch>;rt="button";if="sensor";obs,
</battery>;rt="sensor";if="battery";obs
The bridge automatically maps CoAP resources to Home Assistant entities:
| Resource Type | HA Entity Type | Features |
|---|---|---|
light / led |
Light | On/Off control, real-time state |
switch |
Switch | On/Off control, real-time state |
button |
Binary Sensor | Button press detection |
battery |
Sensor | Battery percentage monitoring |
temperature |
Sensor | Temperature readings |
humidity |
Sensor | Humidity readings |
Check Thread network is operational:
ot-ctl state
# Should show: leader, router, or childVerify device has IPv6 address:
ot-ctl ipaddrTest manual CoAP request:
aiocoap-client -m GET coap://[device-ipv6]/.well-known/coreCheck add-on logs:
- Click on the add-on
- Go to the Log tab
- Look for discovery attempts and errors
- Ensure Mosquitto broker add-on is running
- Verify credentials in add-on configuration
- Check Mosquitto logs for authentication errors
- Try connecting with MQTT Explorer to verify broker works
- Verify MQTT Discovery is enabled:
- Settings → Devices & Services → MQTT
- Check "Enable discovery" is ON
- Use MQTT Explorer to check topics under
homeassistant/ - Check Home Assistant logs for MQTT processing errors
- Restart Home Assistant core
- Check device is still joined to Thread network
- Verify device is responding to ping:
ping6 [device-ipv6] - Check if device went to sleep without proper keepalive
- Look at bridge logs for connection errors
Devices are automatically named using their EUI-64. To customize:
- Wait for device to appear in HA
- Go to Settings → Devices & Services
- Find the device and click on it
- Click the gear icon and rename
For battery-powered devices:
- Configure as Sleepy End Device (SED) in firmware
- Set longer
discovery_interval(e.g., 300 seconds) - Use CoAP Observe for state updates instead of polling
- Implement proper sleep modes between transmissions
Enable debug logging to see all CoAP traffic:
log_level: debugThis shows:
- Multicast discovery attempts
- Device responses
- Resource queries
- Observe notifications
- MQTT publishing events
- Thread Network: All traffic is encrypted at the MAC layer with AES-128
- MQTT: Uses authentication (username/password)
- CoAP: Currently unencrypted application layer (DTLS support planned)
For enhanced security:
- Use strong MQTT passwords
- Keep Thread network key secure
- Regularly update device firmware
- Monitor logs for unusual activity
- Documentation: See README.md in repository
- Issues: https://github.com/yourusername/ha-addon-thread-coap-bridge/issues
- Discussions: https://github.com/yourusername/ha-addon-thread-coap-bridge/discussions
MIT License - see LICENSE file in repository