# MQTT Hub/Gateway

**URL:** <https://community.homey.app/t/mqtt-hub-gateway/6766>\
**Category:** Apps\
**Created:** [January 14, 2019, 6:59pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766 "2019-01-14T18:59:50Z")\
**Posts on this page:** 1\
**Showing post:** 1201

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [July 10, 2023, 2:39pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1201 "2023-07-10T14:39:05Z")

</div>

You can use an outputTemplate with JSON-T notation like:

```auto
{ “SetRoomTemperature” : {{value}} }

```

from example:

> [@MQTT Hub/Gateway](https://community.homey.app/t/mqtt-hub-gateway/6766/842):
>
> MQTT Devices are now able to handle JSON input & output. Version 3.1.0 MQTT device: grab input value from json messages (jsonPath) MQTT device: format output message payload to json (JSON-T template) I added two optional config parameters per capability: value path: point to a value within the JSON payload of the state messate using [JSONPath](https://github.com/dchester/jsonpath#readme). output template: format the output using [JSON-T](https://github.com/lightsofapollo/json-templater). Both string & object output are supported. All values from the device state (capabilities)…

Tested by @robertklep:

> [@How to call a Homey script from an App](https://community.homey.app/t/how-to-call-a-homey-script-from-an-app/84313/15):
>
> And also make sure everything is properly quoted. Here’s an example I’m testing with, which is working fine: { "measure\_battery": { "capability": "measure\_battery", "stateTopic": "test/state", "setTopic": "test/set", "valueTemplate": "$.value", "outputTemplate": "{\"xxx\":{{value}}}", "displayName": "Battery" } } Pushing a value: $ mqtt\_pub -vh 192.168.23.2 'test/state' '{"value":80}' Output (on the test/set topic): {"xxx":80}

---

_[View the full topic](https://community.homey.app/t/mqtt-hub-gateway/6766)._
