Soracom

IoT Template Gallery

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:

  • AI judges the situation without visually checking the situation detected by motion
  • Automatically excludes motion detections that are not subjects for monitoring (false positives)
  • AI determines whether the situation is an abnormality to be monitored, and verbalizes or structures the data
  • Notify users as needed

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.

  • In this Flux app, the event count is 24 times per day, and with 31 days of operation per month, the total event count is 744.
  • With the SORACOM Flux Developer plan, up to 10,000 events per account per month are available free of charge. If you exceed 10,000 events/month, a charge of 0.11 yen per event will apply.
  • In this Flux app, the AI action is executed 24 times per day, and since the AI model “Azure OpenAI (GPT-4.1-nano)” uses 4 credits per execution, 96 credits are used per day. With 31 days of operation per month, 2,976 credits are used.
  • With the SORACOM Flux Developer plan, up to 1,500 credits per account per month are available free of charge. If you exceed 1,500 credits/month, a charge of 0.044 yen per credit will apply.
  • The event and credit limits are initially set to the same as the free bundle. If the limit is reached, the app will no longer launch or execute actions triggered by events. If you want to use more, please update the upper limit in advance. If you set a limit that exceeds the monthly bundle, excess events or credits will be billed on a pay-as-you-go basis.

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:

  • SoraCam setup: Install SoraCam, assign a license, and confirm the device ID.

For details, refer to the SORACOM documentation Install a SoraCam-compatible camera (Add a camera) STEP 1 to STEP 4.

  • Slack notification destination settings: Obtain the incoming webhook URL for the target Slack channel.

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.

Try this template in the User Console