Setting up a simple automation is quick and can easily be done using the Apple Home app. However, at some point, when you want to create more complex automations, you will quickly run into limitations within Apple’s own app. With Controller for HomeKit, you have the opportunity to use more triggers, execute automations only on specific weekdays, and define your own conditions. We’ll show you step by step what possibilities exist and how to make the most of them.
In this guide, we’ll walk you through an example where the lights should be turned on depending on two motion sensors. You can find more examples at the end of the post.
Creating an Automation
When you create a new automation under “Automations” using the plus button in the upper right corner, you must first give the automation a name. This ensures clarity and helps, especially when you have many automations in use.

Events
After that, you need to decide whether you want to create an “event-based” or “time-based” automation. Note that this setting cannot be changed later. If you still want to change the type, you’ll need to create a new automation.

Event-Based Automations
You should opt for an event-based automation if it is not supposed to be executed on a specific date or within a defined interval. Instead, with event-based automations, you have the option to use the state change of a device, a specific time, the relative position of the sun, the presence of one or more persons, the current location, or the proximity to an iBeacon as events.
Since in our example, we want to turn on the light as soon as one of the two motion sensors triggers, we opt for the event-based automation.

Time-Based Automations
Time-based automations are the way to go when the automation is supposed to be executed on a specific date at a set time. You also have the option here to set an interval, such as every five minutes, nine days, or two weeks, where you can define the values freely, of course.
An example would be New Year’s Eve. Here, during the party preparations, you can plan the right lighting for midnight.
Note: The first start date must be within the next five weeks.

Multiple Events for an Automation
Sometimes you might want to activate the same scene through different events, like in our example of turning on the light via two motion sensors. With Controller for HomeKit, this is not a problem. Once you’ve defined the first event, you can add additional starting events. Logically, this is an “OR” operation. As soon as one of the events occurs, the automation is executed.
Note: This feature is only available in event-based automations.

Conditions
With conditions, you can further narrow down the execution. The emphasis here is entirely on “can,” because unlike the start event and the scene to be executed in the end, conditions are optional.
Note: Conditions are available in event-based automations but not in time-based automations.
Weekdays
First of all, you can restrict the days of the week. For example, if you want the light to be turned on at detected motion only on weekdays at full brightness and to function as a night light with low brightness on weekends, you can create two separate automations and restrict the weekdays accordingly.

Device, Time, Altitude of the Sun, or Presence
A condition can be the state of a device, a defined time window, the position of the sun (between sunset and sunrise, for instance), or the presence of people.
In our example, a condition could be the light turning on only if a certain brightness threshold is exceeded. In that case, the light would only be turned on when natural daylight is insufficient.

You also have the option to add multiple conditions. You can choose whether all conditions must be met or only one.
Note: This setting doesn’t affect the weekdays. They must always be met.

Scenes
When an event occurs and the conditions are met, one or more scenes are executed. You can either select an existing scene or create a new one. Within this scene, you can control any devices you want. In our example, of course, the light should be turned on in the scene.
You can add any adjustable property to the scene and set the desired state. In our case, we turn on the lamp and set the brightness to 100%. When the scene is executed, the specified properties are set to the corresponding values. All other values remain untouched and reflect the last set value. If you want the color to always be the same, instead of the last set color, you should also define this value. With “Execute” you can test the scene before saving it.

Automatically Turn Off the Scene
You have the option to automatically turn off scenes that include the “Power State” after a defined duration. You can simply set a time span under “Turn Off.” In our example, the light will be automatically turned off after two minutes.
Note: This option is only available for scenes that turn on at least one “Power State.” The automatic turn-off only resets this switch to “off”. Other properties are not reset, and the power will not be turned on if the switch is turned off instead of on in the scene.

Activate the Automation
Remember to activate the automation by using the “Activate Automation” switch at the bottom. If this switch is not active, the automation will not be executed.

Execute the Automation Only Once
If you want to execute an automation only once, you can turn on the “Deactivate after Execution” switch. As the name suggests, after the first execution, the automation will be automatically disabled, and the automation will thus be executed only once.

Examples
To make it easier for you to get started with the world of complex automations, we’d like to provide you with a few more examples.
Turning on the Fan Based on Motion and High Temperatures
In the summer, when temperatures rise, a cool breeze is invaluable. In a HomeKit-enabled home, the fan can be automatically turned on using a motion and temperature sensor thanks to Controller for HomeKit. All you need is an automation that we’ll walk you through step by step.
Open Controller for HomeKit, go to “Automations,” and create a new automation using the plus button in the upper-right corner. Then give it a name like “Turn On Fan” and select an event-based automation.

For the start event, select the motion or presence detector, specifically, when the value of “Motion Detected” corresponds to “Yes.”

Next, add temperature as a condition. To do that, select the temperature sensor with the current temperature “greater than or equal to” the desired temperature. We’ve chosen a value of 24°C, roughly equivalent to 75°F.

Now all you need to do is add a scene that turns on the fan. If such a scene already exists, you can simply select it. Otherwise, create a new scene that turns on the “Power State” of your fan.

Remember to enable your automation using the “Enable Automation” switch at the bottom. Your automation should look like this in the end.

Leave a Reply