You can create an alarm if you see ignition value between those hours using computed attributes.
Is there any code samples
There are some examples in the documentation, but obviously not exactly this thing.
Hi @kevinhartin, did you manage to create the calculated attribute with hours?
Hello guys,
Just wanted to share a possible solution. I’m using a Teltonika device, which sends event == 239
when the ignition is turned on. Here’s the computed attribute expression I tested:
event && event == 239 && (fixTime.getHours() >= 18 || fixTime.getHours() < 6) ? 'powerOn' : null
You can then create your notification based on the "powerOn"
alarm.
Let me know if this helps! :)
I have a situation where I need to detect a ignitionOn event between 6pm and 6am and subsequently send an email.
I can do this fairly easily with a php script that runs via a cron job, but was wondering if it can be done inside traccar server using Computed Attributes and Notifications.