Stand with Ukraine flag
Pricing Try it now
Trendz Analytics
Documentation > AI Features > AI Widget Summary
Getting Started
Guides Installation
On this page

AI Widget Summary

AI Widget Summary is a dashboard control that turns live ThingsBoard telemetry into an immediate, human-readable answer. When pressed, it collects telemetries and attributes you specify, fills a chosen prompt (from the built-in library or your own), and calls the connected LLM provider. The returned output appears in the widget, giving operators a quick status digest, anomaly explanation, recommended next steps, or any other insight the prompt defines.

Several ways are available for integrating AI summaries with different types of widgets.

ThingsBoard Widgets Integration with Trendz AI

You can easily integrate Trendz AI prompts into your ThingsBoard widgets to generate data summaries directly within the widget header.

Available since: ThingsBoard PE v3.6+

Trendz Summary JavaScript Module

To enable Trendz AI features in ThingsBoard widget headers, connect the Trendz AI Summary Module. The setup process varies slightly depending on your ThingsBoard version.

ThingsBoard v3.9 and Higher

Starting from v3.9, ThingsBoard supports JS Modules directly in widget actions, simplifying the configuration.

Steps:

  1. Open the Settings page in the Trendz app.
  2. Click Upload Module.
  3. Confirm the module appears in the list after upload.

Once uploaded, you can reference the module in your widget’s Actions configuration.

ThingsBoard v3.6–v3.8

For older versions, JS Modules cannot be used directly. You’ll need to manually include the provided JavaScript code in your widget action.

Download the custom module:

1
http://<your-trendz-host:port>/apiTrendz/publicApi/download/custom-action-ai-summary.js

Replace <your-trendz-host:port> with your own Trendz instance URL.

Configure a Custom Action for Telemetry Summary

  1. Open the dashboard containing your widget.
  2. Switch to Edit mode.
  3. Click Edit Widget on widget you want to add custom AI summary action.
  4. Go to the Actions tab.
  5. Click Add action and configure:
    • Action source: Widget header button
    • Name: Any (e.g., AI Summary)
    • Button icon: Choose any (default: )
    • Action: Custom action

ThingsBoard v3.9 and Higher

You can use the JS module directly in the custom action:

  1. Click ModulesAdd module.
  2. Set the following:
    • Alias: trendz
    • JS module resource: Trendz AI Summary Module (The name may vary in whitelabeled versions.)
  3. Click Apply.
  4. In the custom action code field, add:
    1
    
    trendz.getAnalytics(widgetContext, true);
    
  5. Click Add, then Apply, and finally Save widget.

ThingsBoard v3.6–v3.8

  1. Manually copy the full JavaScript code from custom-action-ai-summary.js into your custom action field.
  2. At the end of the custom action code field, add:

    1
    
    trendz.getAnalytics(widgetContext, true);
    
  3. Click Add, then Apply, and finally Save widget.

Using the Custom Action

After configuration, a new button appears in your widget header. Clicking it opens a dialog showing a summary generated by Trendz AI based on your widget’s data and prompt settings.

You can improve text quolity that are generated with AI summary functionality, adding your custom instructions or additional business knowladges about your data using getAnalytics() advanced parameters.

Advanced Usage of getAnalytics()

The getAnalytics() method supports three usage modes:

1. Default Prompt from Trendz

Uses the system default prompt (Trendz System Default Summary Prompt):

1
getAnalytics(widgetContext, true);

2. Custom Inline Text

Use Trendz only as the LLM model and provide your own text prompt:

1
getAnalytics(widgetContext, false, 'Identify which tanks require additional attention and explain why.');

3. Saved Prompt by ID

Use a saved prompt from Trendz by specifying its ID:

1
getAnalytics(widgetContext, false, 'ef348780-a034-4ea9-9225-8b6ad112c451');

Recommendation: Use the Prompt ID from Trendz for easier management and updates.

Learn more about managing prompts in Trendz AI Prompts Overview.

Trendz Widgets

AI summary is already integrated into the Trendz Widgets. To retrieve the AI summary for a Trendz widget, press the AI summary button in the upper corner of the screen. After that, you will be able to view the AI summary at the top of the Trendz widget.

Enable AI Summary Button

By default, the AI summary button is disabled on dashboards for views created before Trendz 1.13.1 and for views created during the period when the AI Assistant Use AI Model flag was disabled for self-hosted users (Find out more about how to set up the AI Assistant module for self-hosted users here).

To enable/disable the AI summary button, follow these steps:

  1. Open the desired view.
  2. Go to View Settings.
  3. Go to the View Mode Fields section.
  4. Choose the preferred mode to show or hide the AI Summary button.
  5. Save the changes in view.

Note: button in Trendz application will always be shown (even with checkbox )

Set Up AI Summary Prompt

Additionally, it is possible to choose a prompt that can be used to generate the AI summary.

To set up the AI summary prompt:

  1. Open the desired view.
  2. Go to View Settings.
  3. Go to the AI Assistant section.
  4. Choose the preferred prompt from the dropdown menu.
  5. Save the changes.

Find out more about creating your own prompts that perfectly fit your task here.

⚠️ Note: Temporary you can use AI Summary for all the views in Trendz, except Anomaly View.

Next Steps

  • Getting started guide - These guide provide quick overview of main Trendz features.

  • Installation guides - Learn how to setup ThingsBoard on various available operating systems.

  • Metric Explorer - Learn how to explore and create new metrics with Trendz Metric Explorer.

  • Anomaly Detection - Learn how to identify anomalies in the data.

  • Calculated Fields - Learn about Calculated fields and how to use them.

  • States - Learn how to define and analyse states for assets based on raw telemetry.

  • Prediction - Learn how to make forecasts and predict telemetry behavior.

  • Filters - Learn how filter dataset during analysis.

  • Available Visualizations - Learn about visualization widgets available in Trendz and how to configure them.

  • Share and embed Visualizations - Learn how to add Trendz visualizations on ThingsBoard dashboard or 3rd party web pages.