automatic control of black/white and IR

Any results yet?

Yes: I have experienced the same results as your screenshots. But I'm not certain what this means. I don't know how to test to determine if this method is placing the camera into a mode where the camera switches profiles based upon the light levels which it detects.
 
Looking into this a little further...

head.NightOptions.SwitchMode integer Range is {0,1,2}
  • 0: NoSwitch,always use day options;
  • 1: Switch depends on brightness;
  • 2: Switch depends on time, switch to NightOptions when time is after sunset time and before sunrise.
  • 3: NoSwitch,always use NightOptions;
  • 4:No switch,always use NormalOptions.
head.NightOptions.Profile integer Range is {0,1,2,3}
  • 0: use temporary day options;
  • 1: use temporary NightOptions;
  • 2: use temporary NormalOptions;
  • 3:depends on head.NightOptions.SwitchMode.
As two (2) distinct commands:
As a single concatenated command:
I'm Qonfused, does this command retrieve the current configuration from the camera?...
 
Last edited:
  • Like
Reactions: icecoffee
I'm Qonfused, does this command retrieve the current configuration from the camera?...

According to the Amcrest API page 50 section 4.5.13, that command will give you the video input capability. From my understanding is it show what function available for that cameras rather than the setting for it.

I think this command will show the current configuration for the camera

Code:
http://192.168.33.203:80/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions
 
I think this command will show the current configuration for the camera

Gracias! I ran your command and it returned mucho strings of data which I shall inspect later this evening. But what about the current shutter setting (Settings > Conditions > Exposure > Shutter)...where is the shutter speed?
 
Gracias! I ran your command and it returned mucho strings of data which I shall inspect later this evening. But what about the current shutter setting (Settings > Conditions > Exposure > Shutter)...where is the shutter speed?

I guess it is in the top of the result list (line 17 or 18 down) where it shows

for Day profile

table.VideoInOptions[0].ExposureSpeed=...
table.VideoInOptions[0].ExposureValue1=...
table.VideoInOptions[0].ExposureValue2=...

for night profile a little further down

table.VideoInOptions[0].NightOptions.ExposureSpeed=...
table.VideoInOptions[0].NightOptions.ExposureValue1=...
table.VideoInOptions[0].NightOptions.ExposureValue2=...

I'm still learning those API too
 
@icecoffee These API calls aren’t documented very well. Is there any documentation available which describes them in better detail?
 
" data-source="post: 328820" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch">
@icecoffee These API calls aren’t documented very well. Is there any documentation available which describes them in better detail?
I don't. I just follow the one from Amcrest that someone posted last night. Going through those number with my camera setting.
 
I think this command will show the current configuration for the camera

Code:
http://192.168.33.203:80/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions

So the zbove url queries the camera which returns the current camera configuration settings.

But how do we get the settings under which the camera is presently running?

In other words, this url returns the current day and current night settings...but how do I determine which mode (day or night) the camera is presently running?
 
how do I determine which mode (day or night) the camera is presently running?

Try this
http://{ip&port}/cgi-bin/configManager.cgi?action=getConfig&name=VideoInMode[0].Config[0]

Should return
table.VideoInMode[0].Config[0]=X
where X = 0|1|2 = Day|Night|Normal
 
  • Like
Reactions: Q™
" data-source="post: 328832" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch">
So the zbove url queries the camera which returns the current camera configuration settings.

But how do we get the settings under which the camera is presently running?

In other words, this url returns the current day and current night settings...but how do I determine which mode (day or night) the camera is presently running?

Good question @Q , I don't know if there is a command to give you that info directly.

On top of my head, base on this command result, you have 2 ways to determine which mode and it exposure being running.

1. If you switch profile base on time schedule, there are sunrise/sunset hour, minute that you set. Compare that with the current time and you will know which profile is being run then the exposure value.

2. Set the camera to run 1 profile full time. Then you will always know what profile is being run.
 
Is the red arrow is the location of the sensor that measures ambient brightness? (this is a DH-IPC-HDW2231R-ZS).

I assumed it was and tried the following:
  1. With VideoInOptions[0].NightOptions.Profile=3, changing NightOptions.SwitchMode=0 to NightOptions.SwitchMode=1
  2. placing black electrical tape over the sensor.
It was daytime when I tried this. My theory was that 1 & 2 it would cause the camera to switch modes from Day to Night. It did not.


2231R-ZS Sensor.png
 
  • Like
Reactions: Q™
IIRC, at least with the 5231, the ability for the camera to automatically switch between day/night mode based on ambient light was added in the 20180523 firmware version but removed from firmware versions after that.

Thread: 20180523 Firmware for DH_IPC-HX5X3X-Rhea

Guess on my part, but if a camera's WebUI doesn't show a Day/Night option on the Profile Management screen like below (on the 20180523 firmware), it won't automatically switch based on ambient light even if the API can be used to enable that feature.

Screen Shot 2019-01-18 at 11.48.47 AM.png
 
Good catch. Thx! ... I suppose Dahua could have removed the control from the WebUI and left it accessible from the API. But we appear to have verified that this is not the case.

Btw, I have looked through the API for a command to read the sensor’s brightness level. No luck so far.
 
  • Like
Reactions: Q™ and aristobrat
Btw, I have looked through the API for a command to read the sensor’s brightness level. No luck so far.
If you ever find a way to make that work, if you could give me a shout, I'd appreciate it. I've got another home project where that would help out!
 
This from IPC/Camera Configuration - Dahua Wiki...

Profile Management tab
  • Normal which applies the day and night settings automatically
  • Full time which lets you choose day or night time.
  • Schedule which you can set day and night on the camera by time.
profile-mgt.png
 
Guess on my part, but if a camera's WebUI doesn't show a Day/Night option on the Profile Management screen like below (on the 20180523 firmware), it won't automatically switch based on ambient light even if the API can be used to enable that feature.

There's may be a bit more to it I fear.

The API call which @jaydeel documented in post #7 MAY set the camera to a state whereas the camera automatically detects light level and switches to either day or night mode dependent on the detected light level...but I would need to test such a state to prove to myself this functionality was working. To do this I'd need to set the camera to separate shutter speeds, such as these...
  • Day shutter speed: 1/120
  • Night shutter speed: 1/30
...then -- to test the different states -- I would need to determine the current shutter speed when there is next to no light, and test the camera again to determine the current running shutter speed when there is plenty of light present.

And I'm not certain how to determine the camera's current shutter speed.
 
to test the different states -- I would need to determine the current shutter speed when there is next to no light, and test the camera again to determine the current running shutter speed when there is plenty of light present.

Or any other ‘Conditions’ property that is Profile-specific — e.g. any Backlight mode (BLC, WDR, HLC), Noise Reduction, and so on... in fact, I used the WDR mode in my experiment in post #33, precisely because I was already querying its current state via an API command...

I did take a quick look at API v1.67 to determine if the current shutter speed setting is accessible via the API. Perhaps this one... VideoInOptions[0].NightOptions.ExposureSpeed. I’ve done no testing.
 
  • Like
Reactions: Q™
Or any other ‘Conditions’ property that is Profile-specific — e.g. any Backlight mode (BLC, WDR, HLC), Noise Reduction, and so on....

Yes...exactly!

in fact, I used the WDR mode in my experiment in post #33, precisely because I was already querying its current state via an API command...

What API command did you use to query the camera's present state?