In addition to showing the metrics, Radar can alert you by sending threshold desktop notifications. It can be helpful when you want to know as soon as things change with the metrics you track with Radar.
For example, you can set Radar to send a desktop notification when the Bitcoin price goes below $45,000 so that you can waste no item buying the dip.
Click on the pencil icon next to a metric and then select 'Next'. Now, set an auto-refresh interval without which you can't enable notifications. Check 'Show threshold notifications' and select 'Next'.
Notifications trigger in the auto-refresh interval when needed. You can use one of the two ways to trigger the notifications.
When installing from a 1-click installer, you can decide when the notification should be triggered. Three modes are supported. Greater than, less than and equals to.
When you select greater or less than, the primary/secondary value's numerical value is taken and compared with the threshold value you give. If the condition is satisfied, a notification will be shown.
Now, you can write your logic to trigger the notification. You have access to the API
pastValues. Check the format of pastValues. You need to set
notificationText variable to get a notification.
You can access the last value captured using
pastValues[-1]. It is useful when you want to show notifications only when values are greater or less than the previous value.
When the API response is HTML, you get access to
$. You can use this JQuery variable to assign values from the dom. Cheerio is used to make this possible.
You can use
log.info function for printing debug logs. You can refer to custom value debugging to learn more.
When you don't want to get notifications temporarily, you can snooze all notifications or notifications of a specific metric. Right-click the Radar icon, select "Snooze Notifications". You can enable notifications again using the same menu option.