Rest api, multiple users, voice control

Yes…there is a setting where you can tell it to use a trigger word to start listening. I have used it that way sometimes as well. I have a rule in openhab that is a switch that determines if it should disable listening while playing. It can be turned on or off. That way it gives me the option of using the voice commands.

Kim

That’s really helpful thank you.

One more thing i forgot to mention. I have the one in my living room running on the new intel compute stick. It is a 32 bit version of windows and you cannot change it to 64. So I still have not setup my kinect for xbox one yet as i dont have a 64 bit windows pc with usb 3.0 yet. Waiting for prices to drop and then will have a 3rd one running kinect 2.0. I have read that it is an even better mic for home auto. It just needs 64bit windows with usb 3.0.

Both of mine are using the kinect from the 360. got them off craigslist for 20 each.

You can make the start listening command anything you want and it can also do wordlists so one command can be setup for 100’s of different variations. ie (turn off the light, turn off the bedroom light, please turn off the kitchen light,etc). almost any combo you can think of. I have one command in links that can turn off any light in the house and i can ask it it 100 of different ways. I really like it and use it more than more than my phone for issuing command to openhab.

My idea of home automation is that i should be able to give voice commands to the house and that i rarely interact with the house for most things. The system knows what needs to be done and does it without my input. If i have to use my phone all the time the system isnt working right.

I put a few items in openhab that restrict the low temperature setting of the thermostat. My kids keep setting it to 65 whens its 103 outside and electric bills where too high. So now when an attempt is made on my ecobee theremostat to lower the min allowed temp in openhab. A voice warnign is broadcast to both llinks indicating of the violations. lol. and then it resets it back to the lowest allowed. i also get a text so that i know they tried. lol. The links in the living room is “jarvis” and uses ivona brian as the voice. The pc in my bedroom is “Friday” and uses ivona amy. I can do things like broadcast messages to each pc for the movement in the attic, or weather reports or home status reports. all by voice. I used the sample alarm clock code for openhab and now Friday wakes me up in the morning . Complete with snooze.

Do lots of voice training and let your imagination go wild. It works and works well.

This is really useful, thank you. I love that “jarvis” is now telling your kids off for messing with the thermostat. They must love it.

A question about the compute stick: how does that work with the voice feedback? Obviously with a laptop/PC you can just use the speakers as output - how do you have this set up?

If it is plugged into a TV I guess it can only use the TV sound output when the HDMI input for the HDMI socket that the compute stick is plugged into is selected? So wouldn’t work if you were watching your apple TV through another HDMI input?

I have a kinect 360 so the 32 bit windows will be fine for me for now.

Hi again,

So I now have my intel compute stick with LINKS installed, and it’s just what I was looking for. Kinect picks up the audio really well and using it to activate openhab switches is seamless - the reaction is almost instant.

Reading through the forums, I found one of your posts on there in which you were asking about how to get information on the state of your openhab devices into links, so that you could ask for status updates.

You’ve tagged the post as “solved” - did you ever work out how to do this? I’ve tried a few things, but not managed to figure it out.

I strongly encourage people to have a look at this as a method of controlling openhab. It really works well and you can set up dynamic commands to that you don’t have to remember the exact phrasing: turn the lights on, turn on the lamp, switch the lamp on, put on the lights, etc, will all have the same effect.

Plus it’s the closest you’ll ever get to being Jean-Luc Picard!

Hey, glad you like it!!! Its the best kept secret around…lol. I’ve tried screaming from the rooftops but unless its what people want to hear… I also love the fact that its all local, no sending to the cloud.

As far as getting openhab stuff into links, i’ve just done what i originally said to do. All the processing is done by openhab. I created some switches that i use to broadcast stuff to each links or both at once. So i can say anything for any reason on either of them. So anytime something happens in openhab i have a rule to decide if it needs to be announced.

