I would like to be able to use the received message in scenes when an MQTT message is
Hi @cce66 ,
For me the latest integration (which you put in image1) does it. That is to say (and I think that’s great), we have the « continue if » in the trigger, we only trigger if the expected message is the correct one
I’d really like this integration to be more than just a « continue only if »
Like injecting the MQTT response into a feature, for example
Ok, indeed, retrieving the MQTT info could be interesting +1
yes, but I cheated there to show what I’d like to have in my feature request; currently it doesn’t exist ![]()
The idea would be to be able to retrieve the value of the message to use it as a variable in a message, for example (I realize my request actually isn’t explicit enough). If we could do it with ‹ Retrieve the last state › we would have the message value that
I agree — I don’t understand either what that adds!
The topic doesn’t change during the scene, so why would you want a variable? If you defined it at the top in the trigger, then it’s fixed, right? ![]()
Hello @pierre-gilles,
This isn’t for the topic, it’s for the received message where we could change the scene’s behavior based on the received message, for example
« continue only if » message=value <
"Send message {{ mqtt value "
and another scene
« continue only if » message=value >
"Send message {{ mqtt value "
or when the « else » is added to the « continue only if »
« continue only if » message=value <
« Else »
"Send message {{ mqtt value "
I put « send a message » but it could be another action
this ties into my feature request Pouvoir créer des variables globales utilisables dans gladys (Latitude, Longitude, Date, Heure etc)
the idea is to have a bit more flexibility and configurability in Gladys
These are just suggestions; if there’s demand there will be votes so it might be interesting to develop, if there isn’t then no need to develop, but you can’t know without asking! ![]()
Also I had proposed this
ideally it would be better because it covered the send/receive side of an MQTT message in the scenes that @Lokkye implemented but we could use the state feedback like for other MQTT devices while keeping Gladys’ internal syntax — it’s just a mapping to do:
-
Gladys subscribes to the publish of an external device; when it receives it transforms it into Gladys MQTT syntax then sends it for processing as if it had received that message in Gladys format
-
when Gladys must publish the MQTT of an external device it transforms Gladys MQTT syntax to external MQTT syntax then sends the message
This would allow avoiding Node-RED for all devices not yet integrated or that won’t be because they’re too specific
But there aren’t many votes so maybe it’s not of interest; maybe an integration should be developed where we could handle this mapping as a simpler case since there would just be a table to add in the DB, I’m not there yet for that
but I’m not giving up
!
Would assigning the value to a virtual device and acting on the state of that feature (like a regular device) meet your need?
[quote=« cce66, post:7, topic:8590 »]
depending on the message received, for example
« only continue if » message=value <
"
Currently, either we leave nothing in the message field and the scene continues after the trigger only if any message arrives on the topic (which reflects the payload value — we’re OK) but we can’t do anything with the value received on the topic.
Or indeed we put a value in message but we only handle that specific value case.
So if we put nothing in message, the scene runs, there is indeed a value received on the topic and it’s that value that I would like to use afterwards, but for that it must be assigned to a variable because if we do ‹ retrieve device state › we don’t have a link to get that value and in the « continue if » area it’s the same (it seems to me).
Take the case of an exotic device « Exotic » not integrated, we put in the Topic field the value that the device exposes called « ExoticValue » so we have in the « Topic » field the value « Exotic/ExoticValue » and when the device « Exotic » has a change of value « ExoticValue » which is, for example, an integer from 0 to 100, we could, depending on ExoticValue, then send a telegram message that would say « warning the value of Exotic is xx »
currently you can’t assign any topic to a virtual device, note that since I couldn’t get the one in the scene to work maybe I don’t have the right syntax
, an example should be provided! ![]()
After reflection, I remember seeing a message to that effect in the exchanges between @pierre-gilles and @Lokkye, indeed it’s better to go through a virtual device and not use this function in a scene (which isn’t useless otherwise but just not suited to what I wanted to do) I’ll keep using Node-RED for this!
No, it’s not currently possible, or I’m doing it wrong.
I have a scene that sends
So, @pierre-gilles, is it possible to do it?
No, that’s not possible!