SmartThings Community

Blue Iris


(Minollo) #1

Has anyone worked on building a virtual device type for the Blue Iris surveillance system?
I have a couple of Foscam cameras, and I use the Blue Iris software to record/manage the video streams and handle motion detection. It would be great to integrate that with ST at least to start/pause the recording when I’m away/back.
They seem to have a REST API (someone also wrote a little command line utility based on it: http://www.cam-it.org/index.php?topic=4722.0), but I’m not sure how easily it can be accessed by a virtual device (or if it can at all; I see they mess with MD5…).

Minollo


Camera help
(Dan Lieberman) #2

@minollo – You could write a device type for it if you wanted manual controls or to expose more functionality in a standardized way, but if all you want to do is hit their API to start and stop recording based on presence or some other event, you can do that in a SmartApp and wouldn’t need a device type handler. With the presence example, you’d subscribe to the presence events for the devices that you care about and just use the HTTP methods to hit the API. Keep in mind, if the Blue Iris device is on your local network, you’d need to open a port on the firewall so that the SmartThings Cloud can talk to it - at least until support is added to talk to local LAN devices through the SmartThing Hub.


(Minollo) #3

That’s a very good point; and it does makes things much simpler for me.
About MD5: do I have access to all the standard JRE libraries from the smart app’s language? Do I need to do anything special about it? Or is it just not possible today?


(Dan Lieberman) #4

@minollo – You can generate MD5 hashes on a String by using the encodeAsMD5() method of the String class. For example:

def myString = "hello" def myHash = myString.encodeAsMD5() log.debug( myHash )

I hope that’s helpful.

-d


(Minollo) #5

Indeed; thanks so much.


(Minollo) #6

@dlieberman : thanks again! It has been quite easy to create an app to associate the recording/alerting status of the cameras registered with Blue Iris with the ST app; pretty neat.


(Fishtek) #7

@Minollo : Would you mind sharing your app? I too have blue iris and would love to get it integrated (as much as I can) with ST.

thanks!


(Minollo) #8

Sure; it should be share now.


(Tony Gutierrez) #9

How do I find this app to use it myself? The whole ST app system seems screwed. Searching for blue or blue iris gives no results.


(Amauri Viguera) #10

Create a new SmartApp and browse the shared apps (top right button).

The “Manage Blue Iris” app is on the Safety & Security category.


(Tony Gutierrez) #11

Holy shit…thank you! You would think that little drop down would be more prominent!


(Tony Gutierrez) #12

So I added a smartapp “Blue Iris profile integration” that toggles blueiris profiles depending on ST mode. I use it in conjunction with another guys “auto away/home with presence” app and it all works pretty well. I set up 4 modes, home day/night, away day/night, and corresponding blue iris profiles.


(veni) #13

I do use the “Blue Iris profile integration” as well but I have tweaked it so it can toggle between profiles and set them permanently (Hold profile) now @Tony_Gutierrez can ST’s motion sensor send a trigger event to BI to start recording?


(Tony Gutierrez) #14

I dont use scheduling in BI, so had no need for the “hold profile”, as my profiles are always held. Triggering recording from an event is possible but it is probably easier to just let bi handle it. If you did want to do it your smartapp would need to subscribe to the motion sensor and use the BI api call to force a record.


(llcanada) #15

@minollo did you have to set up a device type to use your program. I have the camera set up but i can’t get your program to work? can you help me to set whatever I need? Thanks


(Minollo) #16

No need for a device type; as long as the app is able to connect to your Blue Iris server (note that the server must be reachable from the Internet, as the application is running on the Cloud), and the camera name matches its Blue Iris name, you should be all set.

If things don’t work, a good starting point is examining the log file, and seeing where the exceptions are taking place (admittedly, the application has very poor error handling right now).


(Brian S. Lowrance) #17

Is there a version of this that uses physicalgraph.device.HubAction to keep the traffic local?
http://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-types-developers-guide/building-lan-connected-device-types/building-the-device-type.html

And/or can you use this with HTTPS, using STunnel for BlueIris? I’ve tried, but it fails, perhaps because I am using a self-signed certificate? Anyone know if I use a trusted cert in STunnel if it will work? I’d rather not have my credentials flowing over the Internet unencrypted.


(Minollo) #18

No, I didn’t make a version to keep traffic local.
I do use stunnel to access blueiris; it works fine.


(Tony Gutierrez) #19

If you end up making a device type let me know! My version is not that secure, I agree.


(Tony Gutierrez) #20

So looked into using STunnel. Its great for a lot of things, but cannot be used with Smartthings if you are using a self-signed cert.