Profile management with light sensor

lane777smith

Getting the hang of it
Joined
May 11, 2022
Messages
149
Reaction score
78
Location
texas
I'm currently using the dahuasunrise/sunset tool to switch my Amcrest camera profiles between Night and Day based on time. This has been working great, but on days where it's rainy, I need them to stay on the Night profile longer in the morning because it's not as bright outside. Is there a way of triggering the Profiles to change based on the amount of light at any given time using an off camera light sensor?
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,792
Reaction score
39,076
Location
Alabama
I do not use the dahua sunrise/sunset tool, but these URLs work on a Dahua-rebranded Amcrest IP2M-841. Config and modify to suit your need:

This command forces night mode:
Code:
http://username:password@camera-IP/cgi-bin/configManager.cgi?action=setConfig&VideoInDayNight[0][0].Mode=BlackWhite
This command forces Day/Night Auto mode:
Code:
http://username:password@camera-IP/cgi-bin/configManager.cgi?action=setConfig&VideoInDayNight[0][0].Mode=Brightness
I guess you could get the HTTP command into the cam via a Shelly1 WiFi switch among other methods. The Shelly can respond to an input from a photocell, photodiode, etc. and issue a HTTP command to the camera. See my write up for more info ==>> Simple Blue Iris I/O using Shelly1 Wi-Fi Devices

You could use something like this to provide input to the Shelly1 ==>> HiLetgo 2pcs 12V Photoresistor Sensor Relay Module Car Light Automatic Control Switch with Cable

Both the Shelly1 and the Light sensor relay can operate on 12VDC.
_

HTTP-0.jpg
 
Last edited:
As an Amazon Associate IPCamTalk earns from qualifying purchases.

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
772
Reaction score
1,672
Location
Palos Verdes
I'm currently using the dahua sunrise/sunset tool to switch my Amcrest camera profiles between Night and Day based on time. This has been working great, but on days where it's rainy, I need them to stay on the Night profile longer in the morning because it's not as bright outside. Is there a way of triggering the Profiles to change based on the amount of light at any given time using an off camera light sensor?
I'm trying DahuaSunriseSunset tool out now, and it seems to work with my Amcrest IP5M-T1179E units, or at least with these two that I'm trying out today. My thoughts:
  1. Thanks, @bp2008! It's excellent to have a tool to override the bugginess in these cameras' UIs.
    1. Wow, these cameras' UIs are incredibly buggy/incomplete/inconsistent:
      1. Camera: Profile Management: Day/Night does not appear in the Amcrest Surveillance Pro app, neither the Windows version nor the macOS version.
        1. It appears only in the browser UI.
        2. If I select that radio in the browser UI, and then look at Profile Management for that camera in the app, none of the radios is selected.
        3. IME a vendor's app is usually the "go to" for full, complete, and reliable hardware control/config, and the web UI is some sort of partial implementation of that. This appears to be the inverse.
        4. Same for firmware upgrades; it must be done from the browser, not the app.
      2. The whole Amcrest profile management appears to be really, really buggy.
        1. In the browser, Configuration, selecting a profile from the drop-down menu immediately applies that profile to the camera, even before I click Save.
        2. That seems completely wrong, unless I'm mis-understanding how a profile works. e.g. I would think that I'm selecting a profile to edit, but that the Profile Management tab controls when that profile actually gets applied. It should not even change the camera's current settings unless I'm editing/saving the profile that's currently being applied by Profile Management.
        3. The app appears to work that way. Except that it's even buggier.
          1. In the app, I would expect that clicking between Configuration and Profile Management would never lead to the loss of information or settings, e.g. I should be able to make a setting in Profile Management, click over to Configuration without clicking Save/Apply, and then come back to Profile Management and see the same settings that I just entered 5 seconds ago.
          2. This is not the case, or at least not consistently.
        4. I keep finding that setting that I thought I'd entered have to be re-entered constantly, and I need to Save/Apply before I click over to Configuration.
          1. Sometimes, settings that I never even touched get edited.
          2. I spent 20 minutes trying to figure out why my Day profile was completely black, other than the overlaid time/date stamp, until I realized that all the Picture sliders had been set to 0.
    2. Profile Management in the app has "Attendance Shifts" as the 3rd radio, while the browser labels is "Schedule."
      1. Yeah, most people will figure out that these mean the same thing, but consistency would be nice.
    3. Browser UI has a Reset [to] Defaults button on the Configuration page, but the app does not. That would have saved me lot of headache when my sliders unknowingly all got set to 0.
    4. Throughout the entire UI, Dahua/Amcrest use "Open/Close" instead of "On/Off" for boolean settings.
      1. I'm 99.99% sure this is because they're the same word in Chinese (kai/guan), but if you're gonna do an English UI, hire someone to help with the translation.
      2. It's especially confusing when the setting is something like a filter. If a filter setting is "Open," what does that mean?
  2. Anyhoo, now that I've "found" the Day/Night setting in the browser UI, maybe I don't need the dahua sunrise/sunset tool.
    1. But maybe I do.
    2. It'll take a me few days of testing to figure out whether Day/Night in Profile Management actually works or not.
    3. Is there a way to read/detect the shutter settings from the camera stream?
      1. I'd like to find out what the settings are for a given camera, without opening the UI in either the browser or the app, because they're both so buggy and liable to change settings when I don't want them to.
      2. Can I get that setting from an HTTP request?
  3. If bp2008 (or anyone else) is actively working on DahuaSunriseSunset tool, here are some suggestions/feature requests:
    1. Add a "Copy Camera" button in Configuration, as I suspect a lot of us have a fleet of cameras with the same user/pass that differ only by the last digit of their IPs.
    2. And/or add a list of common credentials to choose from when adding a camera.
    3. Maybe add a "scan subnet" to query for Dahua/Amcrest cameras.
    4. Add an "Ok/Cancel" buttons to the Add/Edit camera dialog, as clicking an "X" to close a dialog typically implies closing without saving.
      1. For example if one clicks Add Camera and then "X", a camera appears in the list at 127.0.0.1, e.g. the default entry.
      2. So if one clicks Add Camera accidentally, one must then Deelete it, as there's no way to exit the dialog without adding the camera.
    5. Add an "Auto-detect Lat/Long" button, as modern browsers can report this.
