# Can emonhub get data from an mqtt server and relay it to emoncms via http interfacer

**URL:** <https://community.openenergymonitor.org/t/can-emonhub-get-data-from-an-mqtt-server-and-relay-it-to-emoncms-via-http-interfacer/26106>\
**Category:** emonHub\
**Tags:** mqtt, emoncms, emonhub\
**Created:** [7 May 2024 06:50 UTC](https://community.openenergymonitor.org/t/can-emonhub-get-data-from-an-mqtt-server-and-relay-it-to-emoncms-via-http-interfacer/26106 "2024-05-07T06:50:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Adeyinka](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/thomas_adeyinka/32/14796_2.png) [@Thomas\_Adeyinka](https://community.openenergymonitor.org/u/Thomas_Adeyinka)\
**Post date:** [7 May 2024 06:50 UTC](https://community.openenergymonitor.org/t/can-emonhub-get-data-from-an-mqtt-server-and-relay-it-to-emoncms-via-http-interfacer/26106/1 "2024-05-07T06:50:47Z")

</div>

I posted this [here](https://community.openenergymonitor.org/t/diy-energy-monitoring-system-using-mqtt-emonhub-emoncms/26094) but it never got any response so I decided to rephase my question.

I just want to know if it is possible for emonhub mqtt interfacer to get data from an mqtt server and post it to emoncms via the http interfacer?

It is not clear from the document if it can do this.

I know I can post to emoncms directly via mqtt but I would like to take advantage of the caching functionality that emonhub offers.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [7 May 2024 11:24 UTC](https://community.openenergymonitor.org/t/can-emonhub-get-data-from-an-mqtt-server-and-relay-it-to-emoncms-via-http-interfacer/26106/2 "2024-05-07T11:24:34Z")

</div>

No, not currently, but there is a pull request for this feature:

> <https://github.com/openenergymonitor/emonhub/pull/198>
>
> Enable emonHub to subscribe to JSON MQTT topics, useful for integrating with \[zi…gbee2mqtt\](https://www.zigbee2mqtt.io/) and \[Shelly WiFi sensors\](https://community.openenergymonitor.org/t/shelly-plus-h-t-wireless-temperature-sensor-to-emoncms-via-mqtt/21991). 
> 
> e.g 
> 
> \`\`\`
> \[\[MQTT\_sub\]\]
> Type = EmonHubMqttInterfacer
> \[\[\[init\_settings\]\]\]
> mqtt\_host = 127.0.0.1
> mqtt\_port = 1883
> mqtt\_user = emonpi
> mqtt\_passwd = emonpimqtt2016
> \[\[\[runtimesettings\]\]\]
> pubchannels = ToEmonCMS,
> node\_JSON\_enable = 1
> node\_JSON\_basetopic = zigbee2mqtt/temp
> \`\`\`
> The above emonhub config subscribes to MQTT topic \`zigbee2mqtt/temp\` and decodes the JSON message \`{"battery":100,"humidity":72.23,"linkquality":116,"temperature":21.79,"voltage":3000}\` which results in an input key called \`temp\` and Inputs with battery, humidity etc.

You could switch to this branch if you want to use it.

---

<div class="post-metadata">

**Author:** ![Thomas\_Adeyinka](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/thomas_adeyinka/32/14796_2.png) [@Thomas\_Adeyinka](https://community.openenergymonitor.org/u/Thomas_Adeyinka)\
**Post date:** [7 May 2024 18:46 UTC](https://community.openenergymonitor.org/t/can-emonhub-get-data-from-an-mqtt-server-and-relay-it-to-emoncms-via-http-interfacer/26106/3 "2024-05-07T18:46:29Z")

</div>

Thanks. Hopefully by the time I need this the PR would be merged. Thanks again.
