Help with computed attributes

Kublach2 years ago

Hi,

I have created computed attribute "Battery weak".

First

But when battery is weak I get message "Alarm: undefined".

Second

Also, I created "Towing" attribute:

Third

But, "Alarm: undefined" is always active...

What I did wrong with "Battery weak" and "Towing" computed attributes?

Nikolay 2 years ago
Kublach2 years ago

Thank you, I will try... :)

Anton Tananaev2 years ago

What happened to the images?

Kublach2 years ago

They are gone!? I didn't touch anything...

I uploaded images to another site (imgbb)
...

BTW: Everything is working with computed attributes... Thank you both...

leogeolgrv2 years ago
bateria baja startek	alarm	event == "20" ? "lowBattery" : null	string
frenado brusco startek	alarm	event == "40" ? "hardBraking" : null	string
aceleracion brusca startek	alarm	event == "39" ? "hardAcceleration" : null	string
giro brusco startek	alarm	event == "41" ? "hardCornering" : null	string
vehiculo accidentado startek	alarm	event == "42" ? "accident" : null	string
desconexion de bateria startek	alarm	event == "18" ? "powerCut" : null	string
reconexion de bateria startek	alarm	event == "19" ? "powerRestored" : null	string
sos startek	alarm	event == "1" ? "sos" : null	string
interferencia de seƱal startek	alarm	event == "50" >1 "jamming" : null	string
grua startek	alarm	event == "35" ? "tow" : null	string
nivel de energia startek	batteryLevel	event == "17" 11.5 "lowPower"	number
Kublacha year ago

I have another problem with computed attributes. Is it possible to set a computed attribute to be true if the last two or three data retrievals had the same value?
What I mean... I have computed attribute alarm for low battery
Computed attribute

The problem is that the battery is obviously weaker, and when starting the car, the voltage drops below 11, triggering an alarm indicating a low battery.
Problem

Nikolay a year ago

event.ignoreDuplicateAlerts

https://www.traccar.org/configuration-file/

Kublacha year ago

By the description, that's not it... The description says: not to generate an alarm if the same alarm occurs twice in a row, but I have the opposite need... I want the alarm to trigger only if the same alarm occurs twice in a row, and only for one computed attribute.

Normal battery voltage: 12V
Normal battery voltage: 12V
Car starting: 10V
Normal battery voltage: 12V
Normal battery voltage: 12V

Nikolay a year ago

You need hysteresis calculation. Not possible out of the box.

Kublacha year ago

OK, thank you... I will manage this through zabbix...

BTW: Do you know maybe is it possible to set attribute status.timeout per device, I didn't find that in documentation?

Example:
One of my devices is connecting to server every 1h. I would like to change status to "offline" if device is not connected for 1hour, but only for this device.

Anton Tananaeva year ago

Status timeout is for unknown status only. It has nothing to do with the offline status.

Kublacha year ago

Oh, sorry, status unknown is also OK to me... Is it possible to configure status.timeout per device?

Anton Tananaeva year ago

No, currently it's not.

Nikolay a year ago

@Kublach
Maybe inactivity status is a good approach. Status can be set per device. Not shure, but its work correctly for > 15min period of inactivity. Try it.