“Free” Alternative of Ubi/Ivee - Mac Users


(Cassidy) #1

I created some basic automator scripts to emulate Ubi/Ivee voice control with SmartThings. All that is needed is the REST Endpoint Example and a Mac with OS X Mavericks installed.

First, “Speakable Items” have to be enabled in System Preferences > Accessibility


In the “Listening Key” tab, it can be set to start listening when a keyword is said. In my example, it is when I say “Siri”.

Then, open Automator and for Type of Document select Application.

From the Actions column, click on Utilities and drag “Run Applescript” over to the right.

Input the following into the applescript -

set theURL to "https://Enter/REST/Endpoint/URL/Here”
do shell script "curl " & quoted form of theURL

Save the automator script as “Turn on the lights” or whatever the rest endpoint url executes. Save the automator script as a speakable item.I created multiple copies of the automator script and saved them with different filenames like “Lights On”, “Let there be light”, etc. so I could have some flexibility on the phrasing.

If you want to add a bit more Siri look & feel, you can make the automator script reply to you by voice. From the Actions column, click on Text and drag “Get Specified Text” below the applescript and input whatever text you want automator to say. Again from the same Text tree, drag “Speak Text” below “Get Specified Text” and select a voice.

The mac may not have the hearing range that the alternatives do, but I’m sure this could be improved with some cheap microphones.


(Ronny Carr) #2

I want to kiss you @nelemansc.


(Jon Allsebrook) #3

This is ridiculously great!!!

One thing is though (and i don’t know applescript) is when I put in the code for the applescript its all purple (not different colors as in your screenshot) and when I run it I get the following error -

A identifier can’t go after this “"”.

Any thoughts as I really want to get this running and am thinking I can set up some wireless mics in the house!


(Ronny Carr) #4

Ran into the same problem @jonallsebrook, just use this and it’ll work:

do shell script "curl https://url"

(Jon Allsebrook) #5

Thanks Ronny…its not working consistently for me but its late so will take another look in the morning… awesome possibilities though!


(esung) #6

Wow this is cool. Thanks a lot for sharing @nelemansc Now only if Siri would open up APIs and work with any apps!
This should be featured in the blog section.

And where can I get more information about REST endpoint example? Is it possible to not just get switches but also status?

Thanks


(Cassidy) #7

Glad it’s working for you all as well!

@esung Here is some more information on the rest endpoint example. As far as reporting status, I think it would be doable with hosting a web server from the mac and using httpget from within a SmartApp to fire off the automator scripts, I haven’t had time to try it out yet though.

@jonallsebrook Let me know if you have any luck finding wireless mics, I would like to have something similar setup!


(esung) #8
I think it would be doable with hosting a web server from the mac and using httpget from within a SmartApp to fire off the automator scripts

I’m not very familiar with applescript or any coding in general but this sounds pretty substantial. Possibly a lot more can be done with ST and Mac. Makes me want to learn applescript and automator! :slight_smile:

For now I’m interested in making a webpage with bird eye view of my home and the rest endpoint url buttons on their respective location on the map. If I could get status reporting I imagine I could use toggle url buttons with light on/off status reflected on button icons. Just imagining without proper knowledge but everyone always starts somewhere :slight_smile:


(Jon Allsebrook) #9

@nelemansc works well when it understands my accent great work and thanks again for sharing! Sadly my search for a wireless microphone solution is coming up short especially for one I can just leave in a room somewhere as they are either bluetooth (not great range), USB (needs rather long cable maybe doable), or ridiculously expensive so may as well buy an Ivee or an Ubee. So if you can or anyone else can find a good solution please share!

@esung I am actually working on something thats a locally served webpage for my own use with nice switch buttons so I can serve it as a local app on iPhones and iPad mini’s. That way guests and my wife can easily control ‘things’ such as lights without using the SmartThings app which as I posted in another thread just gives too much access to the system for most users (i.e they could mess things up!). I have no idea right now how to pull in information to that webpage (status/temp etc) but hoping that Twack will be sharing his code for a web interface at some point maybe so I can get some examples. I just don’t have the knowledge right now!


(Cassidy) #10

@jonallsebrook I’ve got a Kinect for 360 that I’m not currently using, I’m gonna see if I can get it talking to my mac with this tutorial. I’m sure there could be a lot of cool uses with a Kinect sensor and its capabilities (motion, sound, Image Capture, Illuminance Measurement, etc.) If anyone has any experience with OpenKinect feel free to chime in!


(Jon Allsebrook) #11

@nelemansc I have a Kinect sat in a closet too so if you can come up with something for using that would be great!


(Cassidy) #12

@jonallsebrook no luck unfortunately with the Kinect. I tried setting it up both with OpenKinect & through a virtual machine with VMWare Fusion. The OpenKinect route needed the OpenNI SDK (v1.5.4.0), but I could not find anywhere online that still had it available. The VM route needed a “Kinect for Microsoft”, not my “Kinect for 360”. I guess it wasn’t meant to be. I bit the bullet and ordered a cheap external USB microphone off Amazon.

I also got rid of the text-to-speech robotic voice. Thanks to a voice impersonator and $5, I now have Morgan Freeman responding to my voice commands!


(Different Computers) #13

This is potentially amazing.

Kind of like what I would love: an Applescript plug in for ST! Suddenly we would have hooks into AirPlay, which potentially turns ANY stereo into something like Sonos, all for $99 or less!


(fightingmajor) #14

I’m running the beta of 10.10 and this option (speakable items) has been removed as far as I can tell.


(Cassidy) #15

Well that’s unfortunate… could they be ditching Speakable Items for a true Siri integration?


(fightingmajor) #16

If they are it’s nowhere to be found and was not discussed at the unveiling.


(Convinced ST will never be unbroken…) #17

It is in there (under dictation), but is broken here.


(fightingmajor) #18

I see what you are talking about and I can control the computer using it. What I do not see in there still is the ability to start it by saying something. It seems the only way to activate it is to turn it on and leave it on.


(Cassidy) #19

not sure how it is setup in 10.10, but in 10.9 there is an option to set a keyword. Once the keyword is said, the computer starts listening for 30 seconds. This is found in System Preferences > Accessibility > Speakable Items


(fightingmajor) #20

Yes this is the option I was referring to that is no longer in 10.10. You can have it start listening by hitting a certain key, but there is no option to start listening by saying a keyword (ala siri).