Page 1 of 1

Dahua Day/Night Switch via API

Posted: Tuesday 16 February 2016 12:33
by nayr
took me a good while to figure this out, so I am posting this up here for anyone searching in the future.

First setup your camera to be in Full Time profile for Day (or Night) since you will be changing it externally now.
Screen Shot 2016-02-16 at 4.18.33 AM.png
Screen Shot 2016-02-16 at 4.18.33 AM.png (33.44 KiB) Viewed 2274 times
To switch to Day profile:

Code: Select all

http://username:password@IP-ADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1
To switch to Night profile:

Code: Select all

http://username:password@IP-ADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=2
Tada! now domoticz can control the switching from day/night since it actually knows when the sun is going to rise/set and might even have access to external light sensors.

With my cameras I can either use one profile for day/night mode, or use 2 separate profiles and switch based upon fixed times.. since sunrise and set change every single day those fixed times are not a very good solution outside.. I use domoticz to make the switch now and I can have completely unique configurations for day and night.