General topic on privacy with HA linked to integrations and IoT devices

I have a question about data privacy when linking HA to all these IoT devices and hope I have chosen the right Topic.

I currently use Tuya mobile app with several smart power outlet switches, and realize that the interactions with these switches (along with permissions on my phone to Tyua app) are sent to servers in other countries than mine every time I interact with the Tuya app. If I change from using Tuya to use an RPi with HA installed to control the switch, does this mean that all interactions with this switch remain on my LAN?

I understand that device traffic on the HA network is kept local, and doesn’t leave the LAN at home, which is really cool.

However, aren’t some of these internet connected devices able to reach 3rd party endpoints/servers outside of HA once they’re connected to the HA because these devices now have internet access, even though it’s via the HA broker (not sure what to call the HA Green)?

Or is HA somehow able to ensure that the device only has access to the mobile app HA endpoints, and the data goes no further?

No. Tuya integration is cloud push

What is HA network?

Yes

Anything you connect to your home network can reach the internet unless you actively do something to prevent it.

Many choose to have “IOT network” which means many things

For some it is a network for only IOT devices
For some it is devices with limited internet access
For some it is devices with block internet

HA has NO control over internet/network.
You must design this for yourself

HA can be totally local but that depends on devices used and network design.