Guides

How to use Apple's Shortcuts app with AiCam for home automation

AiCam has some advanced features for automation like integration with Apple's Shortcuts app and sending Webhook request. In this guide I would like to explain how to use the Shortcuts app with AiCam to automate a workflow.

Download the Apple's Shortcuts app from App Store if it is not already on your device.

As its name, Apple's Shortcuts app allows you to set up shortcuts to trigger actions or series of actions on other applications. The shortcuts could be triggered manually (in Shortcuts tab) or automatically (in Automation tabs). With Shortcuts, you can trigger a few actions on AiCam, such as turn on and off the monitoring mode, open front / back camera or record video. You can set it to trigger automatically based on time (e.g. sunset daily) or location (e.g. when you are not at home).

Apple's Shortcuts app is a powerful app that lets us automate many things. If you have some smart devices in your home, combining AiCam with Shortcuts and Webhook requests will enable many automation scenarios.

This tutorial demonstrates two scenarios:

  1. Turn on/off monitoring mode or record video based on time or location
  2. Use password-protected Guided Access mode with Shortcuts to increase app stability

1. Turn on or off monitoring mode

Let's take a scenario for example: We only want AiCam to monitor our home when we are away. When we are at home, we do not want AiCam to record anything. We can achieve this by using Apple's Shortcuts app with AiCam actions. Go to the app's Automation tab, click + button, then follow the steps.

  • First add the trigger, which are given by the Shortcuts app, such as Time of Day, Arrive, Wi-Fi, etc.
  • Then add the action, which are given by AiCam app, such as Record Video, Turn ON Monitoring.

In order for Shortcuts app to know when we are at home or at work we can use a time trigger or location trigger. In the screenshot I choose to use the location trigger. But you can choose other options like time schedule or when your phone connected to home Wi-Fi network.


On the screenshot you can see 4 automations I did have for AiCam in the following order:

  1. At sunset every day AiCam will record a short video of the scene.
  2. When I arrive at home, set AiCam monitoring mode to OFF so that no video will be recorded.
  3. When I leave my home, set AiCam monitoring mode to ON so that AiCam will watch my living room and when an event is detected (e.g. human detected), then AiCam will record the video and send me push notification.
  4. When AiCam app is opened, the camera view will be started immediately to monitor for events

Note: If you use location trigger, then you should set location-based automations (like the number 2 and 3 above) on the main iPhone you use every day because the Shortcuts use the location of the device, with which this automation was set. But the action "Turn ON/OFF Monitoring" for AiCam is synced across all connected devices, so it will also control monitoring mode of the camera device.

2. Use password-protected Guided Access mode with Shortcuts to increase app stability


All iPhone and iPad devices have a mode called Guided Access. In the mode we can lock our phone with passcode and allow the use of only one app. This mode is very helpful if we want to avoid that other people will access other apps when we let AiCam running unattended.

In Guided Access mode if the app is running and crashes, it will automatically be reopened. Therefore, using Guided Access also increase app stability. But Guided Access can only reopen the app when it crashes, Guided Access cannot resume the last activity the app was doing. To fix that we combine Guided Access with Shortcuts automation feature.

The steps are:

  1. Open Automation tab of the Shortcuts app and add a new automation
  2. Select the trigger "App" > AiCam app > "Is Opened"
  3. Go to "Do" (or "Actions"), choose Apps > AiCam > Open Camera and select the capture device AiCam should use (back camera, front camera, etc.).
  4. Follow the guide to set up Guided Access mode for camera device.

In case an intruder breaks into our house, we do not want the intruder to be able to delete the recorded videos. After set up Guided Access mode with a passcode, we will also activate screen lock for our AiCam app:

  1. Open AiCam app
  2. Select Setting card
  3. Select Security menu and turn on "Protect screens" and all the screen we want to protect with a passcode.

With screen lock on we now assured that no one can delete record videos which are already uploaded to iCloud (assume you did not disable iCloud sync). Now we can let AiCam run in Guided Access mode and monitor our home for events.

Anh

A food lover and technology enthusiast