The smooth, sultry voice of SmartThings... (or: Is that an Ubi in your pocket?)


(Chrisb) #1

I decided to take the plunge and got an Ubi recently. After a bit of effort (read: Begging) I got on the Ubi beta list for SmartThings integration. There’s parts of it that work really well and there’s still some stuff they need to work on. But I’m having fun with it.

Honestly, my primary purpose for getting Ubi was for voice commands for SmartThings. Granted, Ubi can go a lot more, but it’s great to be able to give voice commands like: Turn on the kitchen light and have it just pop on the light.

Tonight I worked on my first “advanced” Ubi-ST integration effort. Now when I say “Good night” to Ubi it responds by telling me it heard me, then turns on a virtual on/off tile in SmartThings.

I wrote an app that looks at that tile and when it turns on does three things:

1.) It checks if any of selected doors are open, if so, it turns on a different virtual tile.
2.) It checks if any of selected windows are open, and if so turns on yet another virtual tile.
3.) It schedules a procedure that runs in 5 minutes that turns off all selected lights and then turns off all three virtual tiles.

On the Ubi side, if that second virtual tile turns on, Ubi says: “You have a door open.” If that third virtual tile turns on, Ubi says: “You have a window open.”

In a lot of ways this is still a pretty basic level integration between these two devices, but I think it does show some nice potential power. SmartThings gave my house a brain. Ubi, among other things, just gave my SmartThings a pair of ears and a voice.


(Chrisb) #2

BTW, if anyone is interested, I did share the app in the SmartApps section. It’s called “Ubi Goodnight Check”.


(Seth) #3

I don’t see the project on the smartthings projects (maybe I’m being dense, please point the way if I am). Any chance you’ll share it out soon? I’m doing some basic hacking with my Ubi, but don’t want to re-invent the wheel.

Thanks!
Seth


(esung) #4

Finally Jarvis system for the rest of us! Keep us posted. :slight_smile:


(Chrisb) #5

@slandsman,

It should be in the shared apps.


(Chrisb) #6

Just to update some of what I’m doing with Ubi:

Recently Ubi opened up ACB: Advanced Custom Behaviors… The biggest thing is that you can make http requests to Ubi and pass variable data to it. Here’s how I’m using it with SmartThings:

  1. Goodnight/Goodbye Ubi: I’ve written two apps that are virtually the same. When I say “goodbye” or “goodnight” to Ubi it checks if I left any doors or windows open and then tells me, by name, which devices are open. It also turns off selected lights after a given time and changes mode to night or away if desired.

  2. Garage Monitor: I modified the standard Garage Monitor SmartApp so that it not only texts me if my Garage door is open for too long, but also sends the same phrase that gets texted too me to Ubi who speaks it.

  3. I’ve written a SmartApp that allows me to say: “Open the Garage Door” and the door only opens if the Garage is closed. Likewise if I say “Close the Garage Door” it only closes it if it’s open.

  4. I’ve set it up so that Ubi announces when either my wife or my car comes home.


(Patrick Stuart [@pstuart]) #7

@chrisb Just got my Ubi… Care to share with me how you did #4. I would really like to expand on this functionality.

Thanks!


(Chrisb) #8

@pstuart,

Yeah, once you have SmartThings setup on the Ubi portal (send an email to Ubi support if you don’t have it right away… I can’t remember is SmartThings is out of Beta or not), you can just setup your ST devices in Ubi. Then you just use a trigger of your presence sensor when it becomes present is sets off the utterance.


(Chrisb) #9

Also, let me know if you want any of the other Apps I wrote. I can share 'em through the shared apps.


(Patrick Stuart [@pstuart]) #10

Got it set up, would love to see your code if you are willing. Just playing around with this thing right now.

Nice to have an interface into smartthings via the UBI, Have you been able to have the UBI play sounds yet or just text to speech?

Wish there was a bulk way to insert users, but oh well. Wish it could also recognize voices of users…

Thinking of using it as a remote control trigger point for my office.

I don’t want to ask it all this crap, I want it to just know I want to know all this stuff…

Like, in the morning, when I say Ok Ubi, Goodmorning… It will say the weather forecast today is… You have 5 unread emails, 3 unread texts, and your first appointment is at X:XX.

Eventually this will be jarvis… Eventually… With enough time and beer anything is possible.


(Chrisb) #11

@pstuart

I’ve shared all the apps I use with Ubi:

Goodnight Ubi
Goodbye Ubi
Garage Door Monitor with Ubi
Garage check open/close App


(Patrick Stuart [@pstuart]) #12

Thanks… Will take a look at them.


(Chrisb) #13

[quote=“pstuart, post:10, topic:1564, full:true”]Thinking of using it as a remote control trigger point for my office.

Like, in the morning, when I say Ok Ubi, Goodmorning… It will say the weather forecast today is… You have 5 unread emails, 3 unread texts, and your first appointment is at X:XX.[/quote]

Ohh… that’s a really cool idea there @pstuart. I hadn’t even though about potential office usage. Dang.

