Unknown Connection Status using webhooks

I currently have a few Particle Photon-based devices reporting their state using webhooks to my application. This is mostly working fine, although my devices end up with an unknown connection status.

Is there any way for me to update their connection status manually?

1 Like

Currently the device connection indicator is tied to the MQTT connection state. We’re seeing lots of users connecting and reporting in ways other than MQTT, like your use-case. We’ve made it a priority to re-think how connection is reported so we can better display the status. The ability to update via the API makes a lot of sense - I’ve created a ticket to expose that functionality.

1 Like

This was the first posting I saw when searching for this issue. Is there any update to this? Will keep looking. I am having the same issue. Get connections via webhook, but does not update device log.

Are you connecting to the Losant MQTT broker using websockets? If so, those connections should show up in the connection log.

I’m just using a webhook and going through the flow from there (SigFox backend calls the webhook). Maybe I could make a webhook that feeds the MQTT broker first? Then re-retrieve it from MQTT then process it via workflow. It’s a little convoluted but seems like it would work.

Oh, apologies. I misread the previous topic as “websockets” instead of “webhooks”.

This is still something we haven’t got a clean solution for. Device connection status is still directly tied to MQTT connections. When using Sigfox and other connectivity providers, the connection status won’t update. Since external providers are becoming more popular, this is something that’s high priority for us to address.

1 Like

Any update on the ability to log arriving webhooks?
Basically how can we trend incoming webhook with respect to:

  1. Time the webhook payload arrived (building a historian for the time the webhooks arrived)
  2. Webhook content quality tool (i.e. payload content keys count)

@tirosh_gutte,

There are three methods if you would like to log arriving webhooks ( or log workflow payloads in general).

As a Device

If you want this data on a Losant Dashboard, it has to be reported as device state. You can make a device that represents the “Webhook”. Devices in Losant can be anything. You can treat your “Webhook” or “Workflow” as a device and store the different metrics ( counts, data ) you want as attributes on that device. Depending on how much data you generate, I would be mindful of payloads.

Data Table

Before I start, Data Tables should not be used for time-series data. Mostly because aggregations are not supported on Data Table values.

But, if you were only logging a couple of times a day, Data Tables could work. Data Tables have limits too.

Third-Party Service

Any logging service, such as Loggly or Data Dog, can be used to store a history of your workflow payloads.

Happy to dig in further and answer more questions!

As a Device make most Sense

  1. Created a new device in losant and labeled it Webhook Logger
  2. Added it to the workflow under webhook reply
  3. Built a dashboard with a time series graph block with the following criteria:

Are there any intermediate steps I am missing here? So far I can not seem to populate the payload count?

@tirosh_gutte,

Can you please screenshot the section of the Device: State Node’s setting called “State”?

The payload look like similar to this:
{
“globals”: {},
“applicationName”: “—”,
“flowName”: “—”,
“flowId”: “—”,
“flowVersion”: “—”,
“relayType”: “—”,
“relayId”: “—”,
“triggerType”: “—”,
“triggerId”: “—”,
“applicationId”: “—”,
“data”: {
“replyId”: “—”,
“body”: {
“time”: “2020-04-29T17:42:50.981Z”,
“data”: {
“path”: “/”,
“method”: “post”,
“headers”: {},
“query”: {},
“body”: null,
“replyId”: “—”
},

},
“time”: “2020-05-07T18:00:01.056Z”
}

I did see this in your payload:

It looks like body is null. Is that correct?

Also, is this payload path correct: {{data.body.data.[153002].[analog-value:21 (cut off from screenshot)? Could you point me to where the data exists on the payload in the Debug Panel?

Correct, the body currently does not have content.
I just want to log the incoming webhooks, no interest in the body content at this stage, just want to verify the body section is arriving.
What attribute/value payload path should I select in order to count the incoming webhooks body section?

@tirosh_gutte,

This is specific to your application. However, you could have a boolean attributes called hasBody and report a one or zero when you see body. This is because the presence of the body is important. This would give you a devices that represents the history of request and you’ll be able to see if those requests had a body or not.

If you want to store other attributes about your webhook, they just have to be one of the following types:

1 Like