Method to start and stop a Ceiling Fan based on an event but if the fan is already turned on, I do not want to return on and most importantly turn off automatically

Something similar was just discussed in this thread:

Basically, you need something to track the status of the switch when it is manually thrown. Take a look at my post and the one that follows by @lflorack. My solutions proposed using a variable in webCore to track the switch’s status. @lflorack suggest using a virtual switch to do the same. If you are not familiar with webCore, the @lflorack’s solution may be a bit simpler.