thanks for the help. What tells it when to switch from open to closed? What triggers that?