Skip to Main Content
Cumulocity IoT Feedback Portal
Status Unlikely to support
Categories Dashboarding
Created by Neil C
Created on Jul 22, 2022

Add additional {{ variables }} to HTML Widget, to convey widget dimensions

The widget is currently capable of passing the following variables:

  • {{device}} – current device or group, you can access its properties e.g. {{device.name}},

  • {{devices}} – children of current device or group, you can access their properties e.g. {{devices[14200].name}},

  • {{devicesCount}} – number of devices,

  • {{deviceGroupsCount}} – number of groups,

  • {{usersCount}} – number of users,

  • {{criticalDevicesCount}} – number of devices with critical alarm status,

  • {{onlineCount}} – number of online devices.


We propose to add the following new variables, to provide context for a server-side generator of HTML content:

  • {{widgetHeight}} - the height in pixels of the usable area of the widget

  • {{widgetWidth}} -the width in pixels of the usable area of the widget

  • {{widgetTheme}} - the theme selected for the widget, in the "Appearance" configuration page.

  • {{widgetHeaderStyle}} - the header style selected for the widget in teh "Appearance" configuration page.

  • Attach files
  • Admin
    Rahul Talreja
    Reply
    |
    Apr 6, 2023

    Hi Neil

    Thank you for raising this Idea and our apologies for not responding in a timely manner.

    We had quite a few internal discussions about your idea and came to the conclusion that an implementation is unfortunately not feasible.

    Instead, we would recommend you to build your own widget, which gives you full control. There are plenty of examples available on GitHub showing how this can be achieved. To make that even easier, with Cumulocity IoT 10.16, onwards you can utilize the new extension concept that allows you to build an extension package that can then be easily added to any Cumulocity IoT Application. You can find more details on this here.