Another option (simpler than WebCore) but does cost $8 is a rules app called OneTap. I find it easier and simpler to use than WebCore but it’s not as extensive and does have a few limitations. However, it can do what you want because I was able to create a tap using my window sensor.