Add hysteresis support to CROSSING alarms #45

Closed
opened 2026-07-27 09:27:00 +02:00 by minimons · 0 comments
Owner

Background

CROSSING alarms currently re-arm immediately after the value moves back across the threshold.

If the value oscillates around the threshold, this can produce a very large number of repeated alarms.

Example:

9.999
10.001   -> trigger
9.998    -> re-arm
10.002   -> trigger
9.999    -> re-arm
...

This can easily generate dozens or hundreds of alarms per second.

Proposed syntax

Allow an optional hysteresis to be specified after the threshold:

>10/0.1

or

>{{SOL_LONG_LIQ_PRICE}}+3%/0.1%

The value after '/' represents the hysteresis distance.

No + or - shall be specified in the configuration.

Behaviour

For an upward crossing:

>10/0.1
Trigger when:
price > 10
Re-arm when:
price <= 9.9

For a downward crossing:

<10/0.1
Trigger when:
price < 10
Re-arm when:
price >= 10.1

The direction of the crossing determines automatically whether the hysteresis distance is added or subtracted from the threshold.

Benefits

Prevents alarm storms when the value oscillates around the threshold.
No need for arbitrary grace periods.
Behavior becomes deterministic and easy to understand.
Keeps the configuration compact while avoiding explicit +/- notation for hysteresis.

### Background CROSSING alarms currently re-arm immediately after the value moves back across the threshold. If the value oscillates around the threshold, this can produce a very large number of repeated alarms. Example: ``` 9.999 10.001 -> trigger 9.998 -> re-arm 10.002 -> trigger 9.999 -> re-arm ... ``` This can easily generate dozens or hundreds of alarms per second. ### Proposed syntax Allow an optional hysteresis to be specified after the threshold: ``` >10/0.1 or >{{SOL_LONG_LIQ_PRICE}}+3%/0.1% ``` The value after '/' represents the hysteresis distance. No + or - shall be specified in the configuration. ### Behaviour For an upward crossing: ``` >10/0.1 Trigger when: price > 10 Re-arm when: price <= 9.9 ``` For a downward crossing: ``` <10/0.1 Trigger when: price < 10 Re-arm when: price >= 10.1 ``` The direction of the crossing determines automatically whether the hysteresis distance is added or subtracted from the threshold. ### Benefits Prevents alarm storms when the value oscillates around the threshold. No need for arbitrary grace periods. Behavior becomes deterministic and easy to understand. Keeps the configuration compact while avoiding explicit +/- notation for hysteresis.
minimons added the enhancement label 2026-07-27 09:27:00 +02:00
minimons self-assigned this 2026-07-27 09:27:00 +02:00
minimons added this to the Evelyn project 2026-07-27 09:27:00 +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#45