Skip to content

Compare

Threshold-based change detection.

1 modules

ModuleDescription
変化を検出値がしきい値を超えて変化したかどうかを検出する(量またはパーセンテージで)

Modules

変化を検出

compare.change

値がしきい値を超えて変化したかどうかを検出する(量またはパーセンテージで)

Parameters:

NameTypeRequiredDefaultDescription
current_valuenumberYes-The current/new value to compare
previous_valuenumberYes-The previous/old value to compare against
modeselect (percent, absolute, any)Nopercent比較する以前/古い値
thresholdnumberNo5トリガーする最小変化(5 = 5% または 5 単位)
directionselect (both, up, down)Noboth検出する変化の方向

Output:

FieldTypeDescription
okboolean操作が成功したかどうか
changedboolean操作が成功したかどうか
directionstring操作が成功したかどうか
change_percentnumber変化の方向:
change_absolutenumberパーセンテージ変化(正 = 上昇、負 = 下降)
current_valuenumberThe current value
previous_valuenumberThe previous value
summarystring現在の値

Example: Crypto price alert (5% change)

yaml
current_value: 44500
previous_value: 42000
mode: percent
threshold: 5
direction: both

Example: Stock drop alert

yaml
current_value: 145.5
previous_value: 152.3
mode: percent
threshold: 3
direction: down

Example: Temperature change (absolute)

yaml
current_value: 32
previous_value: 25
mode: absolute
threshold: 5
direction: up

Released under the Apache 2.0 License.