MQTT Tiles variables

Configure variables in MQTT Tiles to select from the lists of like entities and populate the widgets with their values.

Defining variables in MQTT Tiles allows forming the drop-down lists to select from the items of the same type (e.g. channels, devices, streams, custom entities) and populate the widgets on the boards with the values associated with the selected entity.

For instance, you have several devices connected to flespi. If you define a variable <%device_name%>, you will be able to select the needed device from a drop-down list and have the widgets populated with the values taken from this device messages/telemetry/etc.

Variables are added in the board settings either upon creation or later on. If you decide to add variables to the existing board, go to the three dots on the board card and select Settings:

mqtt tiles board settings

Then find the Variables section in the opened dialog and configure the desired variables:

mqtt tiles board variable presets

The Presets field allows selecting from the most used variable sources — channels, devices, or calcs taken from your flespi account.

If you want to take variable values from a custom topic, pick Custom from the Presets drop-down, then pick Source from the Type drop-down, and specify the topic to take the values from.

mqtt tiles board variable custom source

If you need custom values for variables, pick Custom from the Presets drop-down, then pick Custom in the Type drop-down, and populate the custom values manually in the Items section:

mqtt tiles board custom variable values

Now you can open the board in the Full board view and add widgets that incorporate the values from the added variables.

When you open the dialog to add the new widget, you will see the (x) icon next to the drop-downs. Click on this icon to select the variable that will be used to form the source topic for the widget.

mqtt tiles widget topic source variable

Select the proper variable and parameter(s). Note that the parameters can also be selected from variable values if the suitable variable exists.

mqtt tiles topic source variable dropdown

Say, we want to convert the speed value to mph before showing it on the widget:

mqtt tiles widget math expression

Here’s the resulting widget showing the speed in miles for the selected device:

mqtt tiles widget result

***

Remember, variables in MQTT Tiles can be used only for forming subscriptions with the changing value on a certain level (or levels). 


See also
How to achieve MQTT bridging functionality in flespi
Apply webhooks to events from calculators to invoke your lambda upon an aggregated event happened to the device