Smart Lighting with HomeKit in watchOS

Learn to use HomeKit in watchOS to control light bulbs in your home. HomeKit is versatile, so most of what you learn here will apply to any type of smart device. By Jessy Catterwaul.

Leave a rating/review
Download materials
Save for later
Comments
Share

Who is this for?

This course is designed to introduce working with HomeKit in a targeted, practical way.

To get the most out of it, you'll want to be experienced with Swift, SwiftUI, and Combine. Some familiarity with watchOS will be useful, but you should be able to follow along even if you've never developed for that platform.

HomeKit works similarly across iOS and tvOS as well, so you don't even need to be interested in watchOS development for this course to be useful!

Covered concepts

  • HomeKit
  • HMHomeManager
  • HMRoom
  • HMAccessory
  • HMService
  • HMCharacteristic
  • watchOS
  • SwiftUI Slider
  • Combine

Part 1: Smart Lighting with HomeKit in watchOS

01
HomeKit 2:56
Toggle description

HomeKit allows your apps to configure, monitor and control a synchronized central repository of smart home accessories with Apple devices.

Toggle description

HMHomeManager provides access to all the HMRooms you'll need, encapsulated in HMHomes, by way of its delegate.

HMService 3:39
Toggle description

HMAccessory is how HomeKit models a physical device, and HMService is a collection of related things you can do with that device.

Toggle description

On watchOS, you can either tap to interact with SwiftUI sliders, or use the Digital Crown. Bulb Buddy uses a slider for hue, saturation, and brightness.

Toggle description

Check an HMCharacteristic's metadata format to ensure you're working with the right kind of values. Throttle sending those values using Combine, if necessary.