Fantastic software thank you to the devs. Posting this here in case it helps someone as I saw quite a few solutions that didn't quite get there. I wanted to:
- Generate an Alarm Event on loss of power to Teltonika devices.
- Keep that Alarm active and visible on the web app GUI as long as the power was cut.
- Generate an Alarm Event on power restore.
- Have the restore alarm clear and not appear on the web app GUI after the restore Alarm Event.
Steps:
A. Set the Teltonika device to report Unplug Detection with 'Eventual Records' Disabled. This ensures the state is sent with each record.
B. Enable processing.computedAttributes.lastAttributes in the traccar.xml config file with this line:
<entry key='processing.computedAttributes.lastAttributes'>true</entry>
C. Restart the server (I don't know if this is necessary.)
D. Create a Computed Attribute with the following:
Attribute:
Alarm
Expression:
io252 == 1 && lastIo252 == 0 ? "powerCut" :
io252 == 1 && lastIo252 == 1 ? "powerCut" :
io252 == 0 && lastIo252 == 1 ? "powerRestored" :
io252 == 0 && lastIo252 == 0 ? null : null
E. Finally, link the Computed Attribute to a Device or Group.
Fantastic software thank you to the devs. Posting this here in case it helps someone as I saw quite a few solutions that didn't quite get there. I wanted to:
Steps:
A. Set the Teltonika device to report Unplug Detection with 'Eventual Records' Disabled. This ensures the state is sent with each record.
B. Enable processing.computedAttributes.lastAttributes in the traccar.xml config file with this line:
C. Restart the server (I don't know if this is necessary.)
D. Create a Computed Attribute with the following:
Attribute:
Alarm
Expression:
E. Finally, link the Computed Attribute to a Device or Group.