How does the BVMS - Operator collaboration with Slack work?
Question
How does the BVMS - Operator collaboration with Slack work?
Answer
Security guards as well as operators are all member of this Slack channel and use the channel to collaborate. Guards can use their mobile phones to upload still images or movies to the channel for archiving by the security operators. Security operators are able to send snapshots (directly from BVMS), videos (exported), or chat messages to instruct security guards.
BVMS automatically posts events to the channel and, optionally, can post camera snapshots or short video clips of incidents into the channel automatically.
Screenshots
Mobile clients
iOS, Andriod.
Notifications on iPhone (7) and Slack app on Android.
Windows client
Alarm comes into BVMS. BVMS tries to export the related video footage and it appears as small (~10 seconds) clips in Shacl after ~10 seconds.
The operator can also send the content of an image pane to Slack:
Configuration
BVMS
References
Add references to script editor to communicate with web applications. The System.Net.dll reference needs to be added for the client and server script.
Server script
Example server script (replace the Slack security token and channel ID in the SlackCommunication class): ServerScript.txt
You also need to make sure the export directory is whitelisted.
You might need to adjust the time it takes to export video.
Add "using" statements to the upper part of the server script.
|
Add the class SlackCommunication.
|
Add the method to clear the contents of the directory that the script uses to store temporary files.
|
Add the method that uploads files to Slack.
|
Add the method to send the exported file.
|
I recommend to add two server scripts covering two use-cases:
- Send messages into the Slack channel.
- Upload files into the Slack channel.
Send messages into the Slack channel based on the event information.
|
Upload files into the Slack channel. You need to create a server script for each camera for which we want to upload small clips.
|
Client script
We use the same SlackCommunication class. We create a small client script that saves the current view of an image pane and sends this to the Slack channel.
|
Devices
Create virtualinputs or other devices that can generate events.
Attach the server script to those events. The script will automatically extract the device name, old state, and new state from the event. Alternatively, the file upload script will attach a small video clip to the message of the event.
Configure your alarms.
Slack
Create a Slack account and create a new workspace.
Create a new channel in the work-space (this is indicated with a #).
Add colleagues to your workspace or skip this option.
Note the channel ID of the project in the work-space. This starts with a C.
Browse to https://api.slack.com/apps and create a new app.
Add the app to your workspace.
We need to give the app the permissions to post messages and files into the work-space.
You need to expand the security scopes to include chat.write and files.write.
Now we are ready to install the app in the workspace.
Copy the token ID into the SlackCommunication class in the BVMS script. You also need to copy the project ID into the script. With this information BVMS knows in which workspace and channel it should post it's notifications.
Add the created app to your workspace by typing "@appname" into text field in the channel.
You can change the icon of the application in the settings page of the app.