you tried with calculated attributes?
Thanks Cristian, I already tried with calculated attributes and with the variable din3 it throws an error, and with ain.2 it doesn’t throw an error, but it doesn’t do anything either
and adding the gps model?
And I think it is di3 and not din3.
You need to make sure that in your expressions you're using attributes that your device actually sends. Not randomly guessing names. Check more details in the popup to see everything your device reports and the names are in Traccar.
I already solved it. I tried using calculated attributes with the expression in3 == 1 ? "sos" : null
, but it kept throwing an error saying that the variable in3 doesn't exist. So I decided to check TeltonikaProtocolDecoder.java, and in the line:
register(3, null, (p, b) -> p.set(Position.PREFIX_IN + 3, b.readUnsignedByte() > 0));
it's clearly storing the value in a variable in3, but for some reason Traccar doesn't recognize it. So instead of saving the variable, I decided to directly trigger the SOS alarm like this:
// Modified version to trigger SOS alarm:
register(3, null, (p, b) -> {
if (b.readUnsignedByte() > 0) {
p.addAlarm(Position.ALARM_SOS);
}
});
And now it's working correctly. I'm sharing this in case it's helpful for someone else.
Hello, I have an FMB130 GPS with the SOS configuration set to DIN3 high. When I activate the SOS, Traccar doesn't detect it. What configuration do I need to set up to make the SOS function work? thanks