[Free]DjMotionDetect

This extension uses the Camera to detect motion within the CameraPreview. A threshold can be used to set the sensibility of Detection. When a motion is detected it triggers an event, where you can set a Alarm sound for example like in the test aia. You can also trigger to take a picture automaticly. The Images are stored in the Documents folder. Have fun!
[Edit} Updated.

DjMotionDetect

A motion sensor using the device camera

Events:

MovementDetected

MovementDetectedBlock
Triggered when movement is detected

PictureTaken

PictureTakenBlock
Triggered when a picture is taken

Parameter Type
filePath text

Methods:

SetupPreview

SetupPreviewBlock
Sets up the camera preview inside a given arrangement

Parameter Type
arrangement component

SetCamera

SetCameraBlock
Sets the camera to use. Use 'front' or 'back'

Parameter Type
cameraFacing text

StartDetection

StartDetectionBlock
Starts motion detection

StopDetection

StopDetectionBlock
Stops motion detection

TakePicture

TakePictureBlock
Takes a screenshot of the camera preview and saves it to the specified path with timestamp

Parameter Type
directoryPath text

Properties:

SetMotionThreshold

SetMotionThresholdBlock
Set the motion detection threshold. 0-100

This documentation was generated using Akshat Developer's Documentation Generator.

DjMotionDetect.aia (59.7 KB)

com.django.djmotiondetect.aix (15.4 KB)

*** Tip for the Test Aia : When you switch to "photo" 2 Images/sec will be taken
and stored in your /Documents folder. Dont forget to stop detection when there
is heavy motion! ***

3 Likes

Tested your aia.

Unable to switch cameras ? Just get "selfie" camera (in notch on screen) - is this front or back ?
Tried several things but no change.

Motion detection works fine.

Companion app, Pixel 8a Android 15

[EDIT]

Got the "back" camera to come up using these blocks

image

but when starting motion detection the alarm sounds when there is no movement!

not able to switch cameras, probably need to reset the preview...

And what is OpenCamera for, it already opens with SetupPreview ?

Thanks for your suggestions! I made a quick fix, removed "OpenCamera" as it wasnt needed anymore. I did some fix on the camera switch issue. Hope it works now for you. Updated first post.

1 Like

Seems to be much better now, camera switching OK.

1 Like