Turn on a switch but under specific conditions?

You’re welcome. This is the help thread if you get stuck…