Offline mode in HA companion app / Using companion app as BLE remote

I would like to use my HA companion app to control BLE devices such as blinds or lightbulbs, even without an internet connection to the HA instance, just using a direct BLE connection from my phone to the device. Is this possible? And if not, would this be hard to add? I want to implement this feature even only for myself if it isn’t viable for upstream. I would appreciate any tips.

Ems… is very VERY VERY complex. You need «remake» all BLE devices controls directly to Android/IOS, so you need rewrite all code (HA is python, Android is Java/Kotlin and IOS is Swift/ObjectC).

The good part is HA don’t need internet connection for local devices. You only need connect directly to HA using LAN.

Mobile → Wifi → HA → BLE/Wifi/Zigbee

Thanks, I meant “internet connection” as a connection to my local network. Router and HA instance can turn off due to e.g. power outage, but I still can have BLE devices running on battery, which I would like to control.

I have found the BLE Transmitter sensor in the app, so I guess some parts of BLE are already implemented?

Not, BLE Transmistter is for send data from you mobile to HA.

All devices controls are in HA.

the app itself will not connect directly to a device as you described. You need to actually setup Bluetooth proxies to communicate with the device and use the app like you would to control any entity.

Very interesting topic here. I do wonder if we could control devices without internet access but I do had the WIFI and router working to provide all the IP needed to the gateway and WIFI switches. As far as i know, TUYA devices need to communicate via cloud which means you must have internet connection. Without cloud connection, all your TUYA or Zigbee devices are dead. The communication needs to relay thru the cloud and received by the device. Unless, we setup a local-tuya connection. Please correct me if I had some wrong information. And I highly appreciate to have a total local control of all my devices.

No, a lot of devices (all Zigbee devices for example) work fine without internet.

If you Zigbee devices not work if because your coordinator need cloud, but not the device. You can use z2m or zha to control Zigbee devices without internet with a simple Zigbee dongle.

1 Like

It seems that the Zigbee gateway I’m using need cloud to communicate :thinking:
Will read into this with more detail. Thank you for highlighting this.