Author Topic: What do you use VoX for Vera HA Control???  (Read 5868 times)

0 Members and 3 Guests are viewing this topic.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
What do you use VoX for Vera HA Control???
« on: February 24, 2014, 01:26:11 AM »
I have the following Vera specific items working in VoxCommando and am loving it:

X = Device/Scene name in generated payload XML from plugin

* Dim X to Y percent (i.e. Dim Downstairs Hallway Light to 30 percent)
* Turn X On/Off  (i.e. Turn Downstairs Hallway Light On)
* Run Scene X (i.e. Run Scene Downstairs Hallway On)
* Shields Up/Down (this runs Scene to Lock or Unlock all my doors.
* Fire Phasers -  Fire that Vera Scene that Turns on backyard sprinklers for 30 seconds, typically for preventing raccoons from digging up my lawn.
* What is Temperature - Speaks the internal temperature from Nest thermostat and outside temperature (using WUnderground plugin for VC).

Is there any other ideas on what you can do with VoxCpmmando with Vera?


Also, I was was wondering if anyone how I could do some advanced things like:
* Query HVAC High/Low temp set points.
* Set HVAC High/Low temp set points.
* Have both 'Turn Downstairs Hallway Light On' or 'Turn On Downstairs Hallway Light' ('On' variable is near beginning or end) works the same way
* List of items in a room or house that are On.  i.e. :
   ** What doors are open in the home (i.e. sensor tripped)?  
   ** Is anything still on? (include all rooms except bedroom) to list all lights or devices not off
« Last Edit: February 24, 2014, 11:41:04 AM by AgileHumor »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: What do you use VoX for Vera HA Control???
« Reply #1 on: February 24, 2014, 02:11:05 AM »
Quote
Also, I was was wondering if anyone how I could do some advanced things like:

If you have the Vera-plugin in VC enabled, I think the attached pic will show you the answer  ;)
***********  get excited and make things  **********

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: What do you use VoX for Vera HA Control???
« Reply #2 on: February 24, 2014, 03:20:10 AM »
Thanks, I was planning to expand out the different devices like humidity, room temp, sensor battery status...luckily I think I can re-use the same logic that I gleaned from the forum in the above examples.

However, how can I get a list of devices on the Vera, for example, "What devices do I need to replace the battery this month" will give me all the 30% and under.  Right now, the only logic I could come up with is asking each device individually...and I have about 50 battery powered devices.

Another advanced example I can't figure out is "What areas of the house have motion" showing me all motion sensors that are tripped.  Otherwise, I'll need to manually ask each sensor...over 100 in total (detailed here: http://bit.ly/1cfjV1Q)

I do super appreciate the guidance...I'm trying to figure out where my expectations can't be met without breaking out python (which is far beyond my capability).  I suppose I'm learning it is not an AI :)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: What do you use VoX for Vera HA Control???
« Reply #3 on: February 24, 2014, 05:37:07 AM »
Here is a very helpful video for the Vera plugin from "nime5ster" - www.youtube.com/watch?v=-M7htWfF3tQ

I'm not sure if the "New" VC-Vera plugin is officially available (the one which I have) which have new functions, maybe James can give you here the correct information  ;)

To get the battery level from a Vera device is easy, but creating this for 50 devices is a lot of work - I'm sure there is a better way as mine, but I have only one device with battery and so it is sufficient for me.

Anyway, here is a example code for the battery level with warning when the level is ≤30% - you must change the device ID for your needs:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="Vera heating" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="741" name="check battery" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Vera.Get.BatteryLevel</cmdType>
      <cmdString>6</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{LastResult} %</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;30</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Warning, the current battery level for the heater in dining room is less then {LastResult} percent, I recommend you to change the battery.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>the current battery level for the heater in dining room is {LastResult}percent and should be o k.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>check heater battery</phrase>
  </command>
</commandGroup>
« Last Edit: February 24, 2014, 05:46:24 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: What do you use VoX for Vera HA Control???
« Reply #4 on: February 24, 2014, 10:53:16 AM »
Here is a way to scan the battery levels of all devices and report on the ones that are low.  The idea can be extended to work for other things such as "which lights are on", but it takes time to figure out the regex etc. so we can't answer all of them for you.  This is an advanced solution, so a new users will probably have trouble understanding how this works.  ;)

edit: I accidentally pasted the wrong XML. :bonk  Here is the correct group:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="vera battery check" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1108" name="scan all battery levels" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Vera.Raw</cmdType>
      <cmdString>data_request?id=lu_status&amp;output_format=xml</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <cmdString>device.id="(\d+)"  (?:(?!device.id).)*batterylevel".value="(\d+)"&amp;&amp;=</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Scanning: {#M} devices use batteries.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.MatchToEvent</cmdType>
      <cmdString>vera.battery.level</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>scan all battery levels</phrase>
  </command>
  <command id="1144" name="check each level" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="1) Change &quot;VeraJ\devices.xml&quot; to the path of your Vera devices payload XML file.&#xD;&#xA;2) Change &lt;60&gt; to the minimum safe battery level.">
    <action>
      <cmdType>OSD.AddText</cmdType>
      <cmdString>{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <cmdString>{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>(\d+)</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>{Match.2}&amp;&amp;60</ifParams>
      <then>
        <action>
          <cmdType>PayloadXML.GetPhrase</cmdType>
          <cmdString>VeraJ\devices.xml&amp;&amp;{Match.1}</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Battery on {LastResult} is down to {Match.2} percent.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.AddText</cmdType>
          <cmdString>Battery on {LastResult} is down to {Match.2} %</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <event>vera.battery.level</event>
  </command>
</commandGroup>
« Last Edit: February 24, 2014, 11:33:37 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: What do you use VoX for Vera HA Control???
« Reply #5 on: February 24, 2014, 11:34:56 AM »
also be sure to read the description in the "check each level" command for notes on configuring it.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: What do you use VoX for Vera HA Control???
« Reply #6 on: February 24, 2014, 11:42:43 AM »
Awesome!  I can't wait to get home tonight after work and try it.  This really helps me solve my 4th advanced scenario.

Anyone else do some cool stuff with HA control?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: What do you use VoX for Vera HA Control???
« Reply #7 on: February 24, 2014, 11:54:42 AM »
James described our nighttime scenario in this thread: http://voxcommando.com/forum/index.php?topic=1401.msg12099#msg12099

Basically, a simple good night voice command triggers a Vera scene that does multiple things over a period of time. We also have a 'Watch TV' command and 'Listen to music' command, each of which adjusts a variety of devices according to our needs, combining Vera scenes with other types of home theatre control.

I have a special bedtime command that I use during the summer, which checks the temperature in the bedroom and if it's above a certain threshold changes the climate control (in our case, just a fan as we don't need AC here). The same command makes sure lights etc. are off in the rest of the house and turns on the bedside lamp.

I would be very interested in hearing from other VC users as well, so hopefully others will chime in. That said probably very few of us have as elaborate an HA environment as yours. ;)

Welcome to the forum.
« Last Edit: February 24, 2014, 12:01:40 PM 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)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: What do you use VoX for Vera HA Control???
« Reply #8 on: February 24, 2014, 01:30:26 PM »
Awesome!  I can't wait to get home tonight after work and try it.  This really helps me solve my 4th advanced scenario.

