Dahua day/night switch utility - DahuaSunriseSunset

DavidDavid

Getting comfortable
Joined
Jan 29, 2017
Messages
605
Reaction score
267
Location
Ohio

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
Thanks
Any code to share from your raspberry pi ?
 

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
Thank you for the links
I need some bash scripts (or php/nodejs) instead of domoticz script
(For automation i will use later on openHab2)
 

enilm

n3wb
Joined
Oct 31, 2016
Messages
25
Reaction score
9
This is awesome and simple. After everything is set can we close the app? Or it has to stay open?
 

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
Hi
@bp2008

I'm trying to make a bash script for linux to allow dahua camera to switch between day and night mode

I successfully get the Sunrise/Sunset time from script using api.sunrise-sunset.org.
It allow me to get the Sunrise and Sunset of the day and of the next day (UTC time)

I want to know what command did you send to camera to switch day and night mode ?

Hope someone here can help me

Thanks
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
Enter day profile:
Code:
/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0
Enter night profile:
Code:
/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1
 

jrf

Getting the hang of it
Joined
Sep 12, 2017
Messages
169
Reaction score
93
Quick question. Was setting this up with no issues until I got to my IPC-HDW4231EM-ASE. Everytime I click "Get Current Zoom/Focus" nothing happens. Checked, double, triple checked IP/port login info. However this camera has NO zoom....so I'm wondering... is that the problem?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
Yeah, if your camera hasn't got a motorized lens, you don't need to worry about the zoom/focus stuff.
 

jrf

Getting the hang of it
Joined
Sep 12, 2017
Messages
169
Reaction score
93
May I retract that idiot question? :facepalm: No idea why I was thinking it had AF....
 

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
Hi
@bp2008
Is it possible to have the day/night status of the camera with API after sending the command ?
I wish my script to check the status of the camera mode

Thanks
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA

Attachments

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
Thanks for your reply
I 'm checking the response of day/night command, if response is "OK" then command is success else resend the command again.

Sunrise Offsets Hours: is it for day command to be running only before Sunrise or can also be after ? Same question for Sunset ?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
Thanks for your reply
I 'm checking the response of day/night command, if response is "OK" then command is success else resend the command again.

Sunrise Offsets Hours: is it for day command to be running only before Sunrise or can also be after ? Same question for Sunset ?
The number is simply added to the calculated sunrise or sunset time.

So if your sunrise is 6 AM and sunset is 6 PM and you have an offset of 1 in both places, then the sunrise and sunset actions will take effect at 7 AM and 7 PM. If you use a negative number like -1 then the actions will occur at 5 AM and 5 PM.
 

jrf

Getting the hang of it
Joined
Sep 12, 2017
Messages
169
Reaction score
93
Can this be pinned to the top?
 

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
Hi
As i'm writting a bash code to run Sunrise/Sunset profile, i need some informations.
After setting Sunrise/Sunset to camera to get the right profile (day/night), what other commands are needed to be done ?
Are Zoom/Focus command need to be set when profile mode is done ?

Regards
 
Top