Thanks for sharing this! As I was trying to implement the steps in your post, I actually found an even easier way to create a router device - if you have ESP Home that is. They just recently added Thread support to ESP Home.
The only piece of data you need to retrieve from your existing Thread network is the TLV string, which can be found directly through HA. Go to Settings → Devices & Services → Integrations → Thread. Click the Cogwheel by the existing Thread integration, then click the ⓘ by your Thread network; the TLV string is the last entry under Active Dataset TLVs.
Here is a working config file (I have some extra stuff in mine since I am using a non-Espressif ESP32-C6 device which seems to require that).
esphome:
name: thread-router
friendly_name: Thread Router
esp32:
board: esp32-c6-devkitm-1
flash_size: 4MB
variant: esp32c6
framework:
type: esp-idf
#Can be dev, latest, recommended, or check https://github.com/espressif/esp-idf/releases
version: "5.2.1"
#check platform_version @ https://github.com/platformio/platform-espressif32/releases/
platform_version: 6.7.0
sdkconfig_options:
CONFIG_OPENTHREAD_ENABLED: y
CONFIG_ENABLE_WIFI_STATION: y
CONFIG_USE_MINIMAL_MDNS: y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB: y
logger:
# Enable Home Assistant API
api:
encryption:
key: <device encryption key>
network:
enable_ipv6: true
openthread:
tlv: <your tlv string from home assistant>
I think this config should work for regular C6 or H2 devices (not tested):
esphome:
name: thread-router
friendly_name: Thread Router
esp32:
board: esp32-c6-devkitm-1
framework:
type: esp-idf
logger:
# Enable Home Assistant API
api:
encryption:
key: <device encryption key>
network:
enable_ipv6: true
openthread:
tlv: <your tlv string from home assistant>
You can go to the web port of the Open Thread Border Router add on as described in the OP and then go to Topology to see if it worked. You should see something like this to confirm that your new device is acting as a router. It may take a while for it to show, and an even longer while for any children to actually connect to it.
This should also support any sensors etc that you can normally use in ESPHome, although I haven’t tested that yet. I will keep an eye on the stability of this device and then probably convert my other ESPHome devices to use Thread instead of WIFI as well.
