# Mqtt subscribe to Losant broker

**URL:** <https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782>\
**Category:** Help\
**Tags:** mqtt\
**Created:** [April 2, 2020, 6:46pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782 "2020-04-02T18:46:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 2, 2020, 6:46pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/1 "2020-04-02T18:46:34Z")

</div>

Can I have a customer subscribe to the Losant broker to get a “copy” of data coming from some of my devices?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [April 2, 2020, 8:10pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/3 "2020-04-02T20:10:11Z")

</div>

Hi @Lars_Andersson,

Could you describe the environment and usage for your customer? There are a couple of possible ways to accomplish this, and I want to be sure we recommend the simplest for your use case.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 2, 2020, 8:36pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/5 "2020-04-02T20:36:55Z")

</div>

We are visualizing some of this customers sensor data already with a Losant dashboard.  
They have some other information , in Azure, that they would like to relate to our sensor data, so I thought one way would be to have them subscribe to some device topics so the existing system is left intact.  
I guess another would be to setup a Azure Integration, right?  
They will still be using the Losant dashboards/experience we have deployed.

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 3, 2020, 4:36pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/7 "2020-04-03T16:36:32Z")

</div>

Any further info on this today?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [April 3, 2020, 4:57pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/8 "2020-04-03T16:57:48Z")

</div>

Hi Lars,

The current suggestion is to create an Access Key with [`subscribe` access to an arbitrary topic](https://docs.losant.com/applications/access-keys/#additional-mqtt-topics-access). You would then need to publish state data to this custom topic in addition to reporting the data to your device.

 ![image (1)](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/4/4226d56420f60d40b9dbef766856b7001802a5c2.png)

Of course, there are other ways to accomplish this, but this one may be the most ideal for your use case.

Let me know if you have any further questions!  
Thanks,  
Julia

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 3, 2020, 5:14pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/10 "2020-04-03T17:14:10Z")

</div>

So to be able to subscribe to all state data that the device is currently sedning data via MQTT, I need to ALSO post that same data to a second topic, that my customer would subscribe to?

Not sure if I can configure my device to send to 2 different topics, so what other options do I have?

---

<div class="post-metadata">

**Author:** ![Anaz\_Zubair](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Anaz\_Zubair](https://forums.losant.com/u/Anaz_Zubair)\
**Post date:** [April 3, 2020, 7:04pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/12 "2020-04-03T19:04:33Z")

</div>

Hi @Lars_Andersson,

I would either:

1. Configure the device to send the data to a custom topic (not the losant device state topic) and then use a workflow with Mqtt Trigger Node to store the payload into a device using Device: State node. Your client could then subscribe to the custom topic on the Losant broker.  
OR
2. Use a Device: State trigger node to trigger a workflow off the incoming device data and then use an Mqtt Message Node to post to the Losant broker on a custom topic. To which your client can subscribe (which will probably increase your payload count).

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/f11ff139d071cb868691b6d0a0f2110f34c7b750.png)

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [May 7, 2020, 11:25am UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/14 "2020-05-07T11:25:00Z")

</div>

So with option 1 , my device would only need to post to the custom Losant topic and not the state topic?

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [August 20, 2020, 10:40am UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/17 "2020-08-20T10:40:01Z")

</div>

So in general , I can not subscribe to the /state topic on the Losant broker?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [August 20, 2020, 2:27pm UTC](https://forums.losant.com/t/mqtt-subscribe-to-losant-broker/2782/19 "2020-08-20T14:27:40Z")

</div>

Hi @Lars_Andersson,

One MQTT integration is not able to directly subscribe to the “losant” state topics of another. If you attempt to subscribe to any other topic that starts with “losant”, you will be disconnected; this is why another custom topic was recommended to accept the state values. I would recommend reading [this forum post for further information and details about Losant topics.](https://forums.losant.com/t/mqtt-data-retrieve/432)

Thanks!  
Julia
