Analyze images with AI triggered by motion detection events from SoraCam and notify the situation via chat.
Overview
In this app template, event information detected by the motion detection function of the IoT camera “ATOM Cam” compatible with Soracom Cloud Camera Services (hereafter SoraCam) is used, and when an event is detected by SORACOM Flux, a still image at the detection point is acquired and analyzed by AI, then the result is notified to a chat tool. This app is useful for:
The method for determining what to monitor or what constitutes an abnormality can be changed by configuring the prompt (instruction for AI) in the AI action. Whether to notify users can be set by specifying the execution conditions for the Slack notification action.
Example Notification in Chat
Chat notifications look like this:

Estimated Cost When Running the Flux App
The estimated cost for running the Flux app created from this template is as follows.
The explanation assumes SoraCam event detection (motion or sound detection) occurs once per hour.
This is an estimate and may vary depending on actual usage. For exact charges, please check the SORACOM flux plans and Billing Information. Please also refer to the user documentation Setting Quotas for Event Count and Credit Usage.
Prerequisites
Before deploying (executing) the app with this template, please prepare the following:
For details, refer to the SORACOM documentation Install a SoraCam-compatible camera (Add a camera) STEP 1 to STEP 4.

For details, see Slack documentation Sending messages using incoming webhooks.
This Flux app is also an app template version of the DIY IoT recipe SORACOM IoT Recipe: Detect and Notify Abnormalities with IoT Camera, so please also refer to the IoT recipe for more details. please tanslate from Japanese with your web browser translation feature enabled.
Creating the App
Customizing Settings
When creating the app, you can set the target SoraCam and the incoming webhook URL for the Slack channel to notify.
Actions to Take After Creating the App
The SoraCam Motion/Sound Detection event source is Disabled. Please manually test the app, and after confirming Slack notifications, set the event source to Enabled.

App Customization
By changing the wording of # Target to monitor in the prompt field of the AI action, you can change which targets for monitoring will change the output value. To configure whether to notify, change the number in payload.output.target >= 0 in the execution condition field of the Slack notification action. For example, by changing to payload.output.target > 0, you can configure it so that notifications are not sent when no monitoring target is detected.
Troubleshooting
If things do not work as expected, please check the app’s execution history. For details, see View Logs.