Hikvision Day/Night script

Discussion in 'Hikvision' started by rjsrjs, Jan 11, 2019.

Share This Page

  1. rjsrjs

    rjsrjs n3wb

    Joined:
    Nov 18, 2014
    Messages:
    3
    Likes Received:
    0
    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.
     
  2. Tolting Colt Acres

    Tolting Colt Acres Pulling my weight

    Joined:
    Jun 7, 2016
    Messages:
    314
    Likes Received:
    120
    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.
     
  3. rjsrjs

    rjsrjs n3wb

    Joined:
    Nov 18, 2014
    Messages:
    3
    Likes Received:
    0
    I saw what you did how could this be modified just to change the scheduled times without the other settings?
     
  4. Tolting Colt Acres

    Tolting Colt Acres Pulling my weight

    Joined:
    Jun 7, 2016
    Messages:
    314
    Likes Received:
    120
    Find the appropriate API command to send to the camera, and adjust the script to send that command.
     
  5. rjsrjs

    rjsrjs n3wb

    Joined:
    Nov 18, 2014
    Messages:
    3
    Likes Received:
    0
    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: Jan 17, 2019 at 7:36 PM