# Publish sensor values as JSON over MQTT

**URL:** <https://community.homey.app/t/publish-sensor-values-as-json-over-mqtt/119475>\
**Category:** Questions & Help\
**Tags:** mqtt, homey-pro\
**Created:** [October 31, 2024, 10:35pm UTC](https://community.homey.app/t/publish-sensor-values-as-json-over-mqtt/119475 "2024-10-31T22:35:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [October 31, 2024, 10:35pm UTC](https://community.homey.app/t/publish-sensor-values-as-json-over-mqtt/119475/1 "2024-10-31T22:35:31Z")

</div>

Hello!

I want to have most of the data from my homey published to MQTT, sorted as JSON pr device/room.

The flow below works, but it is a bit of work to do this for every device in my home. I assume there is a better/easier way of doing this. Also it would be nice to replace “airquality” with the actual devicename in the topic string if possible.

I know of the MQTT Hub, that pukes out all my data, but it looks like a mess. I want the data sorted as described above 🙂

Any help is very appreciated 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/a/aa97fbeb944d653a3bfb30e61cadadd3b89c3f21.png)

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [November 1, 2024, 2:18pm UTC](https://community.homey.app/t/publish-sensor-values-as-json-over-mqtt/119475/2 "2024-11-01T14:18:06Z")

</div>

Probably better to send the values every xx Minutes all together in 1 message:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/5/e5112badb06a6274fb8efcad86de42ea257b06d5.png)
