Experience View Event List Details bug

When viewing the “Event Details” of an event, through an experience page, the URL to the device page for the device associated with the event is relative to the experience page domain, and so doesn’t go anywhere.

I suppose I could create an endpoint that would make this work, but having that sort of long non human readable endpoint is not really fitting with how I think most people would be creating their experiences.

I think removing the hyperlink entirely when viewing from an experience page is probably the simplest option, but if there were some way to custom specify a URL for that, that would be cool too.

I just noticed that when I add a “Device” column to the event list on the dashboard, and view the dashboard as an Experience User, the device hyperlink is removed. The same logic should apply within the event details view.

@Nate_Usher

Thanks for your input! I’m filing this ticket now within our system :slight_smile:

Hi, I am using the Assets experience template and on events block, I cannot expand the event details or acknowledge events. I am using Sandbox account.
If I use the Industrial experience template, the events block works correctly.
Is it just a difference in templates or am I doing something wrong ?

The first thing to check is whether or not the Allow Updates checkbox is checked for your specific Event List.

Ok that sorted it - thanks.
On the events list, device name column is empty but maybe no permission here …

Permissions could be the issue. Are you using the Asset Tracking template as-is? Also are you viewing the dashboard directly or through the experience? Can you drop a screenshot of what you’re seeing?

attached is screenshot…
I am using dashboard view thru experience but same viewing directly.
Also, I am modifying the asset template to cater for live devices rather than simulator.

Hello @SEAN_O_CONNELL,

I’m looking into this for you right now. I’ll be sure to update you as soon as I have an answer for you!

Thanks,
Heath

Hi @SEAN_O_CONNELL,

You mentioned above that you are modifying the template to cater to live device data. It is possible that when you created your workflow for live device data that you are not associating those events to your new/live devices?

Can you double check that in your live version you are setting deviceID on events?

These docs specifically around Event Queries may help clear up the issue:

Let us know if that helps clear things up.

@Aidan_Zebertavage

Ok Aidan, I will check when events start up again …

On another note, I am using seperate webhook enabled workflows for about 4 live devices. I will eventually need to add 250+ live devices and wondering is there a more efficient way to do this using say one workflow and one webhook ?
Looking at assets template, I see just one workflow to get devices and one for simulator. Basically, all I need is to replace the simulator workflow with my live devices workflow ?

Thanks

@SEAN_O_CONNELL,

If I’m understanding you correctly, you are asking about two different topics - the first, is there a way to have devices be registered with your application in a more efficient way, and the second is modifying the simulator workflow (or creating a new one) to access state date from your live devices for monitoring and event reporting.

For your first question, some options to exist for more efficiently registering devices. The docs detail these a bit more specifically here, in “Other Ways to Add Devices”:

If you have all 250+ that will be added in bulk at the same time, you can leverage a “Device Recipe” option. The second option detailed is to use the Device: Create Node in a workflow that is triggered by a webhook - the configuration of this node will also require you to define a [Device Recipe].(https://docs.losant.com/devices/device-recipes/)

Losant has published an article on this exact topic as well:

In the HTTP request made to the webhook, you would have to send some sort of device identifier. Then, you can look up said device by that identifier. Then, you may create the device and then report, or report if the device was found. Take a look at the below workflow for reference:

For the modifications to your workflows to use live device data - you actually won’t need the Data Simulator workflow at all. The Event Logger workflows “Device: State Node” can be reconfigured in the 'Device ID/Tag" section to reference your live device data.

Hopefully this is helpful - let us know if you need more help!

Thanks
@Aidan_Zebertavage

Ok Aidan thanks for this.
If I use modified event logger workflow for many devices, will I still need the “get_devices” experience workflow ?
Also, you say that I need to send device id with webhook http data. Do you have an example of this or would sending an attribute or tag of specific device id do instead ?

Hi @SEAN_O_CONNELL,

For your first question - Assuming you have not changed anything in the template, yes, you will still need both the the “get_devices” workflow and the “event_logger” workflow. These are two different workflow types in our template, the ‘event_logger’ workflow is an application workflow, which contains the logic behind determining whether an event has occurred that needs to be logged based on the conditions set in the workflow, i.e. temperature of the asset has dropped below a defined value.

The ‘get_devices’ workflow is specific to experiences - where upon making a GET request the experience looks to find all devices that have had an event logged in the application, and then display those devices in the experience.

The Workflows documentation does a great job of describing the differences between the various workflow types and how they differ:

For your second question, one option would be to make an HTTP Post to the webhook from your experience that contains something like the below:

{
 "serial": "12334",
 "data": {
   "temp": 32,
 }
}

Where serial is a DeviceID or tag. This would allow you when creating devices to point to the same webhook that triggers the workflow for adding devices to your application.

Thanks
@Aidan_Zebertavage

I do not fully understand the last answer. Where do I add this serial code - in the device application code or in Losant ?

@SEAN_O_CONNELL,

We may be trying to solve a few different issues simultaneously here. Can you help me understand if your goal is for automated device registration? Or are you hoping to report state data for all of the devices using one webhook?

If you take a look at the blog article I sent along on ‘How Devices can Register Themselves in Losant’, it does a great job of explaining how to configure each node within an experience workflow, including the Create Device node - which would something similar to the code snippet I sent along yesterday.

The serial value that is located on the payload above is exclusively an example of the JSON that is received by the Self-Registration workflow. You do not have to use serial per se, it is just a value that is used in the blog article to determine a unique device.

If you were to trigger the Self-Registration workflow from another, the original workflow would include an HTTP Node with a POST Request, this is where the example JSON object was configured. This POST request would then trigger the Self-Registration Workflow and the serial data would be passed to this workflow.

Thanks,
@Aidan_Zebertavage

Aidan, I think self registration is not needed now if we can avoid it. It looks a little complicated. So, we stick to updating device states from the one webhook.
I do not think self registration is used on templates anyway.
Actually, the assets template is fine if I could just add many devices easily using just one webhook and one piece of device code for all devices.

@SEAN_O_CONNELL,

Thanks for the clarification on self-registration. To be clear, you are not limited to the workflows that are preconfigured as part of the templates (or any of the associated resources), you can add, modify or remove resources from the application template at your discretion. The template provides a starting point for your application, so if you did ever want to get to self-registration of devices, you can certainly build that workflow within the template.

Now, you state, your main request is to “add many devices easily using just one webhook and one piece of device code for all devices” - in doing some digging, it seems that you may have a had a similar issue a few months ago, there are some great resources provided here:

In reviewing this thread, can I assume that you have the webhook-url configured in your device(s)? I just want to ensure that I understand how you are triggering the webhook?

Thanks,
@Aidan_Zebertavage

Yes, I have webhook url setup on my devices. At the moment, I am using seperate webhooks for each device which works ok but not feasible in longer term as I want just one webhook for all devices.
So, if I do not use self registration of devices, what compact workflows do I need ; eg. get_ devices, event_ logger etc for monitoring many devices ?