ESPHome device adding to the system by Open Thread Border Router by openthread component is not reachable by IPv6 from my IPv4 network

I have build open thread border router I use S3 + H2
Installed:
basic_thread_border_router on S3
ot_rcp on H2

Works fine. it starts. in logs everything works good. S3 connect to my IPv4 WiFi network. create Thread network. I am able to access WEB interface by http://192.168.1.93 address

I use http://192.168.1.93 address to add this border router to my Home Assistant in “Open Thread Border Router” extention. and it added. so Home Assistant see my border router.

After that I have took another ESP32 H2.
Installed on it ESPHome with the following config

api:
encryption:
key: "..."

ota:

* platform: esphome
password: "..."

network:
enable_ipv6: true

openthread:
device_type: FTD
tlv: ...

After that if I visit open router web interface by http://192.168.1.93 and use Topology in the bottom of page I can see that new device added to the network with “Child” role.

in case I connect with monitor to new device, I can see that all the text sensors are filled good and SRP client starts

[D][text_sensor:113]: 'Thread Network Key' >> '...'
[D][text_sensor:113]: 'Thread Extended PAN ID' >> 'a1c93bab050e4185'
[D][text_sensor:113]: 'Thread Network Name' >> 'ESP-BR-99DC'
[D][text_sensor:113]: 'Thread PAN ID' >> 'c9af'
[D][text_sensor:113]: 'Thread Extended Address' >> '6e1b7858c05cb0fb'
[D][text_sensor:113]: 'Thread EUI64' >> '1051dbfffe684c32'
[D][text_sensor:113]: 'Thread RLOC16' >> 'fffe'
[D][text_sensor:113]: 'Thread Device Role' >> 'leader'
[D][text_sensor:113]: 'Thread RLOC16' >> '9800'
[D][text_sensor:113]: 'Thread IP Address' >> 'fd5e:8daa:5d8e:1:5230:d7c5:c4af:8fe7'
[I][openthread:114][ot_main]: SRP client has started
[D][text_sensor:113]: 'Thread RLOC16' >> '4001'
[D][text_sensor:113]: 'Thread Device Role' >> 'child'

After that I coming to home assistant device and services and Home Assistat show me that my new device “5 ESP32 H2 Zero (5-esp32-h2-zero) ESPHome” is discovered.
I try to connect it to my Home Assistant and it writes to me that it’s unable to connect to host “fd5e:8daa:5d8e:1:5230:d7c5:c4af:8fe7”.

But if I right understand my border router should catch this host and send it to thread network? Am I right?

Can somebody help please how to connect devices which connected to border router to Home Assistant?
It blows my mind for several days already. I can’t understand how to setup border router.

The OTBR should be sending out IPv6 Routing Advertisements that convey:

  1. IPv6 Prefix for systems like HA to use on the LAN side of the OTBR;
  2. IPv6 Route for systems like HA to reach devices on the Thread side of the OTBR.

