Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Vin

Pages: [1]
1
RegEx (Regular Expressions) / Re: Hue Group status
« on: February 04, 2017, 09:03:05 AM »
Thanks James.

2
Integration Ideas / Harmony hub
« on: February 04, 2017, 09:01:35 AM »
Im almost complete with hue setup. Next step is controlling the entertainment system.

I could not not find any info on integrating VC to Harmony hub, there was 2 threads that showed up when I did the search.

Can VC integrate directly with Harmony hub or does it require eventghost?

3
RegEx (Regular Expressions) / Re: Hue Group status
« on: February 03, 2017, 09:20:43 AM »
Thanks Kalle I already watch those James used RegEx on those, I was hoping James have some time to do tutorials on RegexSingle.

4
RegEx (Regular Expressions) / Re: Hue Group status
« on: February 02, 2017, 11:11:15 PM »
Thank you, appreciate it, that works.

If you can kindly can you do some tutorials on RegexSingle, would like to understand a little bit more how it works.

5
RegEx (Regular Expressions) / Re: Hue Group status
« on: February 02, 2017, 07:31:40 PM »
Thanks for the quick reply, yes I did start with the default hue commands but now im adding these custom ones.

Im trying to filter group "name" that has "action":{"on":true then compare it with the payload if they match the group is already ON and TTS will advise it's already on otherwise it will turn group ON.

I tried the regex you provided but it captures all the the group even with the "on":false

Here's what I have for group

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.9-->
<command id="1022" name="Turn {1} ON" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="80" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Raw.Get</cmdType>
    <params>
      <param>groups</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RegExTool.Open</cmdType>
    <params>
      <param>True</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <params>
      <param>"{1}":\s{.*?".*?"all_on":\s(.*?),</param>
      <param>:</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1.1}&amp;&amp;True</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The {PF.1} is already on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Hue.Group</cmdType>
        <params>
          <param>{1}</param>
          <param>"on":true</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The {PF.1} has been turned on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Turn</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">huePayloads\groups.xml</payloadFromXML>
  <phrase optional="true">lights</phrase>
  <phrase>ON</phrase>
</command>

I tried
Code: [Select]
"name":\s"(.*?)" .*? "on":\s(true)  and picks up the name of group but extends till it finds "on":true

6
RegEx (Regular Expressions) / Hue Group status
« on: February 02, 2017, 03:50:55 PM »
Hi All,

I have implemented vox using Regex to check Hue light status, so it states if the light is already ON or OFF (Done with 2 commands one, for ON and one for OFF)

Im having problem implementing it on Group. Need some help with RegexSingle or Regex.

This is the code for the Lights which is working.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.9-->
<command id="1007" name="Turn {1} light ON" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="80" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Raw.Get</cmdType>
    <params>
      <param>lights</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RegExTool.Open</cmdType>
    <params>
      <param>True</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <params>
      <param>"on":\strue .*? "name":\s"(.*?)"</param>
      <param>:</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <params>
      <param> | </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;{PF.1}</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The {PF.1} is already on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Hue.Light</cmdType>
        <params>
          <param>{1}</param>
          <param>"on":true</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The {PF.1} has been turned on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Turn</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">huePayloads\lights.xml</payloadFromXML>
  <phrase>ON</phrase>
</command>

Pages: [1]