Dahua day/night switch utility - DahuaSunriseSunset

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)
 
This is awesome and simple. After everything is set can we close the app? Or it has to stay open?
 
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
 
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
 
  • Like
Reactions: actran
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?
 
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
 

Attachments

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 ?
 
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.
 
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