A widget is a dashboard element for working with data. Widgets are used for:
Widgets are divided into types. Each type is designed to solve specific problems.
Chart – used to display trends over time. Used in cases where there are many data points and when it is necessary to group similar device parameters. The data is displayed unprocessed.
Area Plot – used to display trends over time. It is used in cases when it is required to show the relative change in the contribution of each parameter over time. The data is displayed unprocessed.
Bar chart – used to compare parameters. It is used in cases where the order of the data does not matter. The data is displayed unprocessed.
Bar chart of changes in interval – used to track changes in parameters over a certain period of time. The data is displayed in processed form. First, all data received is divided into hourly intervals (00: 00-00: 59, etc.). Further, for each interval, the values are calculated according to the formula С = В-А, where "С" is the value of the histogram column, point "A" is the initial value of the interval, and point "B" is the final value of the interval. This widget is well suited for counting counter changes.
Bar chart of mean values of changes in the interval – used to visualize changes in adjacent parameter values over a time interval. The data is displayed in processed form. First, all data received is divided into hourly intervals (00: 00-00: 59, etc.). Further, for each bet of values in the interval, the values are calculated by the formula C = BA-A, where "C" is the change value, point "A" and point "B" are two adjacent values in the interval. Then the arithmetic mean value is calculated in the interval, which will be used as the value of the histogram column. This widget is well suited for calculating changes in weather readings.
Parameter value – used to render the last value. It is used in cases where it is important to know the current values of the parameter. The data is displayed unprocessed. This widget is suitable for quickly informing the user about the current sensor readings.
Switches – used to control the device. It is used in cases when your device is connected via the MQTT protocol and is subscribed to the command acceptance topic. This widget allows you to send a command to your device, for example, to turn on or off the light.
YouTube HTML (iframe) – used to display video or live broadcast on the dashboard. It can be used for video surveillance, demonstration of device operation, video description of the dashboard, or just video from YouTube.
In order to add a widget to a dashboard, open the desired dashboard in the lower right corner there will be a button for adding a widget . Then the "Form for adding a widget to the dashboard" will open in this form, you need to specify the name of the widget, select its type, devices for receiving data and parameters for visualization. It is possible to use a maximum of 6 parameters in one widget.
Editing, Sorting, Deleting
To make it possible to change widgets, you must click on the button which is located in the lower right corner of the open Dashboard. After turning on the editing mode, each widget has a button for editing, deleting, and it becomes possible to sort the widgets. In order to move the widget, press and hold the left mouse button on the name of the widget and drag the widget to the desired location.
Each widget has two view modes: standard and full screen (maximized).
The full functionality of the widget is implemented in the standard display mode.
In expanded form, you can view data for the selected period, and in this mode statistical data are displayed, namely the average value and the range of values for each parameter in the widget. Also, if you need to open the widget in full screen and watch the data online, then turn on the auto update mode by checking the box next to the corresponding item.
A special widget with "Switches" has been developed to control the device. It can use the device parameters with the On / Off type. This widget is implemented as a list of parameters and a switch. By pressing the switch, a signal is sent to the device to enable or disable the parameter. The device receives the command and responds accordingly. After accepting the command, the device should send a new parameter state to the server.