Yes, virtual switches are the way to go. Use them to represent your desired time period by turning on and off with Routines and then checking if the virtual switch is on as part of another Routine. You can create virtual switches using the ST Advanced Web App or community developed ST API Browser+. Those will run in the cloud. You can also use Edge driver based virtual switches by installing the [ST Edge] vEdge Creator: a virtual device generator for end users driver.