Control Hubitat with Local Voice Commands using VoxCommando

My Scenario and Why (still a work in progress)

I have been tinkering in home automation for a couple years now. I am/was using GH mini's & Echo Dots to voice control. I use my home automation to mainly control Basic Sonoff wi-fi switches for my ceiling lights, lamps, fans, cords, etc.., but I also have and use other devices such as Broadlink RM Pro/Bean's, wifi robo-vacuum, multiple Nvidea Shield's, PC's and other android TV boxes for various things. I am also a long time user of XBMC/Kodi and always wanted to voice control it as well (and I have tried SO many different ways to get it to work, but nothing to my satisfaction usually due to my ISP. I have since created my own fork of Kodi (PSMC) and use it now to help me learn and Vox Commando is doing it better than anything I have tried.

My biggest problem with home automation has been my ISP. I live in a rural area and last year, my former ISP (which was slow DSL) decided to boot everyone on my road. My only decent option was to move to 4G-LTE. Problem with 4G is cell carriers stick you behind a NAT in their network that blocks most all web-hooks/web requests, running your own web servers and many other useful things like most of IFTTT, getting back into home camera systems or your local media server remotely, etc.. I knew right away that I was going to have to get everything I could, to run local without the need of the internet/cloud.

A few months back, I ordered a Hubitat, then I found & ordered a cheap Zigbee switch from China for testing. I think it's made by the same folks that make the Sonoff's, they are both recognized as eWeLink devices (You can find them on Ebay and Amazon now).

I hooked it up and with the help from the great folks here, I got the switch working with the Hubitat. I had between 20-30 Sonoffs to replace before moving forward. So the Hubitat has sat on my desk since (I'm on a limited budget raising a 5yr old grandchild). So I ordered and waited on my new switches to come. In the mean time, I started searching for a way to voice control the new setup without the internet. That is were Vox Commando came in. I really knew very little about my Hubitat. I had never heard of Vox Commando until a couple weeks ago.

So between the great folks here and the awesome folks their, I have managed to get it all working rather well and once I figured it out, got most of it going in a few hours. Now I have all the same devices that were working on Sonoffs working with the new Zigbee switches off the grid using my Hubitat, and yes, all of this still works great with Alexa/GH if you want it too, just so ya know, but no longer required. Maybe this will help some of you accomplish something similar. Sorry for the long post, but for me the easier the better!

What You Gonna Need:

  1. Hubitat hub
  2. Vox Commando Software installed on a PC
  3. A good PC microphone (I started with a $15 USB conference room mic and it was working decent, except for background noise, mainly a window air conditioner)

UPDATE on mic: I have since moved to a eMeet M2 Conference Room Mic/Speaker for testing, They are a bit pricey, but work pretty darn well. If you leave it plugged into a power source, the blue-tooth will seldom disconnect.

How To Do It:

  1. Download Vox Commando (30 day free trial, so you have nothing to lose)

  1. Vox Commando is portable, so make a folder where ever you want it to live on your PC
  2. Copy the downloaded setup file to the new folder you created and run it from there. When installing, you will come to where it asks you to choose a language, select your language. Then in the language tree, you will see more choices. These are various generic command sets of what you may want to use Vox Commando for, I chose XBMC/Kodi to help me learn the command structure of VC better since I know and use Kodi, any of them will work, because we will be adding new stuff anyway and can always add tons more to it later.

Now you need to switch to the Hubitat side for a bit.

  1. Open a web browser and log into your Hubitat.

  2. Go to Apps on the left.

  1. Go to Add Built In Apps on top right and install the Maker API app.

  1. After Maker API is installed, Go back to Apps on the left and then select Maker API

  1. Select the devices you wish to create voice commands for in Vox Commando

  1. Scroll down the page and find the following line:
    "Send Device Command (replace [Device ID] with actual subscribed device id and [Command] with a supported command. Supports optional [Secondary value]"
    "http://192.168.10.176/apps/api/193/devices/[Device ID]/[Command]/[Secondary value]?access_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

This is a sample URL from YOUR Hubitat device with your access token, notice the items in [], such as [Device ID] and [Command].You will be replacing them in your actual URL's that you will use in Vox Commando for each device.

  1. Just below that is a link called "Get All Devices with Full Details" Click on it.

On the new page that opens (image below), you will find the needed information for all your devices your selected in Step 8. Keep this page open as you will need it to prepare your URL's for Vox Commando. (I just took the sample URL and pasted it into Notepad++. Then changed the things in the brackets for each device.) If you look at the image below, the first thing in my list is Bedroom Ceiling Light, I will use that as the example:

I replaced the [Device ID] with a "33" (dont use brackets), then I replaced the [Command] with "toggle". You can use any of the available commands that your device is showing.

I didn't need the [Secondary value] so I deleted that portion of the URL. So my actual URL looks like this to control my Bedroom Ceiling Light:
http://192.168.10.176/apps/api/193/devices/33/toggle?access_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - (you can paste the URL in a browser window to test it)

Once I had one working URL, I pasted it over and over in Notepad++, then just changed the device id and command in each line. Then I was able to just copy-n-paste them into Vox Commando when I started setting up the voice commands for each device.

Now back to Vox Commando
11. Open Vox Commando
12. Choose Edit from the menu

It will open a new dialog box and will vary in what it shows depending on what generic commands you selected when you installed it. (I had chosen Kodi so you will see Kodi in my command tree structure)

  1. Click on Create New Group Collection and name the new Group Collection anything you like, I started with Hubitat, but then decided to create a group for each room, so I wound up with "Hubitat - Bedroom", "Hubitat - Living Room", etc..

  1. Click on Create New Group and name the new Group the device you wish to add, in this example I will use "Bedroom Ceiling Light".

  1. Create a New Command. I named it same as the device name.

  1. Click on the little notepad to edit it.

  1. Follow the 4 numbered steps in the image

  1. Paste the URL you created for this device.

  1. Click on Save and Execute, this will test it, if it works, click on OK

  1. Click on the Create New Command, this will be your phrases you will use for the device your working on, such as Bedroom Ceiling Light, Turn off Bedroom Ceiling Light, Turn on Bedroom Ceiling Light. Separate them with a comma.

Repeat steps for each Group and devices you want to control with VC. That's the just of it, oh yea, a cool feature in Vox Commando is you can right click on a group or command and copy it to a new one, then just edit them. Another cool feature is you can simply copy your install directory, play around all you want then rename the copy back once you figured out how to do what you are trying to accomplish

Check out their forums. They are great folks as well.

I am still learning all this and finding easier ways as I go, so if you discover a trick or tip to make it easier, please let us know. Hope this helps.

If anyone knows how to hack, mod, flash, etc. a GH mini or Echo Dot to work as a PC mic or know of a good BT conference room microphone that doesn't disconnect BT after 30 minutes-found, PLEASE let me know!!!

UPDATE: I have since updated the mic to a eMeet M2 Conference Mic/Speaker and it is about the closest I have found so far, and I no longer have to say "Hey Google" or "Alexa" any more! (but I still can if I want too).

And between HE and VC, you can create about any type of routine or scene.

6 Likes

There doesn't appear to be anything created. It may be possible but it would likely be you at the center of development. You could start off installing it to get a better idea of how well it might work.

I was able to get this up and running great. I used the Maker API - Hubitat Documentation and a scrape feature in Vox Commando.

I got a conference room microphone to connect to PC. Had it going in less than 6 hours and knew nothing about Vox Commando.

No more need for GH or Alexa or even the internet to voice control my home automation now!!!!

BIG Thanks to Hubitat and VC, developers and folks that assisted me!

3 Likes

Pleased you got this working. There are likely other who would be interested if you had time to post a how to.

1 Like

Iā€™d definitely like to hear more about how you did this as well.

I am working on it at this very moment, trying to get screen shots an all.

@zarthan: Should I post it in this thread or elsewhere when I get it ready?

1 Like

Here would be fine but it might be easier to have the first post with links, description etc. You could edit your first post of start fresh. Your call.

Hi, I am Kalle from the VoxCommando Forum and can suggest as a good microphone the xTag from RevoLabs. You will be find it sometimes cheap on eBay and it has a huge range because it works as a DECT conference mic.
By the way - really good tutorial above.

Kalle

5 Likes

Would love to check out the details on how you achieved this :slight_smile:

Welcome, all the details are posted at top of thread, just edited the original post with the details. Hope this helps

2 Likes

Internet was out here for 10 hours yesterday. Hubitat worked great, even TTS notifications worked now that I replaced G Mini speakers with Sonos.

Alexa was out, of course, hence my revisiting this thread.

2 Likes

Hi there,

just came across this thread today and needed to try it out. Thanks for the tutorial! Big help!!!

I have a question: If I want to dim a light by a certain amount (by just saying "dim lights") how do I do that? My hue lights only support commands to "set level" (from 0-100). So "-20" e.g. isnt possible (it would turn off the lights).

Rulemachine however somehow can achieve this. It calls it "adjust" lights or something...

Thank you!

I have no idea on this one. Don't have anything "dimmable" Might ask in VC forums, they are pretty good about responding if nothing comes from here

THANKS!!! for taking the time to create all the screen shots.
I just created an on and off command for a lamp. Static commands like on and off seem easy enough. Have you setup any commands for dimmer level or lamp color? I'm trying to understand if it's possible, and if so how to modify the command url with a spoken dimmer level or color name.

I haven't tried. As I stated in previous post, I don't have any dimmable or color but the folks over at VC forums are great. If you are able to get something going, please post it here for us.

Thanks! I just went over there and posted the question. I'll be sure to comment back here with updates on what I learn.

So, it turns out that setting a dimmer level or a color temperature is easy enough. The HE URL to set a dimmer level of 75% looks like this

http://192.168.123.123/apps/api/543/devices/123/setLevel/75?access_token=xxxxxxxxxxxxxxxxxxxxxxxxx

Using VC to specify the dimmer level requires the use of a variable. In VC they call it a payload. So after you setup your command and phrase you add a payload, in this case I used a payload range of 1 to 100, and then replace the 75 in the URL with a reference to the payload

http://192.168.123.123/apps/api/543/devices/123/setLevel/{1}?access_token=xxxxxxxxxxxxxxxxxxxxxxxxx

The {1} refers to the first payload, in this case the only payload. VC listens for your phrase and your payload and then sends it back to HE.

VC Dimmer Command

I also tried setting up a color change command but I haven't figured out the URL for that yet.

1 Like

I've made more progress and I'm now fairly confident that I will be able to remove my echo dots soon.

I have three command routines running now. One for On/Off, one for dimmer levels, and one for color changes. I'm going to start on thermostat control next. After that I hit a speed bump but I'm optimistic about getting over it with some help. That speed bump being common Echo functions like what's the weather, shopping lists, timers/reminders, etc.

I loaded Windows 10 onto a Raspberry Pi 4 8Gb and loaded Vox Commando on that. I'm using a bluetooth speaker for my output and a Seed Studio USB mic array for the input. I'm still pondering a hardware challenge for running multiple mics to cover the entire house, but I'm sure I'll solve that one.

The biggest change I've made from what I showed above is that, rather than create a command set per device I now have all my device names and IDs listed in a VoxCommando XML Payload list and I have a single command set that uses the XML list to determine what device to control.

As an example the color change command looks like this:

VC Hubitat Command - Change Color

These are the two payload lists, Device and Hue/Color Temp
VC Hubitat Payload - Device

VC Hubitat Payload - Hue and Clr Temp

In the second list the first six values are hue numbers the last 4 values are color temperatures. Using the If then else logic below if a request for a color change is heard and the request is for red thru purple Vc sends a hue change request to Hubitat along with a default saturation of 100. If the request is for any of the 4 white levels the else statement sends a color temperature change request to Hubitat.

1 Like

Thanks for the info to set up the color change. I was able to get a Sylvania/Osram light strip working thanks to you.

What kind of range do you get with the seeds mic array? The mic seems to be the biggest drawback to local voice control and ditching GH/Echo.

My Seeed Mic is presently located at one end of my Kitchen which is about 12'x18' and it has no problem hearing me from anywhere in the room. The Living Room is about 14'x18' and is next room over with two large 4' wide doors between it and the kitchen and the mic hears me there as well but not as good.

What I am finding with the Seeed Mic is that the noise cancelation isn't as good as I 'd like. It doesn't take a great deal of background noise to prevent Vox Commando from picking up what I'm saying. In fairness to Seeed I'm not setup to test the noise cancelation on a USB mic and I haven't had a chance to do a side by side comparison with other mics.

I've looked at multi mic solutions but they carry a fairly high cost. I'm comparing the cost of something like that with the alternative of setting up additional Raspberry Pi's running separate instances of VC.

Download the Hubitat app