Dahua day/night switch utility - DahuaSunriseSunset

I'm trying to use this utility with five T5442T-ZE connected to a new NVR (NVR8CH-8P-2AI). The NVR's ip is 192.168.76.2. Clicking through the settings to Add a Device, I see the cameras on the NVR's internal LAN are have 10.1.1.X IPs, which I obviously I can't access. But, if you access them via the web page button they all have addresses such as; 192.168.76.2:1008X, and that address I can access...at least initially after viewing it accessing it from the NVR GUI. But it seems like after you log out of the NVR that address also becomes inaccessible.

Any ideas how I can use this utility with this NVR? I saw in another thread that the utility doesn't work with newer GUI cameras, maybe it's the same with the NVR?

Ty
 
I'm trying to use this utility with five T5442T-ZE connected to a new NVR (NVR8CH-8P-2AI). The NVR's ip is 192.168.76.2. Clicking through the settings to Add a Device, I see the cameras on the NVR's internal LAN are have 10.1.1.X IPs, which I obviously I can't access. But, if you access them via the web page button they all have addresses such as; 192.168.76.2:1008X, and that address I can access...at least initially after viewing it accessing it from the NVR GUI. But it seems like after you log out of the NVR that address also becomes inaccessible.

Any ideas how I can use this utility with this NVR? I saw in another thread that the utility doesn't work with newer GUI cameras, maybe it's the same with the NVR?

Ty

By default the NVR isolates your cameras from the rest of your system. That is good.

You would have to either bridge mode (I think it is called that) or put the cameras on a POE switch and give them same IP address subnet as your LAN, which isn't advised as then your cameras have access to the internet.

This is the same whether the NVR is old or new. So most with an NVR do not use this utility.
 
I've got a strange issue with one of my T5442T
Suddenly it has stopped changing to night mode upon request:
Using the command:

I get "bad request"

But the day mode command:

Works just fine with response "OK"

Not sure how the day command could work but not the night one?

Something must have changed. Did you update firmware or edit anything via the camera's web UI any time recently?
 
I'm trying to use this utility with five T5442T-ZE connected to a new NVR (NVR8CH-8P-2AI). The NVR's ip is 192.168.76.2. Clicking through the settings to Add a Device, I see the cameras on the NVR's internal LAN are have 10.1.1.X IPs, which I obviously I can't access. But, if you access them via the web page button they all have addresses such as; 192.168.76.2:1008X, and that address I can access...at least initially after viewing it accessing it from the NVR GUI. But it seems like after you log out of the NVR that address also becomes inaccessible.

Any ideas how I can use this utility with this NVR? I saw in another thread that the utility doesn't work with newer GUI cameras, maybe it's the same with the NVR?

Ty
For anyone wondering in the future, I was able to get around this by putting the NVR into bridge mode and bringing the cameras directly on to my network. Fortunately, they are still isolated from the internet and rest of my LAN using a VLAN on my unifi network.
 
Two days ago I upgraded my BI machine and installed the day/night utility the same way I had installed it on my old unit. However, after two day/night cycles, the utility isn’t working. The simulate function works as advertised on six cameras. Anyone know of a corrective action for the utility to be automatic?

Edit: I had two instances of the same program running. I deleted one and had to change the files path. I think this will work.
 
Last edited:
  • Like