Anyone else do some cool stuff with HA control?

you want to see cool stuff for HA control with VC - here it is: www.youtube.com/watch?v=ewCRJZKFW34
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: What do you use VoX for Vera HA Control???
« Reply #9 on: February 24, 2014, 02:39:15 PM »
* Shields Up/Down (this runs Scene to Lock or Unlock all my doors.
* Fire Phasers -  Fire that Vera Scene that Turns on backyard sprinklers for 30 seconds, typically for preventing raccoons from digging up my lawn.

I love it.  You will fit right in here.  ;D

The "Fire Phasers" command is awesome.  I wish I had sprinklers just so I could do this!  This also reminds me of a video...

bucko

  • Jr. Member
  • **
  • Posts: 2
  • Karma: 0
    • View Profile
Re: What do you use VoX for Vera HA Control???
« Reply #10 on: February 24, 2014, 08:21:16 PM »
I just started VC yesterday to see how I could use it for my Vera HA set up as well.  My goal will be to use VC to output voices through my multizone audio system. That part won't be too difficult. But I wonder about the INPUT side of things. I would want to use my iPad, iPhone as the mic input sort of like  Siri operation. I don't see that there are any apps the iPhone can connect to VC with.

I also cannot find about how to take an xml file and "import" it into VC. I see on the forum where people have made xml's to download, but what exactly do I do with them? Maybe a stupid question as I find no explanation of this anywhere. I looked at several videos about command building, but again no mention how one makes these xml command files show up in the VC directory.

I see great promise with VC. It was looking like I was going to have to build a Raspberry PI to port Vera commands to Siri, which looks limited and time consuming. If I can get a better handle on VC.....I'm onboard.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: What do you use VoX for Vera HA Control???
« Reply #11 on: February 24, 2014, 09:20:29 PM »
I just started VC yesterday to see how I could use it for my Vera HA set up as well.  My goal will be to use VC to output voices through my multizone audio system. That part won't be too difficult. But I wonder about the INPUT side of things. I would want to use my iPad, iPhone as the mic input sort of like  Siri operation. I don't see that there are any apps the iPhone can connect to VC with.
http://voxcommando.com/mediawiki/index.php?title=Microphones#iOs

I also cannot find about how to take an xml file and "import" it into VC. I see on the forum where people have made xml's to download, but what exactly do I do with them? Maybe a stupid question as I find no explanation of this anywhere. I looked at several videos about command building, but again no mention how one makes these xml command files show up in the VC directory.
http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

Check out the wiki and the youtube videos, do some Google searches, and I'm sure you'll figure it out pretty quickly.
« Last Edit: February 24, 2014, 09:32:43 PM by jitterjames »