Ubi ACB (Advanced Custom Behaviours)

Development related questions, API questions and documentation, questions about integration, API/custom behaviour suggestions, how-to documents and all the nitty gritty.

AuthorPost

Ubi ACB (Advanced Custom Behaviours)

JasonUser avatar
Admin/Team Ubi
 
Posts: 295
Joined: Thu Apr 10, 2014 4:17 pm

Post Posted » Thu May 22, 2014 5:32 pm

Ubi ACB - Advanced Custom Behaviours Public Documentation

Sign up here.

General Information
So we have recently released a public API for ambitious users to try. Based on some preliminary feedback, people really like it but we feel it is too complicated for most people to understand without some help. Because of this we have integrated a large portion of our API into our custom behaviours so that users can do all these neat things without having to build their own complex webapps, in particular the OAuth2 implementation and token renewal. In fact you don't need API access at all to do most of these, we still need to elevate your account's permissions to use the advanced custom behaviours though.

Don't be alarmed if your My Apps link is missing... you no longer need it unless you would like to create an application for public use.

Advanced Custom Behaviours will be tailored for users who wish to do more with their Ubi provided they are a little tech savvy, you can integrate code, hit your own server and make Ubi speak all very easily without the API. This level of access is for those who want to make an application that only you are going to use. Instead you can use regular expressions to pass parameters to portal as voice then act upon. Choose which light to turn on/off, choose what you would like the trigger utterance to be.

How does the Ubi work?
The Ubi runs Android and has a persistent connection to the Internet. It hosts a supervisor app that is able to detect a local trigger word and then perform a command based on whatever is spoken after the trigger. The Ubi runs a set of local natural language understanding algorithms to decide the intent of the user. Based on its understanding of the command, the Ubi will fetch information from various Internet services and present this information back to the user through speech.

Custom behaviors allow the Ubi to trigger different events based on either the Ubi sensing a change in the environment or if someone says a particular command to the Ubi. These are programmed on the Ubi Portal and run from there.

What can I do with the Ubi ACB

  • Make Ubi speak a predetermined phrase built in custom behaviours
  • Make your app/server hit an Ubi custom behaviour action, based on HTTP request trigger
  • Use regular expressions to pass parameters to your custom behaviour via voice
  • Control an Ubi remotely based on predetermined custom behaviours
  • Send email/text message to your contacts from an HTTP request
  • Have your Ubi make behind-firewall-HTTP-requests based on incoming HTTP requests to Ubi servers.
  • Mix and match the above to make a unique Ubi experience


Getting Started

  1. Login to Portal
  2. Click an Ubi, click "Add New Bahviour" button
  3. Click "Select a device" drop down", then click "HTTP Request"
  4. Shown is the exact URL to use in your webapp (or in a browser to test it) for this particular behaviour
  5. Save the custom behaviour, Ubi will say updated

We plan to add basic if/then/else statements in the future to help reduce the large number of custom behviours one might have. To make your requests more dynamic you can use regular expressions where similar custom behaviours might change a little.

If you previoulsy had API access and would still like API access, please create a support ticket here. Include what you be doing with the API, be as specific as possible. If you are developing an app on behalf of a company, please state the company name. Also don't forget to include your portal id in the request.

More guidance with examples and some pictures coming shortly.

Thanks.

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Mon Jun 30, 2014 3:06 pm

Sounds great! I signed up for access.

Re: Ubi ACB (Advanced Custom Behaviours)

walle
 
Posts: 3
Joined: Thu May 08, 2014 6:15 pm

Post Posted » Tue Jul 01, 2014 5:27 pm

I got access today and have tried out with an access token. I like it, but I can't make a voice announcement from the url. Eg. https://portal.theubi.com/webapi/behavi ... nce=Hurray.

Is this something supported right now? Or am I missing something?

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Tue Jul 01, 2014 7:04 pm

When did you request access walle? I'm still waiting here. :cry:

Re: Ubi ACB (Advanced Custom Behaviours)

pedroruben9
 
Posts: 1
Joined: Wed Apr 30, 2014 6:43 am

Post Posted » Wed Jul 02, 2014 5:17 am

I'm still waiting too :(

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Wed Jul 02, 2014 2:53 pm

Woot! I've got access now. So, the real important thing for me right now is this:

Use regular expressions to pass parameters to your custom behaviour via voice


What does this mean? Does this mean we can pass a value (ie, phrase) via the http request and have Ubi say it? Here's my an example of how I want to use this. I have it setup so when I say goodnight to Ubi, Ubi then interacts with SmartThings and initiates a program on SmartThings. One of the things it does it check is a window or door is open. If it is, then Ubi says: "Wait, a door is open" or "Wait, a window is open."

But what I want to do is have Ubi say: "Wait, the living room window is open" or "Wait, the garage door is open." Smartthings can generate the name of the window or door that is open. Can I then have SmartThings make a HTTP Request like: https://portal.theubi.com/webapi/behavi ... n=*token*&text="living room window". Then have the action be an utterance like: "Wait, the " $text "is open."

