# Problem retrieving a Text value stored in MQTT

**URL:** <https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244>\
**Category:** Configuration\
**Tags:** mqtt\
**Created:** [December 14, 2024, 11:02pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244 "2024-12-14T23:02:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 14, 2024, 11:02pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/1 "2024-12-14T23:02:48Z")

</div>

Hello,  
I’ve been trying for several days to understand why I can’t retrieve `text` values that I stored in MQTT.

I have 2 simple examples to illustrate my case.

**1. Retrieving a value coming from Jeedom**  
From Jeedom I publish values from la téléinfo that I retrieve. I can retrieve the numeric `value`s (from object 579 for example), but it’s impossible to retrieve the `value` of object 578 to display it on my dashboard (OPTARIF) :

 ![gladys_Capture d’écran 2024-12-03 à 15.38.18](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/9/494cdfd58907c9cfe0b74c6fb6291c7a508e108d.jpeg)  
I tested as an object `Text` or `Mode` and neither works.  
 ![Capture d’écran 2024-12-14 à 23.24.08](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/8/d/8d8497482f361897eb06bc041bcda841a7a61678.png) ![Capture d’écran 2024-12-14 à 23.51.58](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/5/9/59618e6b83e4ec5ece0cb395abd5d18e9b3a1e3b.png)  
 ![Capture d’écran 2024-12-08 à 21.08.11](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/7/378e10aa52a383a66ac53110bcb56428c55e2702.png) ![Capture d’écran 2024-12-15 à 00.00.02](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/a/4abbaca493410a619d091b0946b66a5ebd356068.png)

**2. Retrieving a text to send it to another MQTT object**  
For my heating, I send a `text` value to MQTT (_Confort_ for example) :

 ![Capture d’écran 2024-12-14 à 23.01.37](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/e/ceea5eb4662addd0ef6e1a9c831fae6dd664ff31.png)  
When I retrieve it, I get a null value… which I send back to MQTT instead of being able to resend the original text.  
 ![Capture d’écran 2024-12-14 à 23.16.00](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/8/6/8675b70496eb58ff867ebe4cc65b8bf6b0c58a32.png)

And tonight I finally understood why I couldn’t retrieve this text: I was using the «&nbsp;Get last state&nbsp;» block and that block doesn’t retrieve text but only numeric values ☹  
Of course, I would also like to retrieve this `text` value to make conditions in scenes and for now I’m leaving it aside since it doesn’t work as I wish.

I found this post [Permettre la recuperation de data de type text ou alpha!](https://community.gladysassistant.com/t/permettre-la-recuperation-de-data-de-type-text-ou-alpha/7864) but the final solution doesn’t mention retrieval via scenes, only the dashboard.  
I’m probably confusing a lot of things, I’m a beginner 😉

Would anyone have a solution (simple if possible) to retrieve `text` values stored in MQTT?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 16, 2024, 7:35pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/2 "2024-12-16T19:35:24Z")

</div>

Hi @mutmut 🙂

Indeed, it is not possible to do what you want to do, except by using integers instead of text.

What exactly do you want to do (functionally), what is the final use?

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 17, 2024, 6:25pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/3 "2024-12-17T18:25:24Z")

</div>

Hi @pierre-gilles ,

\*\*

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 17, 2024, 6:37pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/4 "2024-12-17T18:37:37Z")

</div>

