Accumulate time per week that Fibaro plug has value over a certain threshold

I use a Fibare Wall Plug that my TV is connected to that I use to see if the TV is on (and active). There is a power consumption threshold that decides if the TV is active or in standby mode.

I want to create a template sensor that accumulates the time this plug is over a certain power consumption to calculate weekly TV time. Any ideas?

I would create a template binary sensor that shows “on” when power consumption is above threshold and “off” else. Then use the history statistics sensor on this binary sensor.

What a good idea. Didn’t think of that! Thanks :slight_smile: