Dahua Day/Night Switch via API

Moderator: leecollings

Post Reply
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Dahua Day/Night Switch via API

Post 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 2125 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.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest