Author Topic: Use VC to control Hubitat Hub  (Read 5161 times)

0 Members and 1 Guest are viewing this topic.

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Use VC to control Hubitat Hub
« on: June 24, 2019, 09:20:30 PM »
I am new to Vox Commando, actually waiting on a microphone to try it out. I was looking for a solution to get my home automation 100% offline. I have been moving everything over to a Hubitat hub and it is awesome via a pc or tablet. It works great with Alexa & GH as well, but I wanted to find a way to use voice control without either of them (Alexa or GH) and have it working with voice control even without the internet.

That led me here.  I talked with the owner of Hubitat and asked him if this could be done with VC and his reply was this: "There doesn't appear to be anything created. It may be possible but it would likely be you at the center of development."

Has anyone tried this, or can point me to any useful information on how I might get this project going? I should be good to start in the next couple days as soon as the mic arives.

Thanks in advance

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Use VC to control Hubitat Hub
« Reply #1 on: June 24, 2019, 10:05:51 PM »
Welcome to the forum.

I'm not familiar with that hub. It depends what kind of functionality you're hoping for but it looks like the simplest option might be to use its Maker API with VoxCommando's Scrape action.

https://docs.hubitat.com/index.php?title=Maker_API

https://voxcommando.com/mediawiki/index.php?title=Home_Automation#Scrape

The Fibaro and/or Domoticz posts on the forum should give you some sense of how to construct commands.

Note about commands posted as XML on the forum: https://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum
« Last Edit: June 25, 2019, 07:58:04 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #2 on: June 25, 2019, 11:01:06 AM »
@nime5ter: Thanks for the welcome and a big thank you for pointing me to what looks to be some great information to get me started.

The primary functions I have been using my home automation so far is simple switches for lights, tv's etc.. I have dabbled with my own Kodi fork but had limited success due to ISP issues. (stuck behind carrier NAT and it doesn't allow me to do web hooks).

I had been using basic Sonoff switches. But unless you flash them, they rely on the cloud to work.

When I decided I wanted to eliminate the cloud for home automation, I ordered a Hubitat hub and a simple Zigbee switch for testing. The Hubitat is an amazing, VERY versatile tiny little feller with some incredible folks supporting it.

I have a entire house full of Sonoff switches that I am slowly replacing with Zigbee's now. The only hurdle I have, is if I want to continue to use voice control with the new set-up, I still have to use one of the 2 big guys. I can easily use a web browser on any device to control everything now, including scenes I set up in the hub with no cloud.

So the plan is to use a PC with VoxCommando with a conference room mic that has noise cancellation to be able to accomplish the same thing by voice. VoxCommando looks to be very very configurable and from what I am seeing has awesome support as well, so maybe I can get this working.

I have multiple PC's throughout the house, so if I can get it working on one, I can duplicate it throughout. Looks like this ole Papaw has a lot of learning and tinkering ahead...

Again, thank you and I will keep you posted

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Use VC to control Hubitat Hub
« Reply #3 on: June 25, 2019, 12:32:37 PM »
Hi Wanderer,

I think that getting VoxCommando talking to your Hubitat Hub should be fairly straightforward.  The biggest challenge you will likely face is the microphone.  The Amazon and Google microphones do a very good job of filtering out noise and picking up voices from a long distance.

Once you are up and running, if you are having trouble with the microphone you can also check out VoxWav assuming you have an Android device.  It works as a WiFi microphone for VoxCommando and does not require the internet to work.

You should also be able to control your SonOff switches directly from VoxCommando but I'm not sure about the firmware flashing requirements.  Kalle has more experience with the SonOff switches than I do.

Let us know if we can help with anything specific and good luck.  :)

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #4 on: June 25, 2019, 03:17:12 PM »
@jitterjames: I hope the mic works well, range of 12ft with noise cancellation. If not I will look into VoxWav. I do use android devices, including tablets in which a couple are wall mounted for the home automation as well as 3 shields.

