SD4A425DB-HNY Day/Night Switch

kjinxx2

Pulling my weight
Joined
Dec 1, 2020
Messages
149
Reaction score
211
Location
USA
Hey all -

Okay - I give up and need to make a post - I have scoured through past posts for the past 3 days to try to figure out how to manually trigger the SD4A425DB-HNY between Day/Night mode from BI via web command. I have read that some have had success using '/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3' but nothing seems to work for me.

Does anybody have an SD4A425DB and have you successfully trigger day/night switching from BI? If so, would you be able to post screenshots of your camera config (in the webUI) as well as the command you're issuing from BI?

Thanks
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,041
Reaction score
48,824
Location
USA
The new GUI follows a different API.

I posted in another camera thread how to do it with the new gui, although I haven't tested it with this camera yet, but fingers crossed it would be the same.

 

kjinxx2

Pulling my weight
Joined
Dec 1, 2020
Messages
149
Reaction score
211
Location
USA
I didn't find that thread in my searches, but it doesn't seem to work either. If you have a chance to test it on this camera and it works for you let me know because then I'll really have to do some further trouble shooting!
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,041
Reaction score
48,824
Location
USA
My bad, I figured it out for the full color cam, but hopefully I can figure it out for this cam. I have been simply using the monthly profile in the mini-PTZ as it was sufficient for my needs.
 

kjinxx2

Pulling my weight
Joined
Dec 1, 2020
Messages
149
Reaction score
211
Location
USA
Not your bad at all! I was tinkering around with the API over the last 3 days using various commands I found in the forums and just hope I didn't accidentally mess up configs. I did do a factory reset though so I imagine all of that tinkering was reversed.

If anybody else has gotten into this command let me know! Otherwise I will just use the monthly profile and adjust each month for sunrise/sunset variation


Thanks again
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Have been testing this API for switching from full time day to full time night and general. Tested three cameras including the 180 degree Dahua and so far so good. Usually test by entering the API into browser and then port over to Hubitat that is on the same sub net as BI and the cameras for longer term testing.

So far the API is functional on:
HFW5849-A180-E2-ASTE
HFW5442E-Z4E
T5442T-ZE
with additional cameras to be added.

General
Code:
http://admin:password@192.168.55.44/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=4
Full Time Day
Code:
http://admin:password@192.168.55.44/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=0
Full Time Night
Code:
http://admin:password@192.168.55.44/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=3
The only difference in the API is 'Mode' plus the IP address'.

Please post if this works on your SD4A425DB-HNY camera.
 
Last edited:

kjinxx2

Pulling my weight
Joined
Dec 1, 2020
Messages
149
Reaction score
211
Location
USA
Unfortunately no dice with that command either
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
If you have other cameras see if there is success or not. Sometimes, the browser will reply back 'OK' but no action occurs. Or 'error' is reported. Generally 'error' indicates that something is not correct with the entered API.

What you are seeing when tested?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,041
Reaction score
48,824
Location
USA
Yeah I get lots of OK response when I was trying to figure it out but it did nothing.
 

kjinxx2

Pulling my weight
Joined
Dec 1, 2020
Messages
149
Reaction score
211
Location
USA
It does say OK when I post the command but no change - this is the only camera i have on this new GUI/API
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Yeah I get lots of OK response when I was trying to figure it out but it did nothing.
So far Mode 1, 2 and 3 work. What is interesting is that 'General' is called 'Normal' in the API. It would be great if the API would follow the naming scheme that is used in the camera UI or the other way around.

In the new blue interface one would think that listed 9 profiles (Front Light - Custom 1, etc) would follow the same API format as Day, Night and General. But it looks like they do not. Or maybe the additional profiles are intended to not be available for API use.
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Additional testing indicates the following Dahua camera models function with the above listed HTTP API for full-time day and full-time night mode switching.

HFW-5849T1-ASE-LED
HFW-5849-A180-E2-ASTE
IPC-T5442T-ZE

HFW-5442E-Z4E
HFW-5242HN-Z6E-MF
HFW-2831T-ZAS-S2

IPC-T5449H-ASE-D2
HFW-5242H-ZE-MF
IPC-T2231T-ZS

The below is the only camera that will not respond to the HTTP API. Additional effort will be required to locate an API that will function with the 7442. But so far, with limited testing, API variations are not working.

HFW-7442H-Z4-4MP AI IR