So far i’ve added a few things to my rules section.

  1. ability to turn off all broadcast to a specific machine (friday or jarvis). If the switch is on then nothing gets broadcast except emergency stuff (security alarm, water leak etc. those cannot be turned off).

  2. one for “announce after midnight”. I use this in case i get tired of hearing that my son has the garage open after midnight as its a thing openhab checks for and announces/texts me. Also, keeps the fish feeding announcement from going off at 6 am unless i want it to. “after midnight” for me means after midnight but before dawn.

  3. Individual event announcements can be turned on and off. These switches are for all instances of links. (friday and jarvis). I have one for fish feeding, thermostat control, attic motion sensor, etc. This way i can keep announcements on but turn off the fish feeding one.

  4. i have volume controls for each instance of links in openhab. Three for my bedroom and two for the living room. One is called “emergency volume” and is used for all important announcements, ie security , intruder, water leak etc. This is set louder than the normal one. I use the http commands to set the volume in links from openhab. Also, i use the speakex web command so i can use any voice or volume. The second one is for normal announcements and talking to friday or jarvis. The third one is for the alarm clock in my bedroom and is set much quieter. The living room one does not have an alarm clock. I setup 3 alarm clocks in openhab since i have 3 bedrooms. So when i add new links to each bedroom they will have their own alarm clock. I also used voice commands in links to set the alarm clock time, turn on and off the alarm clock and to snooze the alarm clock. I just use wordlists in links to send a web request to openhab. Works great!

Would be happy to share come of my stuff if u want it…its about as neat and tidy as u could expect from a part time script writer. lol …

Look into using different voices for different announcements. All the broadcast announcements are in ivona brian voice (jarvis), even when broadcast in my room. The ivnona amy (friday) voice is used only in my bedroom as it just sounds better to me. lol.

glad to find someone else using this!!! would love to share more ideas.

Kim

Forgot to answer your question…

For status reports or inquiries to openhab i do the following. This is how i ask jarvis or friday what the thermostat is set to.

  1. In links, i have a shell command that looks like this:
    COMMAND: {ai=ailist} {w=what} the thermostat set {t=to} {m=manners} ACTION: sendcmd 2-thermostat

using word lists in the command this one statement in links can be
Friday what is the thermostat set to
Friday what is the thermostat set at
Whats the thermostat set to please

etc ,etc.etc… can be as complicated as u make your wordlists.

  1. sendcmd is a script that sends the http request to the rest item in openhab.
    so openhab receives an item with the value “2-thermostat”. I parse out the 2 and the thermostat and then build the text i want to speak. The “2” just tells me what machine to speak it to. So now openhab knows what info i want and which instance of links to speak it on.

Once you have it set up you can pretty much have openhab respond to just about anything. Some of the things i can ask are: thermostat, inside temp, outside temp, garage door status, light status, whos at home, status of motion sensors, cameras, etc etc…sky is the limit.

i also have a script for links that just turns switches on and off in openhab Sendonoff switchname ON/OFF.
i use it to turn items in openhab on and off. Combine it with word lists and a single command can allow you to turn on or off any switch using 100’s of different spoken commands.

Also, i have written a pretty cool weather script for links using wunderground that you can have if u want…let me know.

Kim

lol one more thing…for my compute stick i bought a cheap bluetooth speaker on amazon for like 30 bucks. The computer stick has killer bluetooth and it works really well for me.

I ordered this but when i got it it was always cutting out the first second or so of voice. So i sent an email to them and they sent me an updated version for free. So now i have two of them for 27 dollars. i have the first one in my shower as it works great for music.

Hey there,

Thanks for your replies, really really helpful.

It did make me chuckle as I was trawling through the LINKS forum the past day or so (for some reason the search facility always brings up zero results) and every now and then would come across one of your posts relating to how you set up the above - in pretty much every one you asked a question and then had figured it out yourself before anyone else had replied!

I’ve only been tinkering for a day so haven’t got far at all, but it’s already far superior to my previous set up. One of my primary goals was to banish the eight thousand remotes that were needed at home: TV, DVD, Apple TV, TiVo, Xbox, HDMI Splitter, every time I wanted to change what I was watching it was a 12 step process. With an orvibo ir blaster I had setup up openhab to control all of this. I have workflow on my iPhone so that I can drag down the notifications window and hit the “watch apple TV” button, which is ok, but still requires finding my phone, fiddling with it etc. I set up homekit so that I could say “hey siri, watch apple tv” which worked well, but again required my phone present, wouldn’t always hear me, and if I wanted it to work with different phrases I would have to manually input every possibility.

With very little effort, LINKS now controls this much more easily, with no need for my phone and without the need to remember the one specific phrase that works. Plus the added bonus of LINKS responding to my commands with whatever randomised collection of “hilarious” responses I choose to program it with.

My next step is to move on from LINKS (mine is called Computer) being simply a switch flicking machine, to being able to provide feedback, such as giving me the outside temperature, indoor humidity, CO2 levels etc on demand. Sorry, I’d forgotten that you gave a detailed explanation of how you did this in the original post - that’s exactly what I was looking for. So the next step is to set up some rules and generate the required strings to send back to LINKS.

