Skip to content

threshold night and day #1970

Description

@zz64

Did you read the guide?

Yes

What is the base version number of Motion being used?

4.7.x

What was the install method?

Installed via package tool

What is base architecture?

x86/x64

What is the distro being used?

Debian

Disto version number

4.7.0-3 trixie

Camera/Sound type(s) being used?

Network camera with RTSP

Describe the issue/problem and steps to reproduce

Hi,
I am using Motion with an RTSP camera and I need to dynamically adjust the threshold based on whether it is day or night. Currently, I must manually change the threshold (e.g., 1000 for day, 6000 for night), which is highly impractical. Is there an existing or planned parameter, perhaps like threshold_tune or a time-based switch, that would allow Motion to automatically switch between different threshold values based on ambient light or time of day?

if no solution,
To streamline operation, I propose a feature allowing for multiple configuration profiles or mode switching within Motion. Instead of just a single threshold, could there be a parameter that allows the user to define threshold_day and threshold_night? The application could then use a built-in logic check (based on time or light intensity) to select the appropriate threshold dynamically.

Thanks.

camera_name Face
camera_id 108
netcam_url rtsp://admin:@192.168.1.8:554/SubStream
width 640
height 480
framerate 25
netcam_params rtsp_transport=tcp
text_left Face
emulate_motion off
threshold 1000 # Day
#threshold 6000 # Night
noise_level 64
noise_tune off
threshold_tune off
smart_mask_speed 7
despeckle_filter EedDl
minimum_motion_frames 5
event_gap 30
movie_output off
picture_output first
post_capture 6
picture_quality 100
picture_filename Face_%t-%v-%Y-%m-%d-%H_%M_%S
on_picture_save /etc/motion/script/start_proc.sh %t %C %f
on_event_end /etc/motion/script/end_proc.sh %t %C

Relevant Motion log output (at log_level 8)

[1:ml1:Face] [NTC] [EVT] [août 09 16:05:32] event_newfile: Écriture de l'image dans le fichier : /mnt/cam/Motion/Face_201-10-2026-08-09-16_05_32.jpg
[1:ml1:Face] [NTC] [ALL] [août 09 16:06:03] mlp_actions: Fin de l'événement 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions