Multi step automation

How can i achieve multi step automation with homekit? For example: 1. If cameras detect motion, turn on the outdoor light. 2. Wait 5 mins, turn off outdoor lights. Any way to achieve this with homekit automation? Thanks!

Replies

Might want to review this from the docs, first:


https://developer.apple.com/documentation/homekit

Home Configuration

HomeKit views a home as a collection of home automation accessories. The purpose of having a home configuration is to allow the end user to provide meaningful labels and groupings to the home automation accessories they have purchased and installed. Apps can provide suggestions to help the user create useful labels and groupings, but should not impose their own preferences on the users—the user’s wishes are most important.

The basic data containment hierarchy looks like this:

  • Homes (
    HMHome
    ) are the top level container, and represent a structure that a user would generally consider to be a single home. Users might have multiple homes that are far apart, such as a primary home and a vacation home. Or they might have two homes that are close together, but that they consider different homes—for example, a main home and a guest cottage on the same property.
  • Rooms (
    HMRoom
    ) are optional parts of homes, and represent individual rooms in the home. Rooms don’t have any physical characteristics—size, location, etc. They’re simply names that are meaningful to the user, such as “living room” or “kitchen”. Meaningful room names enable commands like, “Siri, turn on the kitchen lights.”
  • Accessories (
    HMAccessory
    ) are installed into homes and assigned to rooms. These are the actual physical home automation devices, such as a garage door opener. If the user doesn’t configure any rooms, HomeKit assigns accessories to a special default room for the home.
  • Services (
    HMService
    ) are the actual services provided by an accessory. Accessories have both user-controllable services, like a light, and services that are for their own use, like a firmware update service. HomeKit is most concerned with user-controllable services. A single accessory may have more than one user-controllable service. For example, most garage door openers have a service for opening and closing the door, and another service for the light on the garage door opener.
  • Zones (
    HMZone
    ) are optional groupings of rooms in a home; for example, “upstairs” and “downstairs” would be represented by zones. Zones are completely optional—rooms don’t need to be in a zone. By adding rooms to a zone, the user is able to give commands to Siri such as, “Siri, turn on all of the lights downstairs.”

Since iOS 11, an event trigger can have end events, which reverses trigger actions.

So for example if an event trigger turns on a light, you can specify a countdown (e.g. 5 minutes) as an end event.