Apple Watch App Can't Get Homes

I'm having trouble with HomeKit on watchOS 6.2.5. My Watch Extension is set up for HomeKit. I get an authorization request the first time I launch the app, and calling manager.authorizationStatus.contains(.authorized) returns true. However, manager.homes is always empty (including after calls to homeManagerDidUpdateHomes). The same code/app is working fine on iOS.


Each time, the console log contains the following 3 lines:

2020-06-07 14:49:51.689944-0700 Sauna Watch WatchKit Extension[24310:2953527] libMobileGestalt MGIOKitHelper.m:239: Failed to retrieve data Ai0zsJQ3+sTFkU6/lLbd5A:mug/QuG6jZ3CYR9p7OWQaw

2020-06-07 14:49:51.954374-0700 Sauna Watch WatchKit Extension[24310:2953616] [HomeManager] Received empty response from sync

2020-06-07 14:50:20.957487-0700 Sauna Watch WatchKit Extension[24310:2953527] [Activity] [Fetch home configuration (D2F81A7E-6AD9-4EC4-B1B3-6D5B8874DD9D)] Thread left active (1): <NSThread: 0x176453d0>{number = 3, name = main}

Seeing the same thing on watchOS 6.2.6
Can you provide the type of WatchKit application you are building, see https://developer.apple.com/documentation/watchkit/creating_independent_watchos_apps?
I am seeing the same problem in a Watch-only test app. I have two test projects. One is a watch only app, with no iOS app. In this app, I've placed the NSHomeKitUsageDescription in the info.plist file of the Watch App Extension. The message from it shows in the authorization alert. Once the authorization is given, the app cannot find any HomeKit homes. homeManagerDidUpdateHomes receives an empty array for homes. I always see the
[HomeManager] Received empty response from sync
in the debug console.

The other project is an iOS + Watch app, and there are no differences in the watch app code. The only difference is that the NSHomeKitUsageDescription is in the info.plist in the iOS app, and the initial authorization is given in the iOS app. From that point on, the Watch app forks fine, and can detect homes no problem, even when the phone is turned off, and the watch is on its on, on WiFi. In this test project, I have the "Support Running Without iOS App Installation" checked.

Unless I'm missing something simple, this looks like a pretty big problem in WatchKit, and I should file a bug report for it, and submit these two test projects. It unfortunately makes it impossible for me to make a simple watch-only HomeKit app that I was planning.
I tested this again today on the first developer beta of watchOS 7 and it now works without any modifications to the code that was failing before.

Perhaps the upgrade process changed my configuration, though on watchOS 6 I tried multiple times to erase and restore my Watch without ever having success with this code. Or, perhaps Apple fixed/changed something in HomeKit on watchOS 7?
And in answer to the Frameworks Engineer, my app is a Watch-only app.
They probably fixed it in watchOS7, so hopefully it will be fixed in the next 6.2.x update also. This is almost for sure a problem in watchOS 6 and it only affects Watch-only apps. I have experienced the exact same problem you were seeing with my watch-only app, and the problem is gone as long as you have the iOS app as well, and the HomeKit authorization is performed in it.
The problem unfortunately persists in watchOS 6.2.8
Support for HomeKit in Watch-only applications requires watchOS 7.0.
Apple Watch App Can't Get Homes
 
 
Q