Mic should be here tomorrow....

Thanks for replying


Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #5 on: June 25, 2019, 03:57:42 PM »
Hi wanderer189 and welcome in the forum.
I don't know how well you know how to flash the sonoff firmware. It's not that hard, but it's necessary to solder a pin header and you need a FTDI controller and last but not least the Arduino IDE
I'm not sure if it's really worth it, you would have to do that with all Sonoff.
If you want to flash the Sonoff, let us know - we have a firmware that is perfectly tuned to use with VoxCommando (real response of the switching state, generate events in VC).I wish you good luck with the conference mic and happy voxing - let us know how it works. As James suggest - VoxWav is a really good option.
Kalle
***********  get excited and make things  **********

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #6 on: June 25, 2019, 04:03:39 PM »
@Kalle: No, I do not want to flash the sonoffs. I am already in the middle of replacing them all with Zigbee switches.

I already have the replacements, it's just a matter of taking down light fixtures and such, etc..

Thanks for replying

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
***********  get excited and make things  **********

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #8 on: June 27, 2019, 10:09:57 AM »
Okay, I have received the microphone. I installed VC (paid version) and chose kodi in the initial setup to get an idea of how the command structures work. (I am so glad VC is portable!). One of the biggest problems I am having learning VC is all the videos I find are so out-dated.

I am having navigation issues with that, as the stock Keyboard commands are for PC only and I'm testing it connecting to kodi on a shield (android). but I will post that in a different thread.

As per nime5ter's post, I am attempting to use the Hubitat's Maker API.

It is giving me a local url:

http://192.168.10.176/apps/api/193/devices?access_token=ABC123XYZ

It provides the following json or raw data on a simple switch: (its actually in a long string when I try to copy-n-paste it, but not in a browser)

