Shortcut page with multiple If parameters.

Premise

I recently upgraded my smart home setup, combining Philips Hue light bulbs with some Aqara FP2 millimeter-wave presence sensors. These sensors not only provide presence detection without the use of cameras, but they also have a built-in light sensors. One FP2 sensor can cover a room of up to 40 m² (ca. 430 sq ft) and can be configured to create multiple zones, each capable of triggering distinct automations.

For instance, in my open-plan kitchen area, I’ve defined various zones such as the kitchen, piano area, dining table, desk, couch, etc.

Challenge

My specific challenge was to ensure that the lights at my desk turned on only when I was both at my desk and when the ambient light levels were below a certain threshold. Since I live in Sweden where daylight varies significantly, making it a time dependant Automation wouldn’t work. Thankfully Apple Home allows you to add If parameters.

Solution

  1. Open the Home app and select + on the top right corner. Then choose Add Automation from the top down menu
  2. Select the Event that will trigger the automation.
  3. Select the relevant Zone and click Next
  4. Select the relevant occupancy setting (whether you want the automation to be triggered when occupancy is detected or is stop being detected) and click Next.
  5. On the Select scenes and accessories to automate screen, scroll down and select Convert To Shortcut.
  6. Click on the Search for apps and actions field and type in If
  7. Tap on the If scripting
  8. Click on Input and select Select Accessory
  9. Select the light sensor and then Done
  10. Click on Condition and select the relevant one
  11. Add the relevant value on the value field. On my example I set “50” lux. Then click on Set Scenes and Accessories
  12. Select the relevant light and click Next
  13. Select the status of the light (On/Off) by clicking on it and then tap on Done.
  14. Slide the “Set” below the “If” tile and select Next.
  15. Select Done

By following these steps, you can ensure that your smart lights respond intelligently to both your presence and the ambient lighting conditions. For a visual guide with images, you can refer to the step-by-step instructions below

While on the Home app, select the + on the top right and click Add Automation
While on the Home app, select + on the top right corner and click Add Automation
Select A Sensor Detects Something
Select A Sensor Detects Something
Select the relevant zone and click Next
Select the relevant zone and click Next
Select the relevant occupancy setting and click Next
Select the relevant occupancy setting and click Next
Scroll down and select Convert To Shortcut
Scroll down and select Convert To Shortcut
Click on the Search for apps and actions field
Click on the Search for apps and actions field
Type IF and select the If Scripting
Type IF and select the If Scripting
Click on the Input and select Select Accessory
Click on Input and select Select Accessory
Select the light sensor and then Done
Select the light sensor and then Done
Click on Condition and select the relevant one
Click on Condition and select the relevant one
Add the relevant value. On my example '50' and then click on Set Scenes and Accessories
Add the relevant value. On my example ‘50‘ and then click on Set Scenes and Accessories
Select the relevant light and click Next
Select the relevant light and click Next
Select the status of the light by clicking on it and then click Done.
Select the status of the light by clicking on it and then click Done.
Slide the "Set" tile below the "If" tile and select Next.
Slide the “Set” tile below the “If” tile and select Next.
Select Done
Select Done

Leave a Reply

Your email address will not be published. Required fields are marked *