HomeKit does not show HomePod Accessories and Services

68 Views Asked by At

I have multiple HomePods in my house (both HomePod Minis and second generation HomePod) which have humidity and temperature sensors. In the Home app I can clearly see the HomePods and their related temperature and humidity service.

However, when I try to programmatically access these accessories from the HomeKit Swift SDK, they do not show up. I have tried both getting accessories and services directly (see both code examples below).

Getting Accessories:

func findAccessories(homeId: UUID) {
        guard let devices = homes.first(where: {$0.uniqueIdentifier == homeId})?.accessories else {
            print("ERROR: No Accessory not found!")
            return
        }
        accessories = devices
}

Getting Services:

func findTempServices(homeId: UUID) {
        guard let tempServices = homes.first(where: {$0.uniqueIdentifier == homeId})?.servicesWithTypes([HMServiceTypeTemperatureSensor, HMServiceTypeHumiditySensor, HMServiceTypeSpeaker, HMAccessoryCategoryTypeBridge]) else {
            print("ERROR: No Services found!")
            return
        }
        services = tempServices
}

Are HomePods simply not supported in the HomeKit SDK (this is not documented anywhere) or is the a different way to access them?

0

There are 0 best solutions below