Calculated daily run time of a switch

You may be able to pick up some ideas from this thread: