Collect information for boolean points
Collect information for boolean points
The second functionality of the FIN Watcher is to collect information regarding the boolean points.
This means that 2 new properties need to be enabled for boolean points that have the history option enabled:
- runTime: will specify the period of time for which the point was On (in hours) from the last reset
- runStarts: will specify the number of times the point has been turned On from Off from the last reset
- finBoolStatsFreq - Tune how often the FinWatcher computes boolean 'runStarts' and 'runTime'. If not configured it defaults to 1 hr. The value must be greater than 5 seconds.
It computes the value based on the history of the point - so you can verify the correctness by matching it with the history data.
The values are calculated by computing them based on the historic changes since last time the watcher ran. So if there was no change there is no history so the value should stay the same.
In the edit window the user will add a new tag called: finBoolStatsFreq (numeric type) and set it to whatever value it's desired.
Hit apply, and then for the new changes to take effect, the user will need to disable and re-enable the FIN Watcher resource in the Settings app.
After the amount of time specified in the finBoolStatsFreq, the user can start noticing that the runStarts and runTime start collecting data. (runTime will always default to hour based units, the computing in the background is still based on finBoolStatsFreq).
To reset the values stored in the runStarts and runTime, simply press the reset button next to it.
Reset
The user can also reset the moment when the collecting information for boolean points starts in 2 ways:
- Call finResetStatsStartTime() and it will add the statsResetTs to bool points with the current time
- Call finResetStatsStartTime(null, now() - xhr) for a different statsResetTs. In this example it is set to now-xhours. The time can't be later then 24 hours before.
You can also call finResetStatsStartTime(rec, ts), see pod docs for more.
All stats that have been collected can be reset by calling finResetBoolStats().