AC On/Off alarm

Niraj Singh 3 years ago

Hi,

I want to generate AC Alarm from computed attribute that comes as ac.I have written following code but not working.

Attribute Alarm
ac ==  true ? "Ac On":"Ac Off" 
Type String

Alarm is not generating.Please help if anybody has done it before.Thanks in advance.

Anton Tananaev 3 years ago

Where have you found those alarm ids?

Niraj Singh 3 years ago

I have no idea about alarm ids where can i see all alarm ids.So please help me to write it correct way.

Anton Tananaev 3 years ago

You should use the predefined ids you can find in the code. You can't just put random string as an alarm and expect it to work.

Niraj Singh 3 years ago

ok thanks for a quick reply.

Big respect..!!

Niraj Singh 3 years ago

Please tell me on which file in code I would find alarm ids?

Anton Tananaev 3 years ago

Position.java

Niraj Singh 3 years ago

Hi,

I have added alarm keys in postion.java so now I am adding this expression.

door ? 'acOn':'acOff'

while testing I am getting alarm but when I save it after saved It looks like this.Also now when i am testing it is givng error.

door ? "acOn":"acOff"
Anton Tananaev 3 years ago

What version of Traccar are you using?

Niraj Singh 3 years ago

5.4

Anton Tananaev 3 years ago

I would recommend upgrading first. Also, if you have some changes in config, make sure to tell us.