Ok... I should know the answer to this. But, I don't
I would like two track changes in a device state looking for a pattern (this is for my mailbox monitor. Actually, what I want to track is the state lastUpdate as I am looking to determine the frequency of events. Ideally I would like to see the time in milliseconds. but, seconds might work. Once I have the input I want to maintain a moving average of the time delay between updates. as the moving average approaches 0 (or goes negative, if I can get millisecond times) I know an event has occurred.
I know I can write all changes to the log and then tail there log to get the data I want. But, that is messy and is a misuse of the log. I could also build a plugin, but it seems like overkill. So, my question is can this be done in a script, that I would launch with trigger at start up. Perhaps the question is simply "can I run subscribeToChanges() in a script?" But, asking it that directly precludes other options.
Thanks for any ideas