Octoblu SmartApp (BETA)

Nate, you’ll be very pleased to see this: https://www.hackster.io/andrewstein/home-security-with-smartthings-via-octoblu-764873
Please give it a try and see if you’re successful with this newly launched effort. And, yes, Chris Matthieu is a major driving force and you can expect a lot of amazing things to be coming out of his lab as a fruit of his efforts.
–Tobias

Tobias,

I will check this out. I was able to set up a successful test to connect OctoBlu to my SmartThings Hub. Got my lamp to power on and power off. Good start! :slight_smile: Thanks alot for the link!

  • Nate

Nate,
You’re more than welcome. It took some pushing on Samsung as this effort started a year ago, and I was very pleased to see the interest in it rekindled. Feel encouraged to publish any of the flows/bluprints you develop that you’d like to share with the community!
–Tobias

Tobas,

I am trying to import the flow to my account. However, I realize that I can only see my Outlet and two Multi-Purpose sensors. It will not allow me to recognize the motion sensor on my Hub.

Still learning about the integration, but I was able to trigger the outlet thru Octoblu flow…

So far so good…

  • Nate

*** Follow-Up ***
In SmartThings Web Interface, I had to change my motion sensor type (My Devices…Motion Sensor…Edit…Type) to “SmartSense Motion/Temp Sensor”. Then the OctoBlu SmartApp was able to detect it. Things are starting to get recognized, and I am developing test flows on sensor data.

Pretty Cool! :slight_smile:

Was excited to see this, went and copypasta’d the code (no github integration?) and I get this 11:24:03 PM: error java.lang.NullPointerException: Cannot get property 'authorities' on null object Ahhh, SmartThings, gotta love it

Have to be really careful with cut-and-paste operations to be sure to get all the characters (and not more) and to not mess up line breaks, etc. Did you get the new source code?

Tobias,

I have set up this demonstration in OctoBlu Flows. It works (except for the voice, since I am running on Win-10).

I would like to make determination of the Mode I am currently set to. If the Mode is “Home” do not trigger the motion sensor alert. If Mode is “Away”, then go for the alert.

How would I be able to get this information from ST?

  • Nate

Nate, I just placed an order for a hub and so cannot tell you at this point how to query the mode option. My guess is you’ll need to of course first set it up and then what I’d do is connect a manual trigger and a debugger to it so you can see what output it delivers when manually triggered. From that it should be possible to figure out the pointer to the location state from he debug output. If I manage to figure some of this out within the next week or so once I finally have one of these units in hand, I’ll gladly publish whatever flows I’m able to create.

Tobias,

I imagine that somehow, the SmartApp needs to be associated with the Hub. Right now, it seems to me that the OctoBlu SmartApp only associates with Things unless I am missing something obvious.

I am able to query the Things and get output from the debugger. If there were some means of querying the Hub or the IDE through the SmartApp, there is a myriad of data available including the Location.

I am happy to help with any debugging of flows related to the ST integration, if you would like some assistance. I’m not anyone’s excuse for a developer, but I’m willing to hack at it!

Thanks!

  • Nate

Hi Nate,

The SmartApp is associated to a hub in that the app needs to be installed to a specific location, and each location only supports one hub.

I like the idea of creating an Octoblu device that represents the hub and can query the Hub, Location, and Mode APIs. Thanks for the feedback!

-Erik

Erik,

Thanks for the note. Same offer… If I can assist with the hacking, let me know!

  • Nate

Indeed. If one has multiple hubs, they should be able to work independently of each other, at least unless one wants to somehow connect them.

BTW, is there a way to query for the date and time via Octoblu other than the “sentiment” tool? I’d like to be able to check or schedule something based on date and/or time ranges as opposed to just using a timer and then have to do all sorts of comparisons to see if valid or not.

I’m of course all in when it comes to helping any way I can. I have lots to learn, being a novice at a lot of this, so hopefully patience will prevail! :slight_smile:

–Tobias

Nate,
Just got the unit tonight and can already give you a response. If you introduce your “Home SmartApp” as a Thing into Octoblu, you should be able to feed its output to a “compose” tool and configure it with:

Value 	                   Key 	

{{msg.payload.mode}} payload.mode

and check if {{msg.payload.mode}} = Home with an Equal tool, and if true, then branch accordingly, for example.

You may need to download the latest Octoblu code for this to work, which Erik just put in place earlier today (plus he also helped me tremendously with some debugging assistance!).

–Tobias

Tobias,

Yep! As soon as I re-published the SmartApp with the new code and re-authorized in SmartThings, OctoBlu reported the available OctoBlu Thing.

Many thanks to you and to Erik for your help in putting this out there!

Great work!

  • Nate

That code above just identifies the hub name (“Home” in this case, which was a bad choice as it’s also a potential location token setting). Just wanted to clarify that, but the point was that’s where various settings are now accessible. To get the multi-values list of the status you need to use payload.modes which will return the hub status (like “Night”), the hub name (like “Home”) and the state (like “Away”).

Erik,

How about an OctoBlu device which represents a ROUTINE?

Here is my thought… I am using the ARP table on my router to establish presence. It works great! However, the next step would be to initiate some action on the SmartThings hub (turn off lights, lock the door, set the alarm, etc…).

But, as fate would have it, I have a routine which I kick off when I leave the house (“Goodbye”) and when I return (“I’m back”) which perform just the tasks I need performed.

So I would love to see an opportunity to use OctoBlu to kick off the routine based on the results of my presence detection.

I looked at the SmartApp. I was quickly overwhelmed by the code. I would love to learn Groovy in my copious amounts of spare time, but I think you or Steve might have an easier go of it? I am willing to help out with the testing, and to share my flows with any and all.

Thanks!

  • Nate

Nate,
Using the Internet or bluetooth, your SmartThings Phone App can be used to determine and/or set you location, as well as I think there is a way to let the GPS help in that capacity. Once set, it shows up as a hub setting, which you can query and trigger on in various ways, including via Octoblu. See for example a very cool extended example of this in the video shown here: https://blog.smartthings.com/news/smartthings-updates/smartthings-bmw/ . I don’t think you need to do any recoding of the interface (Groovy) itself to accomplish this! See also: Smartthings BMW connected drive
-=Tobias

Tobias,

You are correct. The GPS geofencing properties are available, but are known to be flawed and unreliable.

I was looking for an alternative means of identifying presence by utilizing the WiFi router ARP table. I am now getting reliable detection of a device proximity. This is done through OctoBlu making a call to the router via HTTP and extracting the known MAC address of the phone.

But since this is now external to SmartThings, there needs to be a return call to SmartThings to perform the desired activities. As I see it, the easiest method is by using the existing Routines which have been programmed to be performed manually (Goodbye and I’m Back). So if OctoBlu were able to see the Routines as a “Thing”, it could be triggered as part of my flow.

Thus my query for modifying the existing OctoBlu SmartApp. If I were any good at coding, I might try it myself, but I’m a little over my head with that! :slight_smile:

Thanks for the reply!

  • Nate

Are the coordinates really off by that much to make a difference?

Tobias,

It is not a question of coordinates, but of functionality. If you do a quick search in the community for “mobile presence”, you will see long-standing threads of frustrations with mobile phone presence detection, both in iOS and Android. To the extent that most users pay for a separate Presence Sensor.

There are several suggestions and smartapps which focus on working around this issue. I chose to look at using the WiFi router as the detection model.

The addition of triggering Routines is not just for this application, but I can see other OctoBlu integrations taking advantage of this as well.

Thanks!

  • Nate