Help with Wi-Fi connection name detection via Companion App

Hi! I’m trying to use WiFi connection name to detect presence. Especially for zones different from home that do not have a smart router or HA server locally. The problem is that HA companion app does detect changes in Wi-Fi connection if the app is in background on Android 13 with all battery optimization methods turned off. As a result this approach of using Wi-Fi connection name for zone detection does not work. Any ideas how to fix that?