Timed notifications and MQTT

Timed notifications and MQTT

CC0, unknown author.We are publishing a new VirtualHub and new firmware for the YoctoHubs. This new release offers two new features: support for timed notifications for MQTT and a new interface to configure these notifications.

Until now, configuring timed notifications was tedious, you had to either use the browser API, or one of our programming libraries. From now on, you can configure timed notifications from the YoctoHub and VirtualHub web interface.

The new configuration interface

In the module configuration window, there is a new section called Datalogger and Timed reports which displays the state of the data logger and a configure button.

The new section Datalogger and Timed reports
The new section Datalogger and Timed reports

This button enables you to open the configuration panel of the data logger and of timed notifications. The first section of this new panel enables you to modify the global parameters of the data logger, such as for example its starting mode.

The second section, Configurable functions, enables you to configure the logging and/or notification frequency for each sensor individually.

The new configuration interface
The new configuration interface

For technical reasons, you can't use distinct frequencies for the data logger and the notifications on the same function. Therefore, there is only one combo to configure frequency. You can, however, enable or disable data logging and notifications independently from one another.

Timed notifications with MQTT

The other new feature is the support of timed notification in MQTT callbacks. We saw in a previous post how to configure a YoctoHub or a VirtualHub so that it connects to and MQTT broker.

When connected, the current value of the connected sensors is immediately sent with the hardwareId or the friendlyName is a logical name was defined, as topic. This enables you to detect a value change as soon as possible. But in some cases, it's more practical to obtain an average value periodically. It's now possible thanks to timed notifications.

When a timed notification is configured for a sensor, the YoctoHub or the VirtualHub transmit the average value of the sensor. The topic of these messages is the same as for the immediate value, followed by "/avg". Moreover, if the notification frequency is configured in minutes or in hours, the minimum and maximum values are also sent.

Concretely, if you have configured a timed notification of "1/m" for the temperature sensor of a Yocto-Meteo with the METEOMK1-2DED6 serial number, the following messages are sent:

METEOMK1-2DED6/temperaturethe current valueimmediately
METEOMK1-2DED6/temperature/avgthe average value over the latest minuteeach minute
METEOMK1-2DED6/temperature/minthe minimum value of the latest minuteeach minute
METEOMK1-2DED6/temperature/maxthe maximum value of the latest minuteeach minute

Immediately available...

To use these new features, you only need to update your VirtualHub or YoctoHub.

Add a comment No comment yet Back to blog

Yoctopuce, get your stuff connected.