Author Topic: Anything in vox that is like eventghosts "enable exclusive"  (Read 1298 times)

0 Members and 1 Guest are viewing this topic.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Anything in vox that is like eventghosts "enable exclusive"
« on: October 18, 2015, 05:34:18 PM »
hello i have a remote that i would like to setup a single button to toggle an x10 module on/off with. Im trying to eliminate the need for eventghost. In eventghost i had 2 events
1. Fan On
2. Fan Off

when i would press the button it would toggle one of the options to disabled and run the event that was not disabled, when clicked again it would swap.

Ive been looking all day trying to find a way to handle this. as always thanks for any help.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Anything in vox that is like eventghosts "enable exclusive"
« Reply #1 on: October 18, 2015, 06:02:19 PM »
I can think of 2 possibilities. Maybe others will have suggestions.

1. You can enable and disable command groups in VC. Many users do this, for example, if they use MediaMonkey for music but Kodi for video. When MM is launched, VC can disable Kodi command groups and vice versa.

http://voxcommando.com/mediawiki/index.php?title=Actions#Group

2. You could have a command with a variable that keeps track of true or false, on/off, whatever. Use an if/else based on the variable's value. (If currently on, then button press will trigger fan off, else button press triggers fan on, style of thing.)

Evaluate the if/else before resetting the variable.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Anything in vox that is like eventghosts "enable exclusive"
« Reply #2 on: October 18, 2015, 06:27:27 PM »
In the specific case that you describe, the best way to do it would be to use X10.QueryPlc to see if the switch is on or off and then to switch it to the opposite state.  That way even if you turn the switch on or off using the X10 remote your toggle will still work.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: Anything in vox that is like eventghosts "enable exclusive"
« Reply #3 on: October 19, 2015, 06:04:12 PM »
In the specific case that you describe, the best way to do it would be to use X10.QueryPlc to see if the switch is on or off and then to switch it to the opposite state.  That way even if you turn the switch on or off using the X10 remote your toggle will still work.

Yay I did it!

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="488" name="Fan Toggle" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>X10.QueryPlc</cmdType>
    <params>
      <param>A7 ON</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;0</ifParams>
    <then>
      <action>
        <cmdType>X10.SendPlc</cmdType>
        <params>
          <param>A7 ON</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>X10.SendPlc</cmdType>
        <params>
          <param>A7 OFF</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>UUIRT.IR.4348004404F0</event>
  <phrase>Turn, flip, power</phrase>
  <phrase>on, up</phrase>
  <phrase optional="true">the</phrase>
  <phrase>fan</phrase>
</command>

Thanks James your the man!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Anything in vox that is like eventghosts "enable exclusive"
« Reply #4 on: October 19, 2015, 06:42:02 PM »
Easy right?  ;)