Retrieve a state/Send MQTT message: limit on number of variables?

Hello,
I have a scene that has 12 Get state in a single action.
In the following action block, I want to send 12 MQTT messages but I only see only the last 10 variables:


I don’t know since which release it stopped working because everything was OK when I created the scene (all 12 were visible).

I saw that an old bug reported this issue: [BUG][SCENES] recupération variable limitée à 10 données sur un bloc lors de l'utilisation dans l'action "envoyer un message"

Hi @mutmut,

I can’t reproduce it; on my side if I retrieve lots of variables via an « HTTP Request » action for example:

Then I have all the variables:

There’s a small scroll bar, and if I use the up/down arrows I can navigate the list — don’t you have that on your side?

So it’s not the same thing because I also retrieve all the variables when I make an HTTP request and I want to get one of the variables.

In my case I do more than 10 Retrieve last state and then I want to Send an MQTT message and that’s where it gets stuck at 10 — no scrollbar for scrolling, and when I « press the down arrow » it goes back to 1 after 10.

I tested duplicating the scene just in case but I have the same behavior.

Ok thanks, I can reproduce it and I understand what’s wrong :slight_smile: I’ll fix it!

The bug was a bit tricky :sweat_smile:

In each action, there is a function that checks whether a variable is “available” at that time. A variable is considered available only if it was defined before the current action.

To determine this, each action has a path (chemin) of the form « 1.1 », « 1.1.then.1 », etc. We then compare the segments of the path to know in which order the actions execute.

The problem appeared when there were more than 9 actions in a group: the paths became « 1.10 », « 1.11 », etc. In one place in the code, we compared the length of the path (instead of the depth), which worked as long as the segments had a single digit. But as soon as the paths reached two digits, the comparison became incorrect :grimacing:

The bug is now fixed here:

3 Likes

Thanks for the explanation!
What’s crazy is that it worked correctly at one point because I had managed to do my 12 Send without any problems.
No big deal, I say, as long as it’s resolved :wink:

It was the development of the « IF… THEN… ELSE » that reworked this whole section; that’s where the bug appeared!

1 Like

The fix is available in Gladys Assistant 4.59 :

1 Like