[{"name":"Living Room Fan","label":"Living Room Fan","
type":"Zigbee OnOff Switch","id":"5","
date":"2019-06-24T17:30:45+0000","
model":null,"
manufacturer":null,"
capabilities":["Switch","Configuration"],"
attributes":{"switch":"on","dataType":"ENUM","
values":["on","off"]},"
commands":[{"command":"configure"},{"command":"off"},{"command":"on"},{"command":"toggle"}]}]


I am kinda lost on the 2nd step of nime5ter's post of Scraping it in VC. I created a new Group Collection (named it Hubitat), then a new group (named it outlets). I assume this is maybe where the scraping will come in?? (I will create more groups once I get one switch working and get a grasp on how to do all this.)

I may be in the wrong place, but then I created a command (command name Living Room Fan), then Edit > Action > Open Action Tree. I tried choosing Scrape as well as a Scrape.Simple, entered the url.

I am sure I need the toggle or on/off value somewhere? I might need to be using the "id":"5" somewhere as well???

If I can get it to use the toggle value, that would be best I think?

I will have like 30 of these once I get the first one figured out.
« Last Edit: June 27, 2019, 11:20:17 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Use VC to control Hubitat Hub
« Reply #9 on: June 27, 2019, 11:31:06 AM »
It's probably not a big deal but generally you should not post your access token publicly. I've removed it for you but you may want to generate a new one to be safe.

If you take a look at the Maker API that nime5ter links to it gives an example of how to switch a light on and off at the bottom of the page.
https://docs.hubitat.com/index.php?title=Maker_API

So in your case it will look something like this:
http://192.168.10.176/apps/api/193/devices/5/on?access_token=PUTYOURACCESSTOKENHERE

Putting that into a group of commands that use scrape, you will end up with something like this (you can copy and paste this into your command tree):
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.7-->
<commandGroup open="True" name="Hubitat" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="720" name="Turn living room fan on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://192.168.10.176/apps/api/193/devices/5/on?access_token=PUTYOURACCESSTOKENHERE</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn living room fan on</phrase>
  </command>
  <command id="725" name="Turn living room fan off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://192.168.10.176/apps/api/193/devices/5/off?access_token=PUTYOURACCESSTOKENHERE</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn living room fan off</phrase>
  </command>
</commandGroup>

Note #1:  Remember to enter your correct access token into the scrape action in each command.

Note #2: There are more sophisticated ways to do this especially when dealing with larger numbers of devices but I'm trying to keep things as simple as possible for yo at this point to get you started.

Note #3: You must save and close the command editor before testing voice commands.

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #10 on: June 27, 2019, 01:46:33 PM »
@jitterjames: Thanks for removing the token. It's all good, It's a test system/setup until I get everything working, then it will be wiped and everything built from scratch.

Yes, that was exactly what I needed, I found the correct url I needed a different way within the Hubutat app itself, it shows examples and what needs replaced such as ID, command, etc.. I tested the url in a browser and it worked, so I just pasted it into VC and boom!! Works perfect!!!

I was able to use the "toggle" command, since the switches supports it as a command, so I won't have to do a "on" & a "off" command, just the one and include the off and on in the phrases.

I want you to know that you folks are awesome, Vox Commando is a pretty amazing piece of software with how much you can do with it in a fairly simple manner. I have seen different things in it I am sure I will be playing with.

It amazes me that I had never heard of Vox Commando until a few days ago, and in just a few hours after  installing it, I was able to get my home automation working with voice control and 100% without the use of the cloud/internet (even controlling Kodi as well (well sorta, posted in appropriate thread)).

You have no idea how tickled I am and how easy this was (with your folks help of course!)  Thank you greatly to every single one of you that replied, I really, really  mean that!!!

BTW - The conference room mic I am testing with was like $15 and it works great about 8ft. (advertised 11.5ft). Still testing it though. I purchased VoxWav as well but haven't fooled with it yet. Since I will have a couple tablets wall-mounted, I figured it would work on them.

If you ever need a review or recommendation, fell free to hit me up....I assume you are the developer?








jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Use VC to control Hubitat Hub
« Reply #11 on: June 27, 2019, 02:22:34 PM »
Many thanks.  I'm glad to hear that it's working out well for you so far.

Yes I'm the developer.  Nime5ter is my partner in crime.  Kalle and PeglegTV are the main expert/veteran users who are still active on the forum.  There have been several other big contributors but most of them have gone quiet over the years.  Some of them are probably still lurking in dark corners of the forum now and then.

I agree it's a shame that VC is not more widely known but I guess it's a bit of a niche product in many ways and margeting is just not my thing.

For one thing it runs on Windows and that's like, just so 10 years ago man!  Alexa and Google home, while severely flawed in many ways are more what the typical consumer is looking for.  Plug and pray.

branmalin

  • Newbie
  • *
  • Posts: 1
  • Karma: 2
    • View Profile
Re: Use VC to control Hubitat Hub
« Reply #12 on: April 18, 2021, 12:15:08 AM »
I've developed a Hubitat driver that enables it to integrate more directly with Vox Commando.

The methods described above are still the best way to have Vox Commando send general commands to Hubitat, but the driver will let Hubitat change the Vox Commando listening mode, and will let it receive speech recognized by Vox Commando.

https://github.com/branmalin/hubitat-driver-voxcommando

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Use VC to control Hubitat Hub
« Reply #13 on: April 18, 2021, 12:20:38 PM »
I've developed a Hubitat driver that enables it to integrate more directly with Vox Commando.

The methods described above are still the best way to have Vox Commando send general commands to Hubitat, but the driver will let Hubitat change the Vox Commando listening mode, and will let it receive speech recognized by Vox Commando.

https://github.com/branmalin/hubitat-driver-voxcommando

That's awesome.  Thanks for posting this.  ::banana  I don't use Hubitat myself but I do know there are a few VC users that do, so hopefully this is something they will be able to use.