Retrieve a "text" value from MQTT

Since Gladys version Gladys 4.24, you can send text to MQTT and display it on the dashboard.

I would like to be able to retrieve values containing text from a custom topic to then display them on the dashboard and, above all, use them in scenes.

Example 1: retrieve the value of the z2m bridge state and send a Telegram message when it goes offline:

Example 2: retrieve the current electricity tariff value:

{
  "value": "HCJB",
  "humanName": "[Maison][xxxxxxxx][PTEC]",
  "unite": "",
  "name": "PTEC",
  "type": "info",
  "subtype": "string"
}

Is it the same idea as calling a web API in the end, but using Zigbee?

I was thinking of it as a custom topic in an MQTT feature that retrieves a single value as soon as it changes.
If we go through an HTTP request, you need a scene that has to run all the time, so not necessarily ideal.

1 Like

Hi @mutmut :slight_smile:

I was sure it was already possible, but a few lines of code were missing to make it work.

It’s fixed!

If I configure a feature with a custom MQTT topic :

When I send a message on this custom topic :

I can see this text on my dashboard :

The PR :

4 Likes

It’s merged and will be included in the next version of Gladys

2 Likes

@pierre-gilles at this rate of PRs merged since the start of the week, you’re going to need 1 full day to write the changelog :stuck_out_tongue_winking_eye:

1 Like

And we, users, will have several days to discover everything and imagine new scenes or new dashboards… I can’t wait!

1 Like

This new feature is available in Gladys Assistant 4.58 :