This one is a bit more complicated, but iāll try my best to explain it in a clear manner (copied, modified, and pasted from another post I previously wrote for a vera).
Overview:
This is actually very straightforward. However, there are quite a few steps involved. Basically, we need to find a way to get the status of an item into a text file the Blue Iris server can read. Once the BI server has access to the text file, you can configure that data to work as an overlay in your BI video.
Requirements:
- Openhab
- Blueiris with macros setup (Direct to Disk should be off)
- A writeable CIFS mount from your OpenHAB to a share on your Blue Iris server to store text files. If youāre running OH and BI on the same machine, you donāt need this, just change the file path accordingly.
Step 1: Set up Blue Iris and OpenHAB connection
Mount a CIFS share to your Blue Iris machine from your OpenHAB server. Make sure you have permissions to write to it from the OpenHAB server. In this example, I will use /mnt/blueirismacros/ as the mounted path.
Create a text file (for example frontyardstatus.txt) in this share on your BI server. Open BI and assign it to a macro under Blue Iris Options; youāll probably want to pick %1 to start with. Put a test message in the file.
Go into the settings for the camera you want the overlay on, and choose the video tab. Click on āeditā under text and graphic overlays. Insert your test file by clicking āadd text/timeā and entering your macro value (%1). Your BI video should now support the text overlay.
Part 2: Create a script in OpenHAB to write to a text file
In your OH server, create a text file in your configurations/scripts folder called filewriterfrontyard.script. This script will take care of actually writing the text file.
Hereās an example set of contents to put in the file
val java.util.Set linesSet = new java.util.HashSet()
val fileWriter = new java.io.FileWriter("/mnt/blueirismacros/frontyardstatus.txt")
try {
val writevalues = new java.io.BufferedWriter(fileWriter,1)
writevalues.write("Garage Door: " + GarageDoorSensor.state.toString + " | Front Yard Lights: " +
FrontYardLights.state.toString)
} finally {
try { fileWriter.close() } catch (Exception e) {}
}
return linesSet
I like using one script per camera for better organization, so on our setup, I have a total of six scripts. Of course, feel free to organize this any way which works for you.
Part 3: Set up OpenHAB rules to call the script
Now we need to run the script to rewrite the text overlay any time one of the items changes. Hereās a sample rule. Make sure the parameter listed in the callScript function matches the name of the script file we created in step 2 (i.e. filewriterfrontyard in this case).
rule "BlueIris Overlay - Front Yard"
when
Item GarageDoorSensor changed or
Item FrontYardLights changed
then
callScript("filewriterfrontyard")
end
Good luck!