> [@mutmut](#):
>
> And my téléinfo sends integers, decimals and text and I’d like to at least display the text on the dashboard (so this is not a `Récupérer l'état de l'appareil` in this case).

Precisely, I’d like to know the final use! Text is abstract — what text?

In Gladys, we always adopt a specific rather than a generic approach 🙂 This allows us to create an «&nbsp;all-in-one&nbsp;» ecosystem where device features are fully exploited by Gladys, whether via AI, scenes or the interface.

> [@mutmut](#):
>
> Once we switch to off-peak hours, I want to restore the previous active mode, hence storing the `mode-actuel` (which I display on the dashboard) into a `mode-précédent` variable, and that’s where it gets stuck because I don’t know how to retrieve the text of the variable mode-actuel from mqtt.

I have the impression you’re starting from Jeedom to try to do the same thing on Gladys; I think you should do the opposite: start from Gladys and then try to interface that with Jeedom 🙂

In Gladys, heating is a full-fledged feature, with native «&nbsp;heating&nbsp;» feature types — why not use them and then hook Jeedom up to this native heating?

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 17, 2024, 6:48pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/5 "2024-12-17T18:48:29Z")

</div>

> [@pierre-gilles](#):
>
> Precisely, I’d like to know the final use! «&nbsp;Text&nbsp;» is abstract — what text?

In particular a piece of info from my TIC frame which is OPTARIF. The frame is currently not correct and sends me OPTARIF=BASE whereas I’m in TEMPO. So I want to monitor this info from Gladys to then work on TEMPO-oriented graphs (HCHP/BleuRouge/Blanc) with the correct indices from the frame.  
I admit it, nothing generic about my request, but it’s only for me for a short period of time (I hope) 😅

> [@pierre-gilles](#):
>
> In Gladys, heating is a full-fledged feature, with native «&nbsp;heating&nbsp;» feature types, so why not use them and then wire Jeedom to that native heating?

Well, I don’t know that part and I’d welcome any info!  
I’ve seen things related to heating modules in z2m but nothing generic directly in Gladys ☹

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 17, 2024, 6:50pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/6 "2024-12-17T18:50:08Z")

</div>

> [@pierre-gilles](#):
>
> I get the impression that you’re coming from Jeedom to try to do the same thing on Gladys

oh yes, you’re not wrong 🤣

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 18, 2024, 7:26am UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/7 "2024-12-18T07:26:07Z")

</div>

> [@mutmut](#):
>
> So I want to scrape this info from Gladys and then work on TEMPO-oriented graphs (HCHP (Off-peak/Peak)/BlueRed/White) with the correct frame indexes.

Consumption graphs? In kWh?

> [@mutmut](#):
>
> Well I don’t know that part and I’m open to info!  
> I’ve seen things related to heating modules in z2m but nothing generic directly in Gladys ☹

In the MQTT integration, you create a device.

You add a capability «&nbsp;Heating - Mode&nbsp;»:

 ![Screenshot 2024-12-18 at 08.15.14](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/a/1ac4e56e3a0fedb257ccb0869fffa9c41712647a.png)

 ![Screenshot 2024-12-18 at 08.17.15](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/2/12bc98f5f70c1dfd9a17caa846801551571ec9c4.png)

Which you can then display on the dashboard:

 ![Screenshot 2024-12-18 at 08.18.18](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/0/e/0e8069797b6496590cc8dca8eacdbe9cfb23f850.png)

 ![Screenshot 2024-12-18 at 08.18.26](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/7/b7cfb0d4313ddc0625da76318654ee09f8905e5e.png)

And control it 🙂

If you want Jeedom to react to MQTT events, you can subscribe to the MQTT topic in Jeedom provided by Gladys.

And then you’ll receive 6 events with 6 possible values:

> Off → 0  
> Frost protection → 1  
> Eco → 2  
> Comfort -1°C → 3  
> Comfort -2°C → 4  
> Comfort → 5

You don’t have to use all these modes of course 🙂

Then, for the setpoint temperature, you can add a new capability:

 ![Screenshot 2024-12-18 at 08.19.02](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/3/3332eb2e4563b5de68bc2a60e94ab48adc345d42.png)

Which brings us to this:

 ![Screenshot 2024-12-18 at 08.19.30](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/5/b5330fc910aa1fd3cfe58a7219b69c12b6d1f039.png)

And on the dashboard:

 ![Screenshot 2024-12-18 at 08.20.22](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/6/36fc03ab0f2ad1e4dd264c83e050cde6c45ff1eb.png)

In Jeedom, you can subscribe to the MQTT topic, and you’ll receive the temperature on the topic at each change 🙂

Feel free to ask if you have any questions

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 18, 2024, 2:13pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/8 "2024-12-18T14:13:23Z")

</div>

> [@pierre-gilles](#):
>
> > [@mutmut](#):
> >
> > So I want to scrape this info from Gladys to then work on TEMPO-oriented graphs (HCHP/BleuRouge/Blanc) with the correct indexes from the frame.
> 
> Graphs of your consumption? In kWh?

Yes, among other things.  
I want to set up complete tracking for total consumption, daily, etc., and the associated costs (without including taxes for now).  
Energy consumption monitoring (electric/gas/water/etc.) could be a Gladys module. Personally I don’t have the knowledge to do it but I use on Jeedom a plugin [Suivi Conso](https://mickeys27.github.io/Docs/conso/fr_FR/) that does that and if we had something in Gladys, that would be great.

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 18, 2024, 2:17pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/9 "2024-12-18T14:17:37Z")

</div>

a big THANK YOU @pierre-gilles for this tutorial which is just awesome 🙌

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 18, 2024, 7:54pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/10 "2024-12-18T19:54:28Z")

</div>

> [@mutmut](#):
>
> Le suivi de consommation énergétique (électrique/gaz/eau/etc.) pourrait être un module de Gladys.

Un module comme celui là par exemple ? 😂

> **[Visualiser sa consommation électrique dans Gladys avec Enedis | Gladys Assistant](https://gladysassistant.com/fr/docs/integrations/enedis/)**
>
> Enedis propose une API qui permet de récupérer les données de consommation électrique venant d'un compteur Linky d'un foyer.

Je suis d’accord que cette intégration n’est pas totalement complète, je ne gère pas pour l’instant la production électrique (que la consommation), et je ne fais pour l’instant qu’un suivi en kWh, pas en euro. Mais c’est déjà un bon début 🙂

Pour le calcul de la consommation en euro, il y a une demande : [Widget consommation électrique avec prix](https://community.gladysassistant.com/t/widget-consommation-electrique-avec-prix/8563)

> [@mutmut](#):
>
> un grand MERCI @pierre-gilles pour ce tuto qui est juste génial 🙌

Avec plaisir !

> [@mutmut](#):
>
> Il existe qq part ? (si oui j’ai honte de ne pas l’avoir trouvé…)

Non, je te l’ai fais en 2 minutes ce matin 😛

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 18, 2024, 9:14pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/11 "2024-12-18T21:14:05Z")

</div>

[quote="

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 19, 2024, 2:33pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/12 "2024-12-19T14:33:58Z")

</div>

> [@mutmut](#):
>
> In particular one piece of information from my TIC frame which is OPTARIF. The frame is currently not correct and sends me OPTARIF=BASE whereas I am on TEMPO. So I want to monitor this information from Gladys and then work on TEMPO-oriented graphs (HCHP/BleuRouge/Blanc) with the correct indices from the frame.  
> I admit, nothing generic in my request, but it’s only for me for a short period of time (I hope) 😅

and well there you go, since that day my TIC frame has been sending me TEMPO info and no longer BASE, one problem less!!  
I’ll be able to start on the graphs for each index (it’s going to be a bit long given my skill level!).

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 20, 2024, 8:11am UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/13 "2024-12-20T08:11:34Z")

</div>

> [@mutmut](#):
>
> So I have to figure it out myself on this one.

Yes, but nothing prevents you from using the same feature and leveraging all the work that has been done on Enedis 🙂 You’ll benefit from the same improvements if one day we add consumption in euros, for example

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [May 15, 2025, 5:21pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/14 "2025-05-15T17:21:46Z")

</div>

This topic can be closed, resolved with [Gladys 4.58](https://community.gladysassistant.com/t/gladys-assistant-4-58-matter-mais-pas-que/9503/23)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 15, 2025, 5:34pm UTC](https://community.gladysassistant.com/t/probleme-pour-recuperer-une-valeur-text-stockee-dans-mqtt/9244/15 "2025-05-15T17:34:22Z")

</div>