The problem with Ubi, right now, is that it doesn’t have “SmartApp” ability. I hope, in the future, they get to the point that we can write apps for Ubi like we can do with SmartThings right now.

Oh, one more thing: Take a look at this post of mine on the Ubi forum: http://forum.theubi.com/viewtopic.php?f=3&t=151&p=1160&hilit=wildcards#p1160

I try to detail the syntax of building an utterance as a trigger. If you use wild cards you can get Ubi to be much more flexible.


(Crazy Timmy) #14

I am trying to play with this SmartApp and am having issues getting started. I have published the App to myself but I am now trying to get the token from the Ubi portal.
I go to add a behavior: Trigger: Ubi, Utterance, Goodnight
Action: Web HTTP Request.
Now I have Http Request GET from PORTAL Add Subsequent action
and a spot for URL (what should go in here?)

Not sure where I am going wrong and where I should see the token.

I’m a bit of a noob, any help would be appreciated.

Also, the next step would be to create a virtual on/off tile. Does this need to have a specific name or parameter?

Thanks


(Chrisb) #15

Hey @crazytimmy

Okay, on the Ubi side, you need to setup two custom behaviors:
The first one is the trigger behavior. Here we are NOT using the http request. Instead Ubi is going to turn on a virtual on/off button tile. This tile is what acts at the trigger for the Goodnight Ubi SmartApp.

  1. In the SmartThing api/ide area (graph.api.smartthings.com) you need to go to my devices. Here’s a quite tutorial on doing this: https://www.dropbox.com/s/dhf6scmeve0lq85/Virtual%20Device%20guide.pdf?dl=0

  2. After creating the tile, you need to make sure that Ubi can touch this tile. If you’ve already setup Ubi with SmartThings, you’ll need to add this as a device Ubi can interact with. Here’s some instructions on doing that: http://forum.theubi.com/viewtopic.php?f=5&t=240#p1267

  3. Now in Ubi custom behaviors, setup a behavior so that when you say “Goodnight” that Ubi turns this tile in SmartThings on. (I also add a voice prompt saying something like “Preparing house for night…” or something like that. This is optional though.)

The second one is the response from SmartThings behavior. Here is where we’ll use the http request, but http request is the TRIGGER, not the action.

  1. When you set up the trigger as an http request the Ubi interface will display an access token as part of a URL. This is the token that you’ll add into the SmartApp when you install it, so copy this down.

  2. The action for this custom behavior will be Ubi making a voice announcement. For the text of the announcement you enter this: {variable}

Okay, this should get everything on the Ubi side setup. Now install the SmartApp. Enter the virtual on/off tile you created above as the trigger switch, and put in the token from the second behavior when asked for it in the install process. This just pick your lights and sensors and time frames from there and away you go!


(Crazy Timmy) #16

Thanks for the quick reply @chrisb

Looks like I don’t have the ACB permissions on my Ubi account. I have the ticket in with them to get these added. Other then that I should have everything else setup now your steps were easy to follow (especially when the spot I got stuck at was because I didn’t have that option)

Can’t wait to say G’night to my house :smile:


(Chrisb) #17

Give Ubi support a few days, but if you don’t hear back from them by like Thursday evening or Friday AM, then shoot them another email. Sometimes you need to be the squeaky wheel with Ubi.

Good luck!


(Crazy Timmy) #18

Hey, @chrisb

Got access yesterday and had a moment to finish the setup this morning YAY!

Only issue now is the SmartApp seems to be messed up as far as the fields go. After the Ubi Info and choosing what sensors to check, the optional turn off section has a required field called “number”… no idea what that’s for, and same for lights to turn on has a Which? field and number field being required. and a Should I say “Goodnight” to hello home as required.

I haven’t looked at the code more yet so I’m assuming I can at least make a change to the required issue easily and maybe figure out what the other fields are used for just thought I would post this for your input as well. Won’t get to the code till this evening likely.


(Chrisb) #19

I’ll try to take a look at some of those fields this weekend and see what’s screwed up…

For the optional turn off second, the required number is for minutes later. I haven’t figured out how to require a specific input if and only if an previous input is entered. In an ideal setup, I would ask if you’re turning off any lights. Then if you selected any light to turn off, the program would then require you to enter a delay. But if you didn’t select any lights, then it wouldn’t require a delay entry.

This is the same for turning lights on. I have it optional that the program will later turn these lights out and then I need a delay (in minutes) for these to be turned off.

The idea here is purely personal… when I say goodnight, I want the program to turn off all the lights in my basement and main floor after 5 minutes (give me enough time to close any windows/doors and do other last minute things before bed. (This is the first section.)

Additionally, I want certain lights to be turned on (specifically upstairs hallway and main level entry way light) so that I can see as I’m heading up to bed. These lights need to stay on for 10 minutes or so.

The last item, the “Say Goodnight?” should be required. You should be able to select either yes or no for that.


(Chrisb) #20

On further thought, I suppose I could leave that last question optional and the user would only select yes if they wanted to and it would essentially default to no… but this seems like a relatively minor thing.