You can obviously just handle the timing from Alexa, but if you want to setup the rule logic from HE, you can. You simply need to create a virtual motion sensor that is trigged when a switch is turned on. Then share that with Alexa. When that motion is triggerd, you have an Alexa routine operate the WiFi device.