Experience views and multiple dashboards

Hi

I am new to Losant and I am basically trying to kick the tires and see if it fits my business requirement and I apologize if the solution is obvious. I am looking for information or direction on how to go about displaying multiple dashboards in a single Experience view/views, I will try and explain below…

A user that has the following devices/sensors and we wish to use Losant to monitor and tracker various measurements

  • A Temperature/Humidity sensor
  • An Asset Tracker

I have added the user as device owner using tags on the devices, I am receiving data via webhook from TTN v3, and I have created separate dashboards for the devices/sensors since they are under different subject area, also I struggled with using context variables across different devices…so i added a device_type tag [Tracker, and Environment]and use that to filter/validate the context, and it looks like I have functional dashboards

My question is how do I get both dashboards into experience view(s)?, I would like to display summary data, and have the option to select any one of the three assets and display the related detail dashboard.

I am very very new to Losant, please any pointers on how to go about this is appreciated and apologies if this is the wrong place for this question.

Cheers and thanks

Ben

Hi @benjamin_mukoro, and welcome to the Losant forums.

The best way to show you how to do this - while also demonstrating the use of context variables in dashboards, as you’ll certainly need to use those as your application scales - is to put a demo application in your hands. We have a great example in the Asset Tracker application template: It demonstrates how to set up experience endpoints, workflows, and pages to render the dashboards you’ve built for your end users, including an overview dashboard that shows all devices, and a detail dashboard that looks at one specific device utilizing context variables to know which device to display. I recommend adding a new application from that template and seeing how all the pieces work together, then applying that to your existing application.

Also, if you have an hour or so, you can watch our Building Application Experiences Deeper Dive that also covers these topics.

Or if you’re ready to really move things forward, I recommend checking out Losant University for some detailed lessons on a variety of topics, including application experiences.

If you have any other questions, please let us know!

Hi @Dylan_Schuster

Many thanks for your quick response and advise, after going through the recommended Deeper Dive, I think I found a solution…It is not pretty but I think I understand Losant a little bit more…

Using Experience workflow, and a combination of device Id and device tags (sensor_type), I was able to redirect to one of three Experience pages (Overview Dashboard, Environment Detail Dashboard, and Tracker Detailed Dashboard)

If sensor_type => Environmental => load environmental detail dashboard
If sensor_type => Tracker => load Tracker detail dashboard

It was a little bit tricky trying to get to the device tags for the selected device in the pageData object.

Thanks again.

Cheers

Ben

@benjamin_mukoro I just peeked in your account to make sure you had everything right and you nailed it. Excellent work!

The only thing I might do differently is this: You have two endpoints configured for what you’re trying to do, and have a trigger for each in your experience workflow:

  • /devices
  • /devices/{deviceId}

There’s nothing wrong with this, but if you do start to run into an endpoint limit, you could combine these into a single endpoint using an optional path parameter, like so:

  • /devices/{deviceId?}

Then, requests to your overview dashboard and your device-specific dashboard would both cause that trigger to fire, and pretty much everything else you have in your workflow to this point would remain the same other than reducing to just the one trigger.

Hi @Dylan_Schuster Thanks for peeking, I am humbled and grateful for your feedback, my Losant journey continues, I made the suggested endpoint adjustments, thanks for that tip.

I have one simple question, I am trying to display device names in the dashboard, I can get to Device Id via the context. I believe you responded to a similar post back in 2018 https://forums.losant.com/t/solved-dynamic-dashboards/388/9, I tried to follow the steps in the post, I got lost, if you have a moment, please take a peek. I could use your help.

Cheers

Ben

That thread is actually outdated now, as we’ve since added the ability to return additional device information when utilizing a device ID context variable – which I assume you are doing here.

It’s opt-in behavior within the dashboard configuration, so you’ll need to make sure that box is checked. Then, wherever you want to display that device name – a block header, a section header, etc. – you can reference the name using the string template {{ctx.YOUR_DEVICE_ID_VARIABLE_NAME.name}}.