Add grace period support for persistent alarms #12

Closed
opened 2026-06-23 13:26:37 +02:00 by minimons · 0 comments
Owner

Change PERSISTENT alarms so they can keep triggering while the alarm condition is still true.

Current behavior requires the price to cross back and then cross the target again before the alarm can trigger again. This should remain unchanged for ONETIME, but PERSISTENT alarms should be able to re-trigger while the condition remains true.

Add optional grace period syntax to the trigger column:

ONETIME
PERSISTENT
PERSISTENT:<seconds>

Examples:

1 SOL ABOVE 92.0 ONETIME        CRITICAL "CRITICAL: Solana liquidation risk!"
2 SOL ABOVE 70.0 PERSISTENT:600 INFO     "Increase SOL short"
3 SOL BELOW 68.0 PERSISTENT:0   INFO     "Decrease SOL short"

Rules:

  • ONETIME behavior should not change.
  • PERSISTENT should behave like PERSISTENT:0.
  • PERSISTENT:0 should trigger on every loop while the condition is true.
  • PERSISTENT:600 should trigger immediately when the condition becomes true, then at most once every 600 seconds while the condition remains true.
  • When the condition becomes false, the persistent alarm should reset so the next true condition triggers immediately again.
  • ONETIME:<seconds> should be invalid.
  • Negative or non-numeric grace periods should be invalid.
Change `PERSISTENT` alarms so they can keep triggering while the alarm condition is still true. Current behavior requires the price to cross back and then cross the target again before the alarm can trigger again. This should remain unchanged for `ONETIME`, but `PERSISTENT` alarms should be able to re-trigger while the condition remains true. Add optional grace period syntax to the trigger column: ```text ONETIME PERSISTENT PERSISTENT:<seconds> ``` Examples: ```text 1 SOL ABOVE 92.0 ONETIME CRITICAL "CRITICAL: Solana liquidation risk!" 2 SOL ABOVE 70.0 PERSISTENT:600 INFO "Increase SOL short" 3 SOL BELOW 68.0 PERSISTENT:0 INFO "Decrease SOL short" ``` Rules: * `ONETIME` behavior should not change. * `PERSISTENT` should behave like `PERSISTENT:0`. * `PERSISTENT:0` should trigger on every loop while the condition is true. * `PERSISTENT:600` should trigger immediately when the condition becomes true, then at most once every 600 seconds while the condition remains true. * When the condition becomes false, the persistent alarm should reset so the next true condition triggers immediately again. * `ONETIME:<seconds>` should be invalid. * Negative or non-numeric grace periods should be invalid.
minimons added the enhancement label 2026-06-23 13:26:37 +02:00
minimons self-assigned this 2026-06-23 13:26:38 +02:00
minimons added this to the AssetAZ project 2026-06-23 13:26:38 +02:00
minimons moved this to In Progress in AssetAZ on 2026-06-25 08:37:22 +02:00
minimons moved this to Done in AssetAZ on 2026-06-25 08:37:29 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#12