Notification for input on Di2 and Di3

Alf-DK3 years ago

I would like an notification when Di2 gets high 1 and Di3 gets low 0
I have both Di2 and Di3 under state from the tracker.

I am trying to make an alarm attribute on Di2 which is also displayed under state, but it does not look at whether Di2 and Di3 are 1 or 0 that is my problem

Joystick3 years ago

Hi Alf-DK,

Create Alarm Computed Attribute e.g.
Description: di2 alarm
Attribute: Alarm
Expression: di2==1?"di2 on":null
Type: String

Then create notification:
Type: Alarm
Check box for all devices if you like
Channels: sms, email, web

Click attributes and enter:
name: alarms
value: di2 on

Link the notification to the user

Anton Tananaev3 years ago

Pete, what version of Traccar is this for? How do you select "di2 on" as an alarm type for the notification?

Alf-DK3 years ago

Yes that attribute works fine, but no notification can be made on it.

Joystick3 years ago

Hi Anton,

I'm using current source code. Probably should have mentioned it in previous comment but for me to get custom alarms to work I create the notification as per below:

Type: Alarm
All Devices: Checked
Alarms: General
Channels: Web, Mail, SMS

I then select Attributes and replace value: "general" with my custom value used in the Alarm type computed attribute. "di2 on" in this instance.
Works for me.

Anton Tananaev3 years ago

Yeah, "general" will work because it's a pre-defined type in Traccar. But "di2 on" won't work because it's not.