Store Bool tag only when on

I would like to store the tag history only when the Bool tag is on. I am using 8.0.16. Does anyone know of an easy way to do this without resorting to a transaction? I was hoping to find a trick to do this within the tag history.

Do you need a full history with graphing capabilities or just the time stamp of when the bool bit changes? You could always write a script that goes on tag change to track when the boolean changes value, and what value it changed to.

If you want to be able to integrate the history with an Easy Chart or similar though I think you need to enable history- I don’t believe there’s a conditional way to make this run only if the value is True.

Is there a particular reason you don’t want the history of when it is False?

I basically only want the time stamp of when it turns on. It turns off a few seconds after it turns on and that is not important. I put the history on a chart to see the time stamp, but the times are all duplicated (within the same minute) since it shows on and off.

Did you try changing the aggregation mode, to say Max?

yes. It didn’t make a difference

You could put a tag change script on it to increment an integer tag. Then put history on the int tag. Something like this.

if currentValue.value == 1:
	count ="[.]tag").value
	count = count + 1