Disable/enable "Disarming" by API?

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
I just released a new version of rroller/dahua that supports the "Disarming Linkage" as a binary switch.
You can install that into Home Assistant manually or with HACS. It looks like this...

View attachment 92303

If you aren't running Home Assistant and which to use a script... here's how you'll do it (remember this needs to use Digest Authentication)
Code:
# Get the current value
http://IP_ADDRESS/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage

# Disable
http://IP_ADDRESS/cgi-bin/configManager.cgi?action=setConfig&DisableLinkage[0].Enable=false

# Enable
http://IP_ADDRESS/cgi-bin/configManager.cgi?action=setConfig&DisableLinkage[0].Enable=true
Hey @runraid - I finally got around to trying to set this all up in BI to just disable these types of cam with a profile.

The command works to get the current value, but when I run the enable or disable, it takes exception to the 0 in [0]. I have tried 0,1,2,true,false and eliminated the [0] and still doesn't like it. Any ideas?

And now that you have the 4k/x, it has audio that can play but doesn't have the disarm option - have you figured out the API to disable and enable that?
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
hmm. I’ll give it a try this weekend and report back.
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Looking at this now @wittaj

It doesn't look like this cam supports it? At least not on the firmware I'm on now.


Take a look at this... Notice the IPC-Color4K-X-2.8MM doesn't even have the "disarming" option in the UI. That's probably why the API call doesn't work too. Maybe @EMPIRETECANDY can put in a feature request for the firmware?

Cam that supports it...IPC-Color4K-X-2.8MM
1645291551132.png1645291537054.png
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
Yes, that is correct, the 4K/X and other cameras that mimic active deterrence from an audio perspective do not have this disarming feature.

I already have a request in to Andy about it LOL.

But you have been a master of figuring out API codes, I thought if anyone could stumble on it, it would be you.

Some of my active deterrence cams also do not like that API you posted earlier.

The command works to get the current value, but when I run the enable or disable, it takes exception to the 0 in [0]. I have tried 0,1,2,true,false and eliminated the [0] and still doesn't like it.

The only work around I can figure is an API to turn the IVS rules off and on? Have you figured that one out?
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
You want to turn the IVS on/off? Yeah I can probably get the command for that.. give me a minute :D
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
You want to turn the IVS on/off? Yeah I can probably get the command for that.. give me a minute :D
Well I would prefer to disarm the audio or alarm feature of the IVS so that the camera is still triggering and recording motion events based on IVS so that it stops telling me I am under surveillance when I am mowing the lawn LOL.

But if turning the IVS off and on can accomplish that, it will work in my case since Blue Iris is still recording anyway, it just won't get camera triggers during that time.

But yeah I would prefer the disarm feature first!
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
@wittaj here's an example (change your IP of course!)

This is how you list out the current rules...

Which might show you something like this...
Code:
table.VideoAnalyseRule[0][3].Name=IVS-1
table.VideoAnalyseRule[0][3].ObjectTypes[0]=Human
table.VideoAnalyseRule[0][3].ObjectTypes[1]=Vehicle
table.VideoAnalyseRule[0][3].PtzPresetId=0
table.VideoAnalyseRule[0][3].TrackEnable=false
table.VideoAnalyseRule[0][3].Type=CrossLineDetection
Notice "IVS-1" is [0][3] ... 0 is the channel, 3 is the rule index. Find your rule index and pass it in like this... (use true to enable, false to disable)

You can also chain several of them together if you just wanna blindly turn them all off...
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Also, can you show me a screenshot of the UI where you'd "disarm the audio or alarm feature"? I can probably get the API for that too...
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
You are awesome!

I have some work to do now LOL.

While disarming would be preferred, this could work very well as I have different IVS rules just for the audio already set up where I can just turn off or on that particular IVS rule and still get the camera triggers from the other IVS rules.

This is awesome.

Fingers crossed mine works and responds this way LOL.
 

genelit

Getting comfortable
Joined
Jan 4, 2018
Messages
264
Reaction score
395
Location
Sweden
Great job @runraid !

Would you have the chance to dive in to the ITC-237 (ANPR) camera and or a camera supporting video metadata (where the plates also are recognised (in an environment with a 5-series NVR))
It would be awesome if it's possible to get the plate from the last passing car and post it in HA.

If you don't have the cameras I can let you in to play with the ones I have.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
@wittaj here's an example (change your IP of course!)

This is how you list out the current rules...

Which might show you something like this...
Code:
table.VideoAnalyseRule[0][3].Name=IVS-1
table.VideoAnalyseRule[0][3].ObjectTypes[0]=Human
table.VideoAnalyseRule[0][3].ObjectTypes[1]=Vehicle
table.VideoAnalyseRule[0][3].PtzPresetId=0
table.VideoAnalyseRule[0][3].TrackEnable=false
table.VideoAnalyseRule[0][3].Type=CrossLineDetection
Notice "IVS-1" is [0][3] ... 0 is the channel, 3 is the rule index. Find your rule index and pass it in like this... (use true to enable, false to disable)

You can also chain several of them together if you just wanna blindly turn them all off...
So running that prints out a ton of lines LOL.

So it looks like for this:

table.VideoAnalyseRule[0][2].EventHandler.VoiceEnable=true

That if I change true to false that would turn the audio off for that IVS rule? So the IVS rule would still trigger and record, just not play the audio?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
@runraid what am I doing wrong LOL

Every time I try to run anything other than the get command it comes up with an error:

1645314244386.png1645314119593.png
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Ah! You need to URL encode the [ and the ]

Instead of [ use %5B
Instead of ] use %5D
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Do it like this...

Code:
curl -s --digest -u admin:PASSWORD  "http://
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
OK so it didn't return an error, but the check box isn't changing when going from true to false in the camera GUI - shouldn't that change based on the response?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
I hit the refresh button at the bottom of the IVS and the refresh of the browser and still no change.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
23,858
Reaction score
46,169
Location
USA
I eliminate the -s and then I get the error again for the 0
 
Top