I presume you have enabled HA for IPv6 (UI->Settings->System->Network->IPv6, but it is important to set it up in “automatic”. This allows HA to pickup the prefix.
If you are using HAOS, then HAOS will configure the kernel properly to pickup and install the routes advertised. If you are using something else, then there are guides for how you can setup the kernel to do this yourself.

my HA is installed AS HAOS on Rosberry PI 5
about UI->Settings->System->Network->IPv6 settings - it setted up as “automatic”. attached screenshot

may be there is some settings in “idf.py menuconfig” that should be switched on for OTBR or the default values are good?

HA is not seeing the Route Advertisements from the OTBR. HA should have an additional IPv6 prefix, something like fdaf:blah-blah

how to add additional IPv6 prefix in HA?

I have collected some more logs. may be it could help.
I see that one error is appears repeatly

I(10682) OPENTHREAD:[N] BorderRouting-: BR ULA prefix: fd5e:8daa:5d8e::/48 (loaded)
I(10692) OPENTHREAD:[N] BorderRouting-: Local on-link prefix: fda1:c93b:ab05:4185::/64
I (10702) OPENTHREAD: Platform UDP bound to port 53
I (10702) OPENTHREAD: Platform UDP bound to port 49153
I(10702) OPENTHREAD:[N] Mle-----------: Role disabled -> detached
I (10712) OT_STATE: netif up
I (10712) OPENTHREAD: NAT64 ready
I (10722) OPENTHREAD: Platform UDP bound to port 61631
I (10722) OPENTHREAD: NAT64 ready
I (30682) obtr_web: -------------------------------------------
I (30682) obtr_web: /
I (30682) obtr_web: -------------------------------------------
I (30682) obtr_web: Reading /spiffs/index.html
I (30862) obtr_web: -------------------------------------------
I (30862) obtr_web: /static/style.css
I (30872) obtr_web: -------------------------------------------
I (30872) obtr_web: Reading /spiffs/static/style.css
I (30982) obtr_web: -------------------------------------------
I (30982) obtr_web: /static/restful.js
I (30982) obtr_web: -------------------------------------------
I (30982) obtr_web: Reading /spiffs/static/restful.js
I(37812) OPENTHREAD:[N] Mle-----------: RLOC16 4000 -> fffe
I (37812) OPENTHREAD: NAT64 ready
I(38172) OPENTHREAD:[N] Mle-----------: Attach attempt 1, AnyPartition reattaching with Active Dataset
I (41112) obtr_web: <================= OpenThread Properties ==================>
I (41112) obtr_web: Collection Complete !
I (41122) obtr_web: <==========================================================>
I(44782) OPENTHREAD:[N] RouterTable---: Allocate router id 16
I(44782) OPENTHREAD:[N] Mle-----------: RLOC16 fffe -> 4000
I(44792) OPENTHREAD:[N] Mle-----------: Role detached -> leader
I(44792) OPENTHREAD:[N] Mle-----------: Partition ID 0x6755b98d
I (44812) OPENTHREAD: Platform UDP bound to port 49154
I (44822) OPENTHREAD: NAT64 ready
E (45262) OPENTHREAD: Failed to get LL address, error: Invalid If index
W (45262) OPENTHREAD: Failed to send ND6 message
E(45262) OPENTHREAD:[C] BorderRouting-: RsSender: Failed to send RS 1/3: Failed
I (45282) OPENTHREAD: NAT64 ready
I (45292) OPENTHREAD: NAT64 ready
E (45292) OPENTHREAD: Failed to probe backbone multicast listeners
I(45442) OPENTHREAD:[N] MeshForwarder-: Failed to send IPv6 UDP msg, len:110, chksum:6fd8, ecn:no, to:6e1b7858c05cb0fb, sec:no, error:NoAck, prio:net
I(45442) OPENTHREAD:[N] MeshForwarder-:     src:[fe80:0:0:0:c495:ebff:40d9:c9ee]:19788
I(45442) OPENTHREAD:[N] MeshForwarder-:     dst:[fe80:0:0:0:6c1b:7858:c05c:b0fb]:19788
I (46322) OPENTHREAD: NAT64 ready
I (46322) OPENTHREAD: NAT64 ready
I (46902) OPENTHREAD: NAT64 ready
I (46902) OPENTHREAD: NAT64 ready
I (47922) OT_STATE: Set dns server address: FD5E:8DAA:5D8E:2::808:808
I (47922) OPENTHREAD: NAT64 ready
E (49282) OPENTHREAD: Failed to get LL address, error: Invalid If index
W (49282) OPENTHREAD: Failed to send ND6 message
E(49282) OPENTHREAD:[C] BorderRouting-: RsSender: Failed to send RS 1/3: Failed
E (53302) OPENTHREAD: Failed to get LL address, error: Invalid If index
W (53302) OPENTHREAD: Failed to send ND6 message
E(53302) OPENTHREAD:[C] BorderRouting-: RsSender: Failed to send RS 1/3: Failed
E (57322) OPENTHREAD: Failed to get LL address, error: Invalid If index
W (57322) OPENTHREAD: Failed to send ND6 message
E(57322) OPENTHREAD:[C] BorderRouting-: RsSender: Failed to send RS 1/3: Failed
E (61342) OPENTHREAD: Failed to get LL address, error: Invalid If index
W (61342) OPENTHREAD: Failed to send ND6 message
E(61342) OPENTHREAD:[C] BorderRouting-: RsSender: Failed to send RS 1/3: Failed
E (65362) OPENTHREAD: Failed to get LL address, error: Invalid If index
W (65362) OPENTHREAD: Failed to send ND6 message
E(65362) OPENTHREAD:[C] BorderRouting-: RsSender: Failed to send RS 1/3: Failed

There are a lot of IPv6 failures (Failed to get LL address, Failed to send ND6 message, etc). These for sure need to be fixed.
There should be an earlier line in the log that says something like: Infra link selected: enp1s0. What does it show?

BTW, it did pick a prefix Local on-link prefix: fda1:c93b:ab05:4185::/64 that it should be advertising to HA using a Router Advertisement, but my guess is that the RA didn’t get sent out.

thank you for your help! you sent me to proper direction. I have understood the way it should work.
for now it works for me!
I have removed sdkconfig and after that build project from zero. updated just neccessery things in “idf.py menuconfig” such as start automaticly border router and pins for access to coprocessor. and after that it works automaticly in HA.
thank you for sending me to proper direction and helping understand how border router works itself.