Automatic SCENE change

lane777smith

Getting the hang of it
Joined
May 11, 2022
Messages
149
Reaction score
78
Location
texas
I have two 2387's and i was wondering if anyone has figured out a way to automatically make the SCENE's change based on sunrise/sunset, or even by using a light meter of some sort. Similar to the Dahua Sunrise/Sunset program that's out there.
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
749
Reaction score
233
Location
Croatia,Zagreb
Firmwares actually contain getLux function (saw using RCE and shell access to G2) but i havent seen anywhere on ISAPI or SDK documentation that we can use it as integrators. I believe its purely internal command for IR trigger.
 

lane777smith

Getting the hang of it
Joined
May 11, 2022
Messages
149
Reaction score
78
Location
texas
Firmwares actually contain getLux function (saw using RCE and shell access to G2) but i havent seen anywhere on ISAPI or SDK documentation that we can use it as integrators. I believe its purely internal command for IR trigger.
Thanks for the input.. utilizing an internal "lux" meteor would be the ideal solution for sure!
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
749
Reaction score
233
Location
Croatia,Zagreb
Afterall you do have "RCE exploitable model" it just depends if you are actually on exploitable firmware, if you are you are good to go with python script


This gains you access, edit a script to your desire to automate it
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
749
Reaction score
233
Location
Croatia,Zagreb
But you have colorVu model which have white led which do have ability to automate with ISAPI requests
Source internet:


ON:
curl -k --silent -H 'Content-Type:application/xml' -X PUT -d '<ExternalDevice><SupplementLight><enabled>true</enabled><mode>schedule</mode><Schedule><TimeRange><beginTime>20:00:00</beginTime><endTime>06:00:00</endTime></TimeRange></Schedule></SupplementLight></ExternalDevice>' --digest -u user:pass

OFF:
curl -k --silent -H 'Content-Type:application/xml' -X PUT -d '<ExternalDevice><SupplementLight><enabled>false</enabled><mode>schedule</mode><Schedule><TimeRange><beginTime>20:00:00</beginTime><endTime>06:00:00</endTime></TimeRange></Schedule></SupplementLight></ExternalDevice>' --digest -u user:pass
 

John Williamson

Getting the hang of it
Joined
Apr 9, 2019
Messages
174
Reaction score
90
Location
UK
I'm looking to do something similar. I need a command to switch the camera to Night and another command to switch the camera to Day. The Auto Day/Night setting means the Gain setting is forced to 100 and not adjustable and being able to set this up would get around that.

It looks as though it should be possible using /ISAPI/Image/channels/1/ISPMode/ but I can't fathom it out how to send the command (I'm pretty clueless with anything involving code). Can anyone provide a simple example that might help? It looks as though I need to specify the IP and path and then enter some xml. I have everything in place to trigger it to switch from a lux sensor connected to my Hubitat C8 hub but I'm stuck with the precise format of the url (do I have to include admin:password@) and the xml or json to send. Any help appreciated

EDIT: Switching manually between Day and Night allows the gain to be adjusted but the setting is common to both. What I actually need is the command to switch to a specific 'scene', as Day/Night, Gain, Shutter speed etc are saved individually. I want to be able to send a command to change the scene to 'Normal' which will equate to my daytime settings and 'Low Illumination' which will be for my night setup
 
Last edited:

John Williamson

Getting the hang of it
Joined
Apr 9, 2019
Messages
174
Reaction score
90
Location
UK
OK I've surprised myself and managed to get this working.

To switch scenes it's http://IP_Address:http_port/ISAPI/Image/channels/1/mountingScenario In my case the camera is connected to the PoE port of an NVR and with virtual host activated I can specify 65006 for cam 6

I've set up 'Normal' and 'Low Illumination' as desired. The camera is one of the new hybrid light ColorVu models so my 'Low Illumination' setting has the supplement light mode set to 'Smart' in order to bring on the white LED and switch back to colour on event activation.

The xml to send in the body is:

<?xml version="1.0" encoding="UTF-8"?>
<MountingScenario version="2.0" xmlns="">
<mode>lowIllumination</mode>
</MountingScenario>

alter <mode> to suit
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
749
Reaction score
233
Location
Croatia,Zagreb
Well use postman, any settings you can do on website you can clone the request from inspect element looking at network tab
 

John Williamson

Getting the hang of it
Joined
Apr 9, 2019
Messages
174
Reaction score
90
Location
UK
Well use postman, any settings you can do on website you can clone the request from inspect element looking at network tab
Yes I've got the scene switching back and forth using postman and now have to figure out how to implement that in node-red.

When I'm sending using postman, I can see (using Proxyman) that initially the camera sends a 401 connection refused, then postman is resubmitting using this setting:

"By default, Postman will extract values from the received response, add it to the request, and retry it. Do you want to disable this?"

So if I disable that it doesn't work. I'm not sure how I can resolve that as it will not authenticate when sent from elsewhere
 

John Williamson

Getting the hang of it
Joined
Apr 9, 2019
Messages
174
Reaction score
90
Location
UK
node-red i googled a bit and it sounds mind blowing when it comes to simple tasks
Yeah I already had node-red set up to link my alarm system zones to my Hubitat hub using MQTT. Last night after a long time messing I found the 'Hikvision Ultimate' palette and added that to node-red. That has an xml node and once you've configured the authentication you can just paste the xml snippet in directly, so I've got that up and running and will link it to an existing external luminance detector in Hubitat. I've also had a play with the 'text overlay' node - I've linked that up to various devices in Hubitat and have added a temperature display and house alarm status display to one of my cameras. Now I can see at a glance the status of my alarm and the temperature in Hik-Connect (rather than having to open a different app for the alarm).
 
Last edited:
Top