I’m using system.tag.storeTagHistory() to manually add historical data to a tag. What I’d like is to also add an (historical) event to the alarm journal for any value that would have triggered an alarm had it been an actual live tag value.
The only way I see at the moment to achieve this is by sequentially checking each alarm condition on the tag for each value to see if the value would have activated the alarm. Then, if the alarm was activated, directly writing to the alarm_events table in the database.
I think this should be possible, though non-trivial, but one thing I’m unsure about is how to generate a unique event id (aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa) when inserting an event into the database.
Any ideas, or suggestions for a much simpler approach?