Windows utility to set Hikvision Image Parameters Switch Scenes based on local sunrise sunset times

johnfitz

Getting comfortable
Feb 4, 2021
587
700
NY
Hi... I created this utility to set the Image Parameters Switch on Hikvision cameras using local sunrise/sunset times... I have attached a copy of the Windows utility if anyone wants to try it out...


Screenshot 2024-03-22 083522.png

Screenshot 2024-03-22 083725.png

PLEASE USE LATEST VERSION AT END OF THREAD!
 
Last edited:
a few instructions:

The first time you run it, enter your latitude and longitude coordinates... you can get these by right clicking on you location in google maps... after entering these, you should see correct sunrise/sunset times for the current date/location...

enter your camera's username and password... enter an IP address and port number for a camera you want to add... for cameras on the LAN, the port number will most likely be 80... for cameras connected to NVR PoE ports, use the NVR IP address and 65001, 65002, etc. as the port number... "virtual host" must be enabled on the NVR for this to work...

hit the add button... the utility will then send a http get "/ISAPI/Streaming/channels/101/capabilities" request to the camera to see that it exists and get the camera name... if it is found, it then sends a http get "/ISAPI/Image/Channels/1/displayParamSwitch" request to check which version of the image parameters switch the camera uses...

the camera is then added to the camera list... you can use the edit button to change the sunrise/sunset scenes or minute offsets from sunrise/sunset you would like to use... while in edit mode, you may also delete any cameras that have been added... add as many cameras as you like... then hit the "IPS On" button and http put requests will be sent to each camera to set the image parameter switch schedules.

The utility uses the sunrise/sunset times for 15th day of each month to set the schedule. Older cameras with a version 1.0 image parameters switch look like this:

Screenshot 2024-03-22 094829.png

These V1.0 cameras only have one setting (not 12 months) so the 15th of the current month is used to set those... I have two older cameras like this, so I intend to run the utility once a month to keep these updated.

On first use, the utility will create a configuration file (.ini) that saves the username, latitude, longitude, and camera information for subsequent runs. The configuration file is updated anytime changes are made... the camera password is not saved and will need to be entered each time the utility is run... one limitation is that all cameras must be using the same username and password.

I'm looking forward to any feedback and will help/correct any issues found!
 
  • Like
Reactions: bp2008 and trempa92
you should start working on all in one. I saw you made an SD download form app, just integrate more options/tabs in one. Not necesarilly needs to be more damnding, as you free delegates once form is closed.

Worst part is having a good idea and plan :D

1 suggestion. Use ,net core as its multi platform

If you want we can colab if its c#. Make a github repo
 
  • Like
Reactions: johnfitz
If you want we can colab if its c#. Make a github repo

It's in Visual Basic... I can rewrite in in C# pretty quickly and then get it on github... that will be new for me so may have github questions for you once I have it rewritten!
 
Create github acc, In visual studio you have

1711139475985.png


You should have option create repository, mine is already created. Name it, and push it. By default its private repository, if you want anyone to access it uncheck that, otheerwise its an invitation only.

Once its up i can clone your repository and continue to add/modify and push to different branch as a patch which you can merge to master branch if you deem so
 
  • Like
Reactions: johnfitz
  • Like
Reactions: johnfitz
Hikvision changed the Image Parameters Switch GUI and ISAPI functionality a bit in the latest firmware... you can no longer set time periods that "meet/overlap" unless they are on the hour or half hour... a bit hard to explain but if you have a camera and the image parameters switch now looks like this:

Screenshot 2024-12-12 033137.png

then you can try adjusting the times and you will see what happens. In any case, I've adjusted the utility so that rather than, for instance, setting a period to:

00:00:00 - 06:32:00 / 06:32:00 - 17:08:00 / 17:08:00 - 24:00:00

it instead sets it to:

00:00:00 - 06:31:00 / 06:32:00 - 17:07:00 / 17:08:00 - 24:00:00

and all is well. The new firmware also changes the "Normal" scene name to "Basic", but behind the scenes (ha-ha, pun unintended) the ISAPI traffic from/to the camera still use "Normal", so no change there... just know to choose "Normal" for "Basic".

Here is version 1.2:
 

Attachments

Last edited:
  • Like
Reactions: Loki_C
Hey John,

Cant get this to work. Says error 403 forbidden. I confirmed cam user and password are proper. IP and so on. This is on a closed network with one simple IP range. I can log into the cams with a browser no problems. Tried ports 80, 81, 8080, 8000, 8443, 7681 and 7682. Even the NVR ports of 65001 which I don't have an NVR. Running a valid copy of Blue Iris.

Just tried running your .exe in admin mode. No dice. Same as above.
 
The exact working of the error message (including the title on the error window that pops up) will help me figure out what is happening... like this:

Screenshot 2025-01-06 161902.png
 
Not saying you shouldn't if you have reason to... but, have you changed any of the default "Network" or "System/User Management" settings for the camera?

Screenshot 2025-01-06 225247.png Screenshot 2025-01-06 225651.png
 
one big issue that i have is trusting unknown exe

I completely understand and agree with you... I'm not sure I would trust an unknow exe myself... would depend on how important it was to me to try the exe and more importantly the nature of the machine/network I was using...

I'm running a bit behind with the holidays, but I intend to upload the source code for this and another project I have to GitHub (I haven't used GitHub before so that's the delay) ... then the project could be downloaded and compiled by those who prefer that...

As far as the file size I think because I create a standalone exe using Visual Basic there are DLL files that are included in the exe which increase it's size.