# MQTT Client - Homey Actions on MQTT message

**URL:** <https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712>\
**Category:** Apps\
**Created:** [January 28, 2023, 5:43pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712 "2023-01-28T17:43:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [January 28, 2023, 5:43pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/1 "2023-01-28T17:43:34Z")

</div>

I have got MQTT Broker up and running, I can use the MQTT Client to push data out to MQTT Broker ok

I am now trying to get Homey to detect a change in MQTT Broker

![Screenshot 2023-01-28 at 17.18.28](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/c/ccacf8d374736c63f4c1fe11b42f8a428104e987.png)

 ![Screenshot 2023-01-28 at 17.17.10](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/b/bb5d3e7e0d63b52fd99e3329b31a7c10ef8d5346.png)

In theory if I push anything into Homey/Control/Blinds/office then the Office Blind should open to 0%.

I have checked and I cannot find the Tag where it puts the content of the message - ideally I send 0% from Node Red to MQTT Broker, Homey MQTT Client sees a new message and then the Homey Flow pushes the 0% to the Blind controller.

At the moment I would settle for if the Homey MQTT Broker sees anything then act on it.

But so far the MQTT Client does not see the message at all.

I have copied and pasted the MQTT field from Node Red to Homey to ensure no typos…

Anyone any ideas - would be much appreciated.

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [January 28, 2023, 6:03pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/2 "2023-01-28T18:03:44Z")

</div>

Making some progress

 ![Screenshot 2023-01-28 at 18.00.14](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/6/467c26e0016353c5075dd39be8e51bff86472370.png)

So the MQTT Client is working - any change in the MQTT Broker is sent to me as a message.

Now I just need to work out how to get Homey to take the content of ‘Message received form topic’ and stick it in the ‘Set position to %’ field.

Unfortunately the ‘Message received form topic’ is not available to the Aqara card - so how do I expose this to Aqara?

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [January 28, 2023, 6:15pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/3 "2023-01-28T18:15:07Z")

</div>

Ok it looks like the number 0 (zero) is coming in a String Variable

So next question is in Homey how do you convert a String ‘number’ to a number ‘number’?

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [January 28, 2023, 6:21pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/4 "2023-01-28T18:21:22Z")

</div>

You could use Better Logic Library and the BLL Expression to Number(stringnumber) as a tag. Looks like you have advanced flows enabled.

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [January 28, 2023, 6:21pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/5 "2023-01-28T18:21:55Z")

</div>

Just looking at that now 🙂

Thanks!!

---

<div class="post-metadata">

**Author:** ![Fleer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fleer/32/13311_2.png) [@Fleer](https://community.homey.app/u/Fleer)\
**Post date:** [March 17, 2023, 8:44am UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/6 "2023-03-17T08:44:04Z")

</div>

> [@OH2TH](#):
>
> Better Logic Library

Do you have an example? maybe with a screenshot?

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [March 17, 2023, 3:16pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/7 "2023-03-17T15:16:07Z")

</div>

> [@Fleer](#):
>
> maybe with a screenshot

I’m using BLL in a flow described here:

> [@\[APP\]\[Pro\] Action Scheduler](https://community.homey.app/t/app-pro-action-scheduler-alarm-utilities/75592#setting-a-dynamic-start-time-7):
>
> Contribute If you enjoy what I do, consider supporting me on [Ko-fi](https://ko-fi.com/oh2th) or [Paypal](https://paypal.com/oh2th)! Every little bit means the world! [[ko-fi]](https://ko-fi.com/oh2th)[[paypal-donate]](https://paypal.me/oh2th) Introduction Dynamic flow scheduling with a Scheduler device configurable from flows. App Featuresplay_button Flow cards: And - Conditions Device Features Device: Cron Timeplay_button Adding a new deviceplay_button Capabilitiesplay_button Flow cards: When - Triggersplay_button Flow cards: And - Conditionsplay_button Flow cards: Then - Actions Device: Schedulerplay_button Adding a new …

---

<div class="post-metadata">

**Author:** ![Paul\_Vogelaar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/paul_vogelaar/32/67696_2.png) [@Paul\_Vogelaar](https://community.homey.app/u/Paul_Vogelaar)\
**Post date:** [May 30, 2024, 12:03pm UTC](https://community.homey.app/t/mqtt-client-homey-actions-on-mqtt-message/75712/8 "2024-05-30T12:03:22Z")

</div>

> [@Busta999](#):
>
> ‘Message received form topic’ is not available

Tip: the Flow tags that are created by a “When” card becomes available as soon as you make the connection to your “Then” card. This is not obvious because apparently, that is not needed for speaking or notifying! These actions seem to be aware without the connection.  
(when you know it, it is obvious, if you don’t know it, you will not find it, so hopefully this will help people).

So when you want to use the “Message received from Topic” tag, connect the Card with the MQTT “Trigger when a message is received” to your card.  
To convert a String value (I believe all MQTT values are Strings to start with), us a Logic card to "Calculate from “message received from topic”.

You can use this numerical value (tag) to update a “Power by the Hour” virtual device for instance.  
Note: this only seems to be an issue with Advanced Flows (and perhaps only in a browser on a PC editing a Flow - never the less…)

 ![MQTT value](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/1/518a58d684e239c75d4e1b5abb72f3971a37d795.png)
