System Control
Pre-requisite
- The user has to be signed in to perform the following operations.
- The user should have an active pro-monitoring plan activated on the space.
Arming the System
To arm the system, The following method can be used:
spaceId(required): The space id of the User.
InstaVision.securityServices.armSystem(
spaceId = "spaceId",
onSuccess = {
// The system arming request has been sent and will be armed after the exit delay
},
onError = { error ->
// The error object contains the error code and message
}
)
Disarming the System
To disarm the system, The following method can be used:
spaceId(required): The space id of the User.
InstaVision.securityServices.disarmSystem(
spaceId = "spaceId",
onSuccess = {
// The system will be disarmed.
},
onError = { error ->
// The error object contains the error code and message
}
)
Enabling Test Mode
To enable test mode on the system, The following method can be used:
spaceId(required): The space id of the User.request(required): The request object to toggle the test mode
val request = TestModeRequest(
enable = true
)
InstaVision.securityServices.disarmSystem(
spaceId = "spaceId",
request = request,
onSuccess = {
// The system is now in test mode.
},
onError = { error ->
// The error object contains the error code and message
}
)
Scheduling Arm/Disarm
To schedule arm/disarm of the system, The following method can be used:
spaceId(required): The space id of the User.profileId(required): The security profile id of the User.request(required): The request object containing the scheduling details.
val request = UpdateSecurityScheduleRequest(
type = "Arm", // Type can be "Arm" or "Disarm"
timezone = "America/Los_Angeles", // Timezone in which the schedule is to be set
selectedDays = listOf(WeekDay.MONDAY, WeekDay.WEDNESDAY, WeekDay.FRIDAY), // Days of the week to apply the schedule
timeSlot = Time(
hour = 22, // Hour in 24-hour format
minute = 0
)
)
InstaVision.securityServices.addSchedule(
spaceId = "spaceId",
request = request,
onSuccess = {
// The arming schedule has been set successfully.
},
onError = { error ->
// The error object contains the error code and message
}
)
Update Scheduling Arm/Disarm
To update a schedule for arm/disarm of the system, The following method can be used:
spaceId(required): The space id of the User.profileId(required): The security profile id of the User.scheduleId(required): The schedule id of the schedule to be updated.request(required): The request object containing the updated scheduling details.
val request = UpdateSecurityScheduleRequest(
type = "Arm", // Type can be "Arm" or "Disarm"
timezone = "America/Los_Angeles", // Timezone in which the schedule is to be set
selectedDays = listOf(WeekDay.MONDAY, WeekDay.WEDNESDAY, WeekDay.FRIDAY), // Days of the week to apply the schedule
timeSlot = Time(
hour = 22, // Hour in 24-hour format
minute = 0
)
)
InstaVision.securityServices.updateSchedule(
spaceId = "spaceId",
profileId = "profileId",
scheduleId = "scheduleId",
request = request,
onSuccess = {
// The arming schedule has been updated successfully.
},
onError = { error ->
// The error object contains the error code and message
}
)
Deleting a Schedule
To delete an existing schedules for arm/disarm of the system, The following method can be used:
spaceId(required): The space id of the User.profileId(required): The security profile id of the User.request(required): The request object containing the updated scheduling details.
val request = DeleteSecurityScheduleRequest(
scheduleIds = listOf() // List of schedule IDs to be deleted
)
InstaVision.securityServices.deleteSchedule(
spaceId = "spaceId",
profileId = "profileId",
request = request,
onSuccess = {
// The arming schedule has been deleted successfully.
},
onError = { error ->
// The error object contains the error code and message
}
)