Worlds First Review - Dahua DH-IPC-HDW5849H-ASE-LED / IPC-Color4K-T - 2.8mm Turret

Interesting. Let me try those.

Did the two cameras that this API worked for using the new GUI or the old GUI?
IPC-Color4K-B180 (PFW-5849-A180-E2-ASTE) also use web5.0
 
  • Like
Reactions: sebastiantombs
Oh I am getting close now. I got the API to execute to turn the image color to B/W!

Now to find the right combination for the profile!
 
DRUM ROLL.........

With help from above, I have figured out the APIs to change profiles for this camera!!!!!

Here is the API to go to Night profile :

Code:
http://USER:PW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=3&VideoInOptions[].NightOptions.DayNightColor=0



Here is the API to go to Day profile :

Code:
http://USER:PW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=0&VideoInOptions[].NightOptions.DayNightColor=0


This code will overwrite the schedules in the GUI - when you run the night API, it will change all the times and months to NIGHT and when you run the day profile, it will change all the schedules in the GUI to DAY.

So we cannot use the standalone sunrise/sunset utility, but fortunately @bp2008 provided updated instructions in that thread on how to make it happen in BI, we just need to change the API in his instructions to this one.

 
Last edited:
So we cannot use the standalone sunrise/sunset utility, but fortunately @bp2008 provided updated instructions in that thread on how to make it happen in BI, we just need to change the API in his instructions to this one.
Or if you're using a home automation system you can configure it to make multiple API calls at the same time. The rules below are using Hubitat to change the mode, focus & zoom, frame rate and bit rate between day and night on my LPR camera. I have similar rules for my other cameras as well and it works great.
Screen Shot 2022-10-20 at 8.11.26 PM.png

Screen Shot 2022-10-20 at 8.12.11 PM.png
 
Last edited:
The rules below are using Hubitat to change the mode, focus & zoom, frame rate and bit rate between day and night on my LPR camera.

When I was running the cameras and Hubitat on the same network using Hubitat to make Dahua API calls that system worked fine. Had to add a little delay so that the hub would process correctly or it would sometimes be creative and skip a few calls.

When a second NIC was added to the computer to separate the internet from the cameras there was no longer an easy way to get Hubitat to work in that scenario. If you know of a way to make that happen and will still retain 100% internet isolation let me know. Thus went back to using the BI sunset/rise utility that is more limited, but works for my needs.
 
Had to add a little delay so that the hub would process correctly or it would sometimes be creative and skip a few calls.
I've seen the same thing that's why I have a 5 sec delay between calls.

If you know of a way to make that happen and will still retain 100% internet isolation let me know.
The only thing I can think of is adding a separate Hubitat hub to your camera network. You could basically accomplish the same thing with a RPi running Home Assistant.
 
The only thing I can think of is adding a separate Hubitat hub to your camera network. You could basically accomplish the same thing with a RPi running Home Assistant.

Yes, moved the Hub to the sub net (2nd NIC) as a try in July. Without a router on the sub network the Hub would not work. Could not even change the Hub IP address. Posted the issue on the Hubitat forum and the conclusion was it can not be done. Thus using the BI utility which works fine.

Would rather not add another computer to the system. Just one more device to take care of plus additional power consumption. Appreciate the suggestions....
 
DRUM ROLL.........

With help from above, I have figured out the APIs to change profiles for this camera!!!!!

Here is the API to go to Night profile (no spaces between USER : PW) and should all be one line

: PW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=0&VideoInOptions[].NightOptions.DayNightColor=0"

Here is the API to go to Day profile (no spaces between USER : PW)

: PW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=3&VideoInOptions[].NightOptions.DayNightColor=0



So we cannot use the standalone sunrise/sunset utility, but fortunately @bp2008 provided updated instructions in that thread on how to make it happen in BI, we just need to change the API in his instructions to this one.

So the only difference between day and night is the " at the end of the string?
 
  • Like
Reactions: sebastiantombs
It's in the "SwitchMode" part of the statement kind of toward the end.
 
  • Like
Reactions: looney2ns
So the only difference between day and night is the " at the end of the string?

The " was just trying to get it to show without the hyperlinks and stuff, but it is in the middle of the string where a 3 changes to 0.

I will correct that post if I can figure out how to get it to show as just text LOL
 
  • Like
Reactions: sebastiantombs
Just ran tests and it works fine here! One problem solved. Thanks Wittaj!!!
 
  • Like
Reactions: looney2ns
Insert as CODE.

Code:
http://admin:pass@192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=0&VideoInOptions[].NightOptions.DayNightColor=0

Sweet I learned something new! I have revised the previous post to use CODE
 
  • Like
Reactions: sebastiantombs
I've never played with presets for a PTZ, no PTZ here. I was surprised I got it working that easily. If "SwitchMode=0" is night mode and "SwitchMode=3" is day mode what is "SwitchMode=2"? I guess some additional testing is in order to figure out which "SwitchMode" yields which profile.