

Anytype is local/offline first, P2P, end to end encrypted, open source, and has a great mobile app. They provide a (storage limited) cloud backup peer for free. You can either self host that yourself, or just rely on P2P syncing with your other devices. I’ve been using it for years and really like it.
I think the answer largely depends on the devices you use. Many devices require an internet connection to integrate with HA. Fortunately, each HA integration should list whether or not they can work locally.
Here are some device suggestions:
Just as an example, I have Ecobee thermostats that are HomeKit compatible. Ecobee provides a cloud service, but I don’t use it at all, and my thermostats are denied internet access at the network level. They still work great through the HomeKit Devices integration.
Good luck!