Howto: Disable cameras via HomeKit when someone is at the location
CompletedI had a requirement to disable camera recording when someone is present at a location, and wanted the integration to work with HomeKit. Here is how I archived it:
Prerequisites:
- Homebridge with HTTP Switch plugin (https://github.com/Supereg/homebridge-http-switch#readme)
- Setup NX to accept API calls via Cloud (https://support.networkoptix.com/hc/en-us/articles/360016266074-Cloud-API-Route-API-Calls-via-Nx-Cloud)
In HomeBridge, create a HTTP-Switch with something like; which will either enable/disable the scheduleEnabled which stop/starts recording for the camera(s).
Then within HomeKit (I'm using Home+ 5) you simply setup your automation to turn on/off the switch. In my case I'm doing a "If anyone is at location, turn below switch off" and "If everyone has left location, turn switch on".
{
"accessory": "HTTP-SWITCH",
"name": "Indoor Camera Recording Status",
"switchType": "toggle",
"timeout": 5000,
"onUrl": {
"url": "https://(Cloud-API-ID).relay.vmsproxy.com/ec2/saveCameraUserAttributes",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"cameraId": "(Camera-ID)",
"scheduleEnabled": true
}
},
"offUrl": {
"url": "https://(Cloud-API-ID).relay.vmsproxy.com/ec2/saveCameraUserAttributes",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"cameraId": "(Camera-ID)",
"scheduleEnabled": false
}
}
"auth": {
"username": "(API Username)",
"password": "(API Password)",
"sendImmediately": false
},
"debug": true
}
0
-
Thank you for sharing Michael Pasqualone! Highly appreciated.
0
Post is closed for comments.
Comments
1 comment