Having recently been messing around with ZoneMinder for home security, I wanted to turn on and off the program using Bluetooth. Basically, the idea being that when I am around, the server will sense my presence (no Darth Vadar jokes please ;)) via the Bluetooth on my phone and turn off ZoneMinder. Then, if I leave the location of the server, it will no longer be able to sense Bluetooth on my phone and thus will turn on ZoneMinder.
So, I hunted around for such a program, I came across bluemon and BlueProximity, but they both only worked on proximity, i.e. they relied on you being near by, as far as I could tell, there was no option of running an action when the phone was completely unavailable.
So, I decided to write my own script to do what I wanted. Now, bear in mind I have very little skill when it comes to Bash and scripting and what I wrote was a result of trial and error. It all revolves around a tool called hcitool that can be used in Linux to control Bluetooth connections.
The first attempt at my script can be found here and with another link below.
It is only designed to work with ZoneMinder and there isn’t much advice within the code, but I shall update it as time goes by to make it more useful
Here is the full link to the script: