History_stats - compare state to value

Dearest community,

I am using history_stats on a sensor to track how long it has been on.
However, this sensor is measuring watts. When it is off, it uses around 3W and when it is on, it uses 1500W (can be explained by the device nature).

How to use history_stats to ask it to count the time when the sensor state is higher than 5W?

Thanks to all!

1 Like

You can’t directly, but you could make a binary template sensor that is on when the sensor state is above 5W, then point the history stats sensor to the binary template sensor.

2 Likes