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

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,028
Reaction score
48,794
Location
USA
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!
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,028
Reaction score
48,794
Location
USA
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:

Vettester

Getting comfortable
Joined
Feb 5, 2017
Messages
743
Reaction score
698
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:

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
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.
 

Vettester

Getting comfortable
Joined
Feb 5, 2017
Messages
743
Reaction score
698
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.
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
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....
 

looney2ns

IPCT Contributor
Joined
Sep 25, 2016
Messages
15,634
Reaction score
22,891
Location
Evansville, In. USA
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?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,028
Reaction score
48,794
Location
USA
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
 

looney2ns

IPCT Contributor
Joined
Sep 25, 2016
Messages
15,634
Reaction score
22,891
Location
Evansville, In. USA
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
 

looney2ns

IPCT Contributor
Joined
Sep 25, 2016
Messages
15,634
Reaction score
22,891
Location
Evansville, In. USA
Just ran tests and it works fine here! One problem solved. Thanks Wittaj!!!
No joy here, I'm sure I've screwed up something. But then again, I have not done an additional 42 factory defaults yet. :)
After my last series of defaults, now for the first time, Time is off by 2 hrs, and it's all setup correctly.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,028
Reaction score
48,794
Location
USA
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
 

sebastiantombs

Known around here
Joined
Dec 28, 2019
Messages
11,511
Reaction score
27,696
Location
New Jersey
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.
 
Top