Well, that's typical; after writing the post above, I just got a notification on the phone: inactivity, after about 11 minutes.
This was after I'd added the Device Inactivity Start attribute, and set it to '1'.
But, still no 'offline' notification...
Possibly also relevant: I have the stationary heartbeat setting, in Traccar client, set to 60, and it appears to stop that after around 15 minutes? (according to the Logs).
Ah... do I need to set EVENT_STATUS_ENABLE=true (default false) as an environment variable?
Edit: yes, that's fixed it. Now receiving 'Online' notification.
But... why did the 'inactive' notification work, without doing this? (and, if I recall correctly, also the geofence notifications).
First of all, I think you're confusing events and notifications. Events is something that is generated independently on whether you have a notification setup or not. Inactive event is already configurable individually. But connection status events are configured by a single global parameter.
Notifications on the other hand are just for notifying you about events. They don't control whether event happens or not. They just send you push/email/whatever notification about an event that happened.
I do (and did) understand that events are independent of notifications (although notifications about events can't happen if the events can't happen / be detected first!).
I didn't know, though, that the 'Inactive' event is configurable separately to the connection status events; that answers my question above.
I would still like to know more about the timings, though (e.g. how long before notifications are issued after events, and how/where that can be adjusted).
You say you do, but then you ask a question that contradicts it. Notification is just a notification. It is sent immediately when an event happens. Timing adjustment is not really applicable to notifications.
No, I get it (but I expect you'll tell me, again, that I don't understand):
Events occur independently of whether or not a notification is set up (to do otherwise would make no sense);
Notifications are dependent on events occurring, and are issued immediately an event occurs (though I don't/can't know if this holds for all notifications your system might issue).
So my question should probably actually be about when various events are perceived / generated by the system. See below; I'm not attempting to define what the actual events are / are called, just reporting what I did ('Action') and the notifications received:
11: 45:
Action: Open Traccar Client;
Notification: "iPhone online at 11:45:00";
Web manager reports 'Online'.
11:55:
Action: None;
Notification: "iPhone inactive from 11:45:00);
Web manager reports 'Online' (no change).
11:56:
Action: None;
Notification: "iPhone status is unknown at 11:55:54";
Web manager reports "11 minutes ago" (it's always 11 minutes).
Perhaps the Traccar Client is sending these events? (I don't / can't know what the app does here). But the above implies that there are 10 / 11 minute timeouts between events being perceived / generated.
Btw, I never receive an 'Offline' notification for the iPhone/Traccar Client. Is this something to do with "[protocol].timeout"? (and what is the default for this?).
Meanwhile, a Teltonika tracker I have set to wake up every 15 minutes always causes 'online' and 'offline' notifications to be issued in rapid succession (with data sent in between).
These events are generated by the server. The timings come from separate checks:
status.timeout, which defaults to 600 seconds. Periodic checking can make the change appear around 11 minutes.1 does not produce an immediate event. “Inactive from 11:45” refers to the last communication time.Traccar Client uses HTTP, for which the server does not generate offline events when a connection closes. Use Unknown notifications to detect when it stops reporting.
Your Teltonika’s behaviour is consistent with connecting, sending its data, and disconnecting again, which produces online and offline events.
[protocol].timeout controls idle network connections. Unless overridden, it falls back to server.timeout, currently 1800 seconds. It is separate from status.timeout and will not enable offline events for Traccar Client.
Ok, thank you, that's much clearer now.
I may change status.timeout to be shorter (presumably I can set an environment variable as "STATUS_TIMEOUT=NNN"). Unless there's some reason why I shouldn't?
I'm not sure what useful information Inactive adds, if I use Unknown, so I'll probably remove the connection for the iPhone to the 'Device inactive' notification (and/or remove the notification itself).
You're definitely misusing inactive event. The idea is that you can set some long time, like 24 hours. Regular status events can be noisy and the intention for this one is to detect devices that have legitimate issues and went permanently offline.
Ah, ok; I will keep it for the Teltonika (vehicle), in case that stops waking up and sending data (means flat battery / worse).
If setting Device Inactivity Start to 1 doesn't produce an immediate event (after the 15-minutely check), then when does it produce an event?
Also, in my example above, the time between Online and Inactive is 10 minutes (then another minute or so to Unknown). I've done this test a couple of times, and it's been 10 mins from Online to Inactive both times.
For the Teltonika, would I really need to set Device Inactivity Start for e.g. 1,440,000mS (24hrs), though? And the period to e.g. hourly? (3,600,000mS).
I won't use Inactive for iPhone(s), because use of tracking with those is more sporadic / optional, so it could easily be a very long time between uses.
I've disabled the online and offline notifications for the Teltonika, because those would be occurring every 15 mins (i.e. regular noisy status events you mention).
I tried to edit the 1,440,000 figure because it is, of course, wrong. But the editing time-window had timed out. I think it should be 86,400,000.
Also...
I have removed the Connection, for the iPhone, to the Inactive notification, but I'm still receiving 'inactive' notifications.
Do you have "all devices" checkbox ticked?
D'oh! Yes, that was it.
Thanks.
I now have notifications set up, and can successfully send and receive test notifications via web, email and Pushover, to my phone (iOS).
I have Traccar Client on this Device (iPhone), and this and the to-be-notified User are both 'connected' to notifications, including Device online and Device offline (amongst several others).
But, when the Traccar Client is not set for continuous tracking, or even if the app is closed, I am not receiving any notifications (though I have not tried leaving a geofence yet). The phone shows as online in the Traccar web manager, and shows as e.g. '12 minutes ago' when not online (presumably).
So:
What qualifies as 'online' and 'offline'?
How long does a Device (e.g. this phone) have to be offline (and online) before a notification is triggered? Can this time be set anywhere?
What qualifies as 'inactivity'?
What do the numbers in the Device Inactivity Start and Device Inactivity Period stand for, e.g. minutes, hours...?
Thank you.