The sunrise/sunset Windows utility on the BI computer works well for day/night and night/day mode switching. This utility is time base using local sunrise and sunset recalculated daily.

The change is to use mode switching that is based on LUX and not on time which does not take into account cloudy vs sunrise and set times. A Hubitat C7 hub with a Zooz ZSE-11 LUX sensor is being used to program the switching times based on LUX which takes into account varying weather conditions.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,214
Reaction score
4,253
Location
Brooklyn, NY
Did anyone get the Day/Night Switch API to work for the SD4A425DB-HNY?

Thanks
Mike
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Have not found a way to use the older API for day/night switching for the newer Web 5 Dahua camera interface.

However, there is an approach that works for the newer Web 5 blue camera GUI for the SD5A425XA and HFW5442E-Z4E-S3. This uses the "Time Plan" settings to switch from day to night and night to day. It changes the time line from orange to purple and from purple to orange for the day/night and night/day mode switch.

Sunrise
Code:
http://admin:password@192.168.57.62/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].TimeSectionV2[11][0]=00:00:00-24:00:00%20Day
Sunset
Code:
http://admin:pasword@192.168.57.62/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].TimeSectionV2[11][0]=00:00:00-24:00:00%20Night
NOTE: %20 is the URL encoding for a space in the URL - a space in the URL is not an allowed character and must be escaped.

The downside is that these are month sensitive. Month 11 is December, with month 0 being January. i.e. the month number has to be changed for each new month.

For day use, the script changes the entire line to orange. Then when it is time to switch, the night script change that same line to all purple. And the reverse for the night to day mode change.

Overall, have had 100% success with this script using Hubitat and LUX to change to the correct day/night modes.

Note: prsmith777 developed the API for the "Time Plan" switch
 
Last edited:

duplo

Getting comfortable
Joined
May 26, 2022
Messages
301
Reaction score
375
Location
Berlin, Deutschland
Did anyone get the Day/Night Switch API to work for the SD4A425DB-HNY?

Thanks
Mike

There are two possibilites... the one already posted by Alaska Country and ConfigEx
Because you have to set 12 calls (for each month) OR use another script line to figure out which month we have..

i am using the ConfigEx Method..

Only downside if i remember correctly..
if you open the webinterface and click onto the "camera" settings tab, it will switch to time plan if you are in configEx mode.
so api needs to call again, because it will not switch back to configex after you logout.

if you want to use more than only day/night profile, only works with time plan


in timeplan all have to be profile "day"

so you set once
ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].ConfigEx=Night


then you switch

ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Mode=4 (day)

ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Mode=3 (night)
 
Last edited:

Ri22o

Known around here
Joined
Jul 30, 2020
Messages
1,442
Reaction score
2,900
Location
Indiana
Have not found a way to use the older API for day/night switching for the newer Web 5 Dahua camera interface.

However, there is an approach that works for the newer Web 5 blue camera GUI for the SD5A425XA and HFW5442E-Z4E-S3. This uses the "Time Plan" settings to switch from day to night and night to day. It changes the time line from orange to purple and from purple to orange for the day/night and night/day mode switch.

Sunrise
Code:
http://admin:password@192.168.57.62/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].TimeSectionV2[11][0]=00:00:00-24:00:00%20Day
Sunset
Code:
http://admin:pasword@192.168.57.62/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].TimeSectionV2[11][0]=00:00:00-24:00:00%20Night
NOTE: %20 is the URL encoding for a space in the URL - a space in the URL is not an allowed character and must be escaped.

The downside is that these are month sensitive. Month 11 is December, with month 0 being January. i.e. the month number has to be changed for each new month.

For day use, the script changes the entire line to orange. Then when it is time to switch, the night script change that same line to all purple. And the reverse for the night to day mode change.

Overall, have had 100% success with this script using Hubitat and LUX to change to the correct day/night modes.

Note: prsmith777 developed the API for the "Time Plan" switch
Where in BI do you enter the web calls? I tried this before, but I need it explained like I am 5 year old.
 

Riclyo

Getting the hang of it
Joined
Dec 29, 2019
Messages
68
Reaction score
87
Location
Upstate New York
My bad, I figured it out for the full color cam, but hopefully I can figure it out for this cam. I have been simply using the monthly profile in the mini-PTZ as it was sufficient for my needs.

Do you happen to know if montly profiles is the only way to get new color Hik cameras to change exposure between day and night as well?
 
Top