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.
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.
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.
Quote from: jitterjames 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.
Yay I did it!
<?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}&&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!
Easy right? ;)