Reactions: CanCuba
I have exchanged two older SD22204T-GN cameras against two DH-SD22204DB-GNY. The new ones also have the V5 web interface, but none of the commands posted here in the last three pages work. :(

Trying the commands in the browser always returns an "OK", but the cam doesn't switch between day and night profile.

Do I overlook something?

EDIT:
After googling a while I found these commands in the Home Assistant forums which works for me:

Switch to Night Mode:
Code:
http://username:[email protected]/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].ConfigEx=Night&VideoInMode[0].Mode=4

Switch to Day Mode:
Code:
http://username:[email protected]/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].ConfigEx=Day&VideoInMode[0].Mode=4

Logging into the web server of the camera always changes the profile back to day! But having these commands as PTZ presets in BI, you can always switch back if you need night mode.
 
Last edited:
  • Like
Reactions: Hrrz
Things that tripped me up today:
  1. I put DahuaSunriseSunset.exe in my C:\Program Files\ directory.
    1. This means it writes its config file to C:\Program Files\, which requires Administrator privileges.
    2. Which means you must Run as Administrator to configure it, otherwise your configuration changes will not stick. Writing to the config file just silently fails.
  2. I physically removed a camera that had been entered into the config, and this caused the utility to hang, logging multiple errors to the log.
HTH someone else!
 
  • Like
Reactions: CanCuba
Things that tripped me up today:
  1. I put DahuaSunriseSunset.exe in my C:\Program Files\ directory.
    1. This means it writes its config file to C:\Program Files\, which requires Administrator privileges.
    2. Which means you must Run as Administrator to configure it, otherwise your configuration changes will not stick. Writing to the config file just silently fails.
  2. I physically removed a camera that had been entered into the config, and this caused the utility to hang, logging multiple errors to the log.
HTH someone else!
For rogue applications, I will usually create a folder on C: named '\files\"
 
I set a schedule for my cams changed day to color and night to B/W under the customized scene tab and then changed it back to the Day/Night tab. Why would my cams be switching to B/W before the scheduled time?
 
I set a schedule for my cams changed day to color and night to B/W under the customized scene tab and then changed it back to the Day/Night tab. Why would my cams be switching to B/W before the scheduled time?
I believe you need to leave it on Customized Scene.
 
  • Like
Reactions: bigredfish
Sucks to hear that that the new GUI does not support this utility - and I'm forced to micromanage everything lol
Why the move backwards?
 
Sucks to hear that that the new GUI does not support this utility - and I'm forced to micromanage everything lol
Why the move backwards?
Technically it's the old utility that's not supporting the new GUI, but:

I asked ChatGPT to modify bp2008's DahuaSunriseSunset utility to support new GUI cameras as well as legacy-API cameras, and I have the fix documented in this other thread.
  • It now queries
  • curl -g --digest -u '<user>:<password>' "http://<Camera-IP-Address>/cgi-bin/configManager.cgi?action=getConfig&amp;name=VideoInMode""
and:
  • If getConfig&name=VideoInMode contains ConfigEx, use:
    • VideoInMode[...].ConfigEx=Day
    • VideoInMode[...].ConfigEx=Night
  • if it contains Config[0], use:
    • VideoInMode[...].Config[0]=0
    • VideoInMode[...].Config[0]=1
New files available in that other thread.
 
  • Wow
  • Like
Reactions: johnfitz and Arjun
That is absolutely amazing and scary that ChatGPT could do that.

Easy to see why programming jobs are disappearing.
Yes and no. I'm not very surprised that ChatGPT could find the correct commands and where to swap them out in the code, as when I look at my chat, it actually shows that it queried IPCamTalk to find that.

What is surprising is that ChatGPT suggested a change to support both cameras, based on which API it supported. It originally suggested a brute force approach to try one API and then fail over to the other, but when I suggested that it first query getConfig&name=VideoInMode, which ChatGPT had used earlier to verify that the new commands worked, it used that instead.

And it also added error logging without my suggesting it, which was useful in troubleshooting.

All in all it took me 2-3 hours to talk to ChatGPT, get its suggested code, copy/paste into VisualStudio, compile, test, lather, rinse, and repeat about 10x to get it all right.

There are other Agentic AIs and compilers that can work together directly, and if I could get that running locally, so that it could code, compile, and test my cameras that don't have internet access, and that might have been able to do it all in minutes. And that's the scary part.
 
Everyone thinks that ChatGPT is an AI, but it really is thousands of 27yo programmers living in their mom's basement in Hoboken with nothing better to do in between mom bringing down a hot pocket.