# Latency with messages?

**URL:** <https://forums.losant.com/t/latency-with-messages/3978>\
**Category:** Help\
**Tags:** mqtt, workflow, device\
**Created:** [August 4, 2021, 8:39pm UTC](https://forums.losant.com/t/latency-with-messages/3978 "2021-08-04T20:39:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jackson\_Miller](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jackson\_Miller](https://forums.losant.com/u/Jackson_Miller)\
**Post date:** [August 4, 2021, 8:39pm UTC](https://forums.losant.com/t/latency-with-messages/3978/1 "2021-08-04T20:39:03Z")

</div>

In my workflow I have a device disconnect node that goes off after a couple minutes without a mqtt message packet being received. I have tested it thoroughly and I know it works.

 ![Connection not working](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/a/a36be70c80f00f5058b67d1c10722cb9312051b1.png)

I am wondering how these graphs update, because there are multiple periods on this graph with large gaps of 30 minutes or more however no message was sent to my phone so I know that the application was still receiving mqtt messages. I am wondering what is happening behind the scenes on losant when there are these gaps?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [August 4, 2021, 9:21pm UTC](https://forums.losant.com/t/latency-with-messages/3978/3 "2021-08-04T21:21:59Z")

</div>

Before answering, I’m making some assumptions here …

- This screenshot comes from a dashboard [time series graph](https://docs.losant.com/dashboards/time-series-graph/), and each of your segments targets a single device/attribute combination.
- When you say “device disconnect node”, I’m guessing you actually mean a [Device: Inactive Trigger](https://docs.losant.com/workflows/triggers/on-inactivity/), given your followup statement of “goes off after a couple minutes without a mqtt message packet being received.” (A [Device: Disconnect Trigger](https://docs.losant.com/workflows/triggers/on-disconnect/), by comparison, would fire immediately as soon as a device disconnects from the broker.)

If my assumptions are accurate, then the gaps you see in the graph could be reconciled against the lack of an inactivity alert if the the attribute for a given device was not reported for that gap time period, but _other attribute values were reported for the device_ in that time period. When returning graph data to the dashboard, if we do not have data for a given resolution bucket, we simply return no data for that resolution bucket’s timestamp. (If, in the graph, you’d like these gaps to connect through anyways, you can set that option per segment.)

Alternatively, depending on how long “a couple minutes” actually is (2? 5? 10?), it could be possible that your device stopped receiving state reports for those gap periods, but the gap is not long enough to trigger the Inactivity Trigger.

---

<div class="post-metadata">

**Author:** ![Jackson\_Miller](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jackson\_Miller](https://forums.losant.com/u/Jackson_Miller)\
**Post date:** [August 4, 2021, 9:24pm UTC](https://forums.losant.com/t/latency-with-messages/3978/4 "2021-08-04T21:24:04Z")

</div>

The situation is becoming even more weird:

My MQTT messages in are stating that all the switches are on. It appears that way on my bar graph too but my histogram is showing now that two of the switches are off which was what it was this morning like 5 hours ago. What is up with the major delay??

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/3/37e9e4c988505137efd460da3d3bee15fc556fcb.png)

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/9/929cb991fd13ac404ed8c8c933c9e3545c17bddd.png)

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [August 4, 2021, 9:38pm UTC](https://forums.losant.com/t/latency-with-messages/3978/5 "2021-08-04T21:38:20Z")

</div>

- Does what you’re seeing in the dashboard coincide with that you’re seeing in a [device state export](https://docs.losant.com/devices/bulk-actions/#request-data-export) or in the [Data Explorer](https://docs.losant.com/applications/data-explorer/)?
- Are you [viewing a past dashboard state](https://docs.losant.com/dashboards/overview/#viewing-past-dashboard-states)?
- Are you [applying an expression](https://docs.losant.com/dashboards/time-series-graph/#block-data) to your graph segments?

---

<div class="post-metadata">

**Author:** ![Jackson\_Miller](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jackson\_Miller](https://forums.losant.com/u/Jackson_Miller)\
**Post date:** [August 5, 2021, 6:56pm UTC](https://forums.losant.com/t/latency-with-messages/3978/6 "2021-08-05T18:56:11Z")

</div>

I am applying an expression to my graph segments because my switches are low-true so I have to invert the output to have it make sense.

I was viewing a current dashboard state.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [August 6, 2021, 1:53pm UTC](https://forums.losant.com/t/latency-with-messages/3978/7 "2021-08-06T13:53:53Z")

</div>

Can you provide the dashboard ID and timestamp at which you took the screenshots in your previous reply? You can just visit the dashboard, use the time picker to travel to that moment, and paste the link here (or PM it to me). Note that if you paste the link here in this public thread, and this is a [public dashboard](https://docs.losant.com/dashboards/overview/#dashboard-access-control), it will be visible to anybody who reads this post until the dashboard is no longer made public.

---

<div class="post-metadata">

**Author:** ![Jackson\_Miller](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jackson\_Miller](https://forums.losant.com/u/Jackson_Miller)\
**Post date:** [August 9, 2021, 9:09pm UTC](https://forums.losant.com/t/latency-with-messages/3978/8 "2021-08-09T21:09:56Z")

</div>

I sent you a PM @Dylan_Schuster

---

<div class="post-metadata">

**Author:** ![Jackson\_Miller](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jackson\_Miller](https://forums.losant.com/u/Jackson_Miller)\
**Post date:** [August 11, 2021, 3:40am UTC](https://forums.losant.com/t/latency-with-messages/3978/9 "2021-08-11T03:40:12Z")

</div>

For anyone else who has this problem in the future:

Even though my device was sending data at the right times, the onboard timestamp was a couple hours in the past and it was throwing off some of the readings once they got to losant.
