Emonhub and MQTT

I am currently using the new version of Emonhub with MQTT interfacer to publish (and subscribe) to messages from my MQTT server.

This is working great, i can get values from my openenergymonitor rfm12b devices and process that data in scripts, node red etc. I can also push data to my EmonGLCD via MQTT, I even built a small script for when EmonGLCD requests a new time and the script publishes time to MQTT rx.

The problem is that i would like to get my energy meter to publish directly to my MQTT via wifi instead of sending via rfm12b. 

So the question is, is there any way of using Emonhub to send that mqtt data to EmonCMS like it does today for rfm12b or do i need to post it myself/use mqttwarn?

The benefit of using Emonhub as i see it is that it aggregates data and sends it when it is suitable, if i remember correctly it will also keep a backlog and try to send again if it fails.

I have read somewhere that version 9 of Emoncms supports mqtt subscribe at some level, but at the moment i am using emomcms.org.

/ David

sheppy's picture

Re: Emonhub and MQTT

I have this working on my system, albeit I use Openhab to translate the topics and they arrive via Ethernet.

EMONHUB displays anything in the format of

emonhub/rx/nodenumber/values

in the nodes tab

nodenumber is a number that isn't in use, and values is just the word "values" I use one nodenumber for each single value and it works well. You can also edit the emonhub config file to make the value make sense when it is presented in the nodes tab.

For example 

[[6]]
    nodename = Lounge_Temp
    firmware =ecobee
    hardware = 
    [[[rx]]]
       names = o
       scales = 1,
       units =C

You also need to allow mosquitto through the firewall on the Pi if its not already been done.

valerio.a's picture

Re: Emonhub and MQTT

Hi, I have pretty the same problem, I have openhab receiving temp data from a sensor and I want to display them on my local emoncms and on emoncms.org. I configured a node like the above on my emonhub.conf and I tried to manually sent a MQTT message to emonhub/rx/50/values topic.
As I expected my local emoncms received the message, but emoncms.org didn't received it.

It seems that the standard workflow of the tx packets is:

emontx -> PIrf module -> emonhub

then emonhub decodes the data and send them to a mqtt topic (similar to emonhub/rx/50/values) and to emoncms.org

then the local emoncms reads from the mqtt topic and processes the data.

There's a way to config emonhub to read data from a mqtt topic and process them as them was from the radio module so publishing to a topic would result in the data published both to the local and the remote emoncms?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.