How do I create a sensor that is a stopwatch of the state of another sensor?
I have a pool pump and I want it to run for 8hours a day. there are various conditions for it to be on or off, including electricity price. I need a counter of time placed on the pump status, so I can use that output as an additional condition in an automation.