Hikvision Day/Night script

rjsrjs

n3wb
Nov 18, 2014
8
2
Hi,

I'm looking for a script/app that can run on PC/Mac that changes the day/night switching of cameras (R0s and G1) that are connected to an NVR.

I would envisage one that has reference to local sunrise/sunset time then modifies the Scheduled times in the camera for switching and can be manually run every fortnight/month to change these times.

Changing just the Scheduled times will allow any other setting differences that I currently have between day and night to be preserved.

Don't have a computer that is continually on to allow the current suggestion to automatically do this so the current solutions are great but won't work for me.

Hikvision this is an oversight that could be easily added to give better functioning of the cameras.
 
I posted such a script here a while ago... if you search you should be able to find it and customize it to your needs.
 
Worked through but could not get Python to run with the ephem includes (or any includes really) so I worked the following and set the times manually. Needed --digest to work on the G1 camera. IP:6500x is for going via the NVR via the virtual host mode to the cameras - use IP:80? for cameras not connected to an NVR.

Hope this helps others.

Use timeanddate.com for local sunrise and sunset times and change further to suit local conditions.

curl --digest -X PUT -T ~/Desktop/ss.xml "http://user:password@IP:65001/ISAPI/Image/channels/1/ISPMode"

ss.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ISPMode version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<mode>schedule</mode>
<Schedule>
<scheduleType>day</scheduleType>
<TimeRange>
<beginTime>05:58:00</beginTime>
<endTime>20:44:00</endTime>
</TimeRange>
</Schedule>
</ISPMode>
 
Last edited:
  • Like
Reactions: alastairstevenson
Worked through but could not get Python to run with the ephem includes (or any includes really) so I worked the following and set the times manually. Needed --digest to work on the G1 camera. IP:6500x is for going via the NVR via the virtual host mode to the cameras - use IP:80? for cameras not connected to an NVR.

Hope this helps others.

Use timeanddate.com for local sunrise and sunset times and change further to suit local conditions.

curl --digest -X PUT -T ~/Desktop/ss.xml "http://user:password@IP:65001/ISAPI/Image/channels/1/ISPMode"

ss.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ISPMode version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<mode>schedule</mode>
<Schedule>
<scheduleType>day</scheduleType>
<TimeRange>
<beginTime>05:58:00</beginTime>
<endTime>20:44:00</endTime>
</TimeRange>
</Schedule>
</ISPMode>
Did you have to change any camera settings to get this CURL call to work? I am receiving un-authorized when I try the same command you are using (with the correct user/pass).
 
Did you have to change any camera settings to get this CURL call to work? I am receiving un-authorized when I try the same command you are using (with the correct user/pass).


I used --digest with curl and it works with R0 and G1 cameras on Web Authentication on digest. Try digest/basic as suggested.

Use :6500x where x is the camera number with virtual mode enabled on the NVR/DVR. If you are using cameras without a NVR/DVR use :80 or :8000?
 
Last edited: