not sure if this would work for you:
see if switching device handlers for your fan works better with your use case