Turning a light on/off with motion when "X" is not time or date but another sensor

If you are in the U.S., you can look into one of the third-party rules engines. (This is a clickable link)