Re: Ubi ACB (Advanced Custom Behaviours)

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Wed Jul 02, 2014 5:23 pm

For HTTP-in trigger, regular expression wouldn't apply but it would apply for setting up an utterance as a trigger.

You're getting close for your trigger but the formatting is a little off. You'll use the same URL but for action, you'll enter it like below in the announcement field:

${variable}

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Wed Jul 02, 2014 6:27 pm

Leor1 wrote:For HTTP-in trigger, regular expression wouldn't apply but it would apply for setting up an utterance as a trigger.

You're getting close for your trigger but the formatting is a little off. You'll use the same URL but for action, you'll enter it like below in the announcement field:

${variable}


Thanks um... I think... I'm not sure I followed exactly what you're saying here. Can I pass the variable as an HTTP trigger? How do I format the https request?

I think you're saying my action utterance would be Wait, the ${variable} is open. Is that correct?

EDIT: Okay... I'm going change that to a definite THANKS!!

So, if I add &variable=[insert text] to the end of the https request, and then add ${variable} to the utterance, then it says the word I put in the 'insert text' area. Now to test a phrase.

Re: Ubi ACB (Advanced Custom Behaviours)

karpantschofUser avatar
 
Posts: 4
Joined: Fri Jun 20, 2014 5:19 pm
Location: New York, NY

Post Posted » Wed Jul 02, 2014 7:07 pm

For all you good people using custom behaviors and the API:

If you want to be a part of the Ubi Catalog and share your creation with the rest of the developer
community, please don't hesitate to head to http://bit.ly/1kfDJG6 and fill out the form, and I'll
get back to you right away (or you can write me directly)

//Daniel
Daniel Karpantschof
Development Community Manager
Daniel@TheUbi.com
C: +1 (202) 525-6190

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Fri Aug 01, 2014 9:01 am

I thought I read/saw somewhere that there is a 256 character limit to the Http request, but I can't for the life of me find where I supposedly read/heard that.

Anyone know if I'm just imagining things or if this is real?

Re: Ubi ACB (Advanced Custom Behaviours)

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Sun Aug 03, 2014 11:59 pm

We did apply this as a limit. I believe we upped it to 512 because it was too easy to hit this limit.

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Mon Aug 04, 2014 8:42 am

Thanks for the info.

The reason I asked was I was changing how I was feeding info to Ubi from SmartThings in order to simplify things.

Previously I had it set so that my http request trigger caused Ubi to utter this phrase:

"You have left {variable} open."

The http request would send the list of devices as the variable. This was part of a SmartApp that checked if I left any doors or windows open when I went to bed at night. The problem is that I wanted to change my app so that if everything was closed that it still gave me an announcement saying everything was closed. This way if there was some glitch in Ubi or SmartThings and my SmartApp didn't run properly I'd know because I never heard a response.

The issue comes in that if I do this I obviously don't want Ubi to say: "You have left The House is ready for bed open." So then I need a new trigger with a different token for this phrase. And any other phrases for other apps will all need their own http request trigger as well.

OR.... I can just change the phrase I want Ubi to say to be this: {variable} Now I pass the FULL phrase that I want Ubi to say. Now I only need to ask for one token when install my SmartApp and I can just use IF-THEN statements to send what I want to Ubi.

Furthermore, I can use the same token for any number of SmartApps. I have another app where Ubi reminds me if I've left the garage door open. This uses the same token now. Essentially, as long as I don't hit that 512 limit I can reuse the same trigger for any SmartApp.

Re: Ubi ACB (Advanced Custom Behaviours)

xathrosUser avatar
 
Posts: 64
Joined: Fri May 09, 2014 12:24 pm
Location: Republic of Vermont, USA

Post Posted » Tue Aug 05, 2014 1:38 pm

I know this is the wrong place for this question but since the announcement threads appear to be locked:

Any update on when the missing custom behaviors might be returned to our accounts?

Thanks

-Xathros
...OK Ubi, Sign this post
--
Xathros
Integrating UBI with ISY-994 HA Controller
http://www.xathros.com

Re: Ubi ACB (Advanced Custom Behaviours)

thecolor
 
Posts: 113
Joined: Tue May 06, 2014 6:22 pm

Post Posted » Tue Aug 05, 2014 2:45 pm

xathros wrote:I know this is the wrong place for this question but since the announcement threads appear to be locked:

Any update on when the missing custom behaviors might be returned to our accounts?

Thanks

-Xathros


OH, SO plus 1 +1

I really don't want to have to re-create them and re-associate my programs. :|

crossing fingers that a local backup (at least in csv format) for local / independent restoration or UBI to UBI transfer is added at the same time. :D

Re: Ubi ACB (Advanced Custom Behaviours)

RedRamage
 
Posts: 97
Joined: Wed May 07, 2014 11:05 am

Post Posted » Tue Aug 05, 2014 3:33 pm

For what it's worth:

When it first happened I re-created a few of mine and the next morning they were gone again. Then I created a few more and within a day they disappeared as well. Since then I've slowly been adding them back in and they've stayed in place, so fingers crossed...