You can't change the Switch state.
But you can 'copy' the value to a Dummy task and on a switch event toggle the dummy task value.
Assuming your switch task is called "switch" and the task value is "state".
The dummy task is then called "dummysw" and its task value is "state".
If not, you may need to change it in these rules:
Code: Select all
on switch#state do
taskvalueset,dummysw,state,![dummysw#state]
taskrun,dummysw
endon
// override switch state sending an event like this:
// event,overrideswitch=0 to set the dummysw#state to 0
// event,overrideswitch=1 to set the dummysw#state to 1
on overrideswitch do
taskvalueset,dummysw,state,%eventvalue1%
taskrun,dummysw
endon
If you need to immediately send out data to any connected controller (to the dummy task, not the switch task), you can either call "taskvaluesetandrun" or call "taskrun,dummysw" as a separate command.