Sorry if this turned into an Amcrest rant!

Thanks again to bp2008!
 

Attachments

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
772
Reaction score
1,672
Location
Palos Verdes
Is there a way to read/detect the shutter settings from the camera stream?
Hmm. I'm reading through the Amcrest API, and I was able to curl some of the settings:

Code:
curl -o out.txt --digest --user <user>:<password> -O "http://192.168.1.51/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions" && grep "ExposureValue" out.txt
But I get the same answer whether my camera is set to Day (Auto) or to Night (Shutter: 1/120):

Code:
table.VideoInOptions[0].ExposureValue1=4
table.VideoInOptions[0].ExposureValue2=4
table.VideoInOptions[0].NightOptions.ExposureValue1=8.330000
table.VideoInOptions[0].NightOptions.ExposureValue2=8.330000
table.VideoInOptions[0].NightOptions.TemporaryConfigs.ExposureValue1=0.100000
table.VideoInOptions[0].NightOptions.TemporaryConfigs.ExposureValue2=80
table.VideoInOptions[0].NormalOptions.ExposureValue1=4
table.VideoInOptions[0].NormalOptions.ExposureValue2=4
table.VideoInOptions[0].NormalOptions.TemporaryConfigs.ExposureValue1=0.100000
table.VideoInOptions[0].NormalOptions.TemporaryConfigs.ExposureValue2=80
table.VideoInOptions[0].Snapshot.ExposureValue1=33.330000
table.VideoInOptions[0].Snapshot.ExposureValue2=33.330000
table.VideoInOptions[0].TemporaryConfigs.ExposureValue1=0.100000
table.VideoInOptions[0].TemporaryConfigs.ExposureValue2=80
That value of 8.330000 sure looks like 1/120 in milliseconds.

So this tells me what I've programmed in for each of the profiles, but I can't figure out how to get what's currently being applied. Anyone here know the API?
 
Top