I agree with you in that I would much prefer to do this in openhab. I don’t envision switching away from Openhab any time remotely soon, but there may be another front end that appears that I decide to change to at some point. It should be a case of just amending the httpgetrequest to whatever the new system uses and the whole thing would be up and running. If the response generation was done in LINKS and then I swapped this out, you’ve got to start again from scratch.

If you are happy to share your scripts then they would be very gratefully received. The last programming I did was in Pascal in 1997, so my rules and scripts tend to be very messy and long winded, although they usually do what I hope! I’ll send you a direct message.

I did buy a bluetooth speaker when I ordered the compute stick. Unfortunately mine doesn’t seem to like long periods of no audio, which is the case with LINKS. By the time it figures out audio is being sent, LINKS has usually stopped speaking. So I’ve ordered a cheap usb audio speaker and a cheap usb hub - I’m hoping this won’t have the same issue. My bluetooth speaker is now also in my bathroom.

One final thing. After a few false positives of the lights turning on and off at sounds that bore no resemblance to speech, I set links up to stop listening after 10 seconds, and start listening when it hears “computer”. After the response I can then give the appropriate command. This does seem to work most of the time; after 10 seconds I can say “turn the lights on” and nothing will happen. The only issue I found is that for some reason the auto stop listening function would stop working. How do you have yours set up, and how are you finding the false positives?

Thanks again for your help with this. It amazes me that both on here no one is really using LINKS and that in the LINKS forum no one is really using openhab. I’ve seen many posts about how to operate a single wemo socket, but with openhab the same concept could control everything. For me, they seemed ideally suited.

I think part of the problem is that LINKS is windows only and my guess is that most OpenHab users use a real operating system… :wink:

Ha, very true! But it only cost me £60 for an intel compute stick. Once LINKS is up and running I never have to actually use windoze :wink:

yes…as soon as you say windows no one takes you seriously…lol. oh well…i am very happy with how its working.

be happy to share scripts…dont know how to send email directly on this…but maybe there is a setting somewhere…

False positives are an issue wth me as well…ie tv opening the garage door. So i set up Hard Listening Enable/Disable and Start/Stop Listening switches in openhab. it can use those to turn on/off the mic or tell links to stop listening based on rules and when it detects the tv is playing something. I added these switches to my sitemap as well…so i can do in and turn off the mic using my phone. Its not ideal as 90 percent of the time links is just listening.

Make sure you do lots of voice training on the windows control panel. There are settting in links in the xml directory that tell whether the voice engine should learn. I turn it off. Its “adaptation” or something. Search the xml files and you should find it. turn them off if links is listening while tv is on. Once it learns a noise is a command you cant get rid of it. You then have to recreate a new voice profile in windows. So do lots of training and turn off listening while the tv is on.

I’ve read that Alexa has this same issue…they cant know the difference between the tv and a live person. Also there is a command “listen while you speak” issue where jarvis himself will think what he just said was a command…lol. giving himself some orders and stuff.

Also, if you speak slow and clearly you can increase the threshold in links to .90 or .95. The default is .70 i think. I have it set to .95 for the wake command.

Would be nice to use an xap-800 to route all tv sound and microphone sound through the noise cancellation part. Cant do it because of the usb but maybe someone will make a cheap array mic that can be ported thru the xap-800 and we can cancel out the tv /stereo sound electronically. Or maybe someone can hack the usb cable to send the mic data through the xap-800 and then back to usb. Xap-800 can be had for 30-50 dollars and can cancel out any channel you wish. The idea is to send stereo/tv sound through the xap before sending to speakers. This would allow the mic to electronically noise cancel out the background.

I am also trying to find my old jawbone and maybe use it while i’m watching a movie. Pair it with the compute stick and viola! Its not that bad of an issue as i do use my phone as my tv/stereo remote so I have access to the mic on/off. I also tend not to give the house commands while i am watching tv so having kodi automatically turn off the mic while playing a movie works pretty well. All depends on how often you need to tell jarvis what to do. In reality i’ve found that having the light command and asking about the thermostat/weather/temp is about 90 percent of what i use voice commands for. (i have to keep making it warmer as the kids set it to the minimum all the time). I did make a script for web searches but honestly, i dont really use it much. We have the ipad in the living room that i use for that.

I also have a reminder set up that i use quite a bit … " Friday, set a reminder for 15 minutes" …response “what for?” and then i tell her what to say … ie “time to go to work” or “check dinner in the oven” etc .works well. Also same command but “wake me up in x minutes” …

Hope it helps.

Kim

I sent you a direct message. If you click on your initial in the top right there should be a little mail logo just below it.