Add Node to emonhub

I am capturing data from from my solax X1 inverter and sending it to my emonpi using a python program on rpi4 . It is working reliably and I am now in the process of send my data to cloud so I can view it on an app on my phone. I have edited the emonhub.config file with an api key and the data from my emonpi node(only temperature) is up loading but the solax node is not uploading. How can i add this node to the emonhub.config so it also uploads.?

How are you sending the data? Directly by HTTP?

If so, the simplest way to do this, is to modify your program to use the MQTT broker and the data may just get uploaded to If not you might need to do some minor adjustment to emonhub config, but I doubt it.

Yes, I capture the data on my rpi4 , extract the inputs i want and process it a bit then post by http to the emonpi.
How do I send it to emonhub?

Send by MQTT

I think what Brian is inferring there is you DON’T “Add Node to emonhub”, emonHub adds the node when it receives the data.

The solax data comes into the emonpi from a rpi4 and is which adds a node to the local cms but this data does not sync with the cloud . I tried adding the solax node to emonhub.conf but it but not work.

I thought Borpin meant upoading the data from the rpi4 using MQTT instead of http which would go through the emonhub. I am getting the data from the solax via http and easy to pass this to the emonpi via http but it does not sync with the cloud. I could get the data from the solax using modbus and send via mqtt but this would be a steep learning curve for me.

emonHub only handles the data if it arrives by wired serial, USB or radio. Ethernet goes straight to emonCMS. So if the data bypasses emonHub, it can’t forward it anywhere. If you’re using http over your LAN, then as far as I know, the only way is for the sending device to send it twice. Once to local emonCMS and once to; and that’s probably not possible.

There’s a partial explanation in the diagram here: emonPi Technical Overview — OpenEnergyMonitor 0.0.1 documentation but I’ve yet to find an explanation of the mechanism whereby data is moved around inside the RPi, i.e. how/why does wired serial and USB serial input get intercepted and processed by emonHub, yet the LAN/Wi-Fi http packets don’t?

I suspect what you’d like is the ability for emonCMS to resend selected data to another emonCMS - in your case the local one to the public server at

I modified the python program which captures the inverter data and it now sends this data as a json to emonpi via mqtt. This shows up in the local inputs ,
feeds and dashboards but not on local emonhub or my inputs on myaccount on I expected the inputs from emon/ to be automatically exported to external hub. Do I need to modify the emonhub to achieve this?

It would beeasier if you posted the actual text (as formatted using CTL-E) rather than a screen shot.

I don’t actually know what that is a screenshot of.

By design. This mechanism is not going through emonhub.

It is a flaw in the overall structure of emoncms/emonhub. @glyn.hudson @TrystanLea this needs addressing as more folk are tryuing to do this particularly for HP data.

I’m thinking an interfacer that specific mqtt topics could be routed.

I think I suggested before to simply use an HTTP request in the python script to send the data to If you look at the Input API help, you will see you can send the same JSON string via HTTP.

This PR is for adding an interfacer to specify MQTT topics with JSON data structure:

I’ve been using it myself for quite a while now to get data from Sonoff Zigbee sensors into emonHub, works well. I’ll discuss with @TrystanLea options about getting it merged.

1 Like

The screenshot is print to terminal of the json string sent by mqtt to topic emon/solax1. Previously I sent the inverter data json s using Http . As the data from http or mqtt does not go through the hub it doesn’t automatically sync with I have managed to find a work around by running the script sync_all.php every 5 minutes using cron.

mqtt_publish.txt (362 Bytes)

1 Like

If I understand this correctly your zigbee wifi sensor publishes a json string to zigbee2mqqt/temp and the interfacer directs the data to emoncms which shows up as inputs which can be logged etc.
How does the local emonpi receive the zigbee signals?

I get all my data from the inverter over wifi using a python program running on my emonpi . I have 5.5kw solar + battery and the inverter is connected to a meter on the grid feed. The inverter has a bms which controls the discharge/charging of the battery . It charges the battery if required when solar exceeds usage and discharges if required when usage is greater than solar . The bms balances the load and exports the surplus. I seldom need to import . I calculate the actual usage from the inverter data then export the via mqtt to emoncms.

I will see if I can input the data through the emonhub interfacer.

{“SolarDC_W”: 1371, “Grid_Voltage”: 243.0, “Battery_charge”: 1199, “Battery_discharge”: 0, “Export_Power”: 0, “Used_W”: 172, “Battery_SOC”: 95}

I thought I’d seen mention of something like this.

Would be good to get it included. If it is a new interfacer, it should not be an issue for exiting setups :slight_smile:

@kereugen - I think you are not understanding the data flows in emoncms & emonhub.

Any data published to the topic emon is picked up by emoncms directly when MQTT is configured in the local emoncms instance - emonhub is not involved.

Anything sent using the INPUT or FEED HTTP API to an emoncms instance (local or cloud) is picked up directly by that emoncms instance.

emonhub can receive data from one or more sources (but not MQTT currently) and send that data to one or more emoncms instances via HTTP (or MQTT to a local instance). Actually it can send to other types of protocols too (not just emoncms), but that is a whole different subject.

This is outside my area of expertise and is a learning process for me which I am enjoying. I understand now that emonhub was designed to take the data from emponpi + tx devices and pass the data to local emoncms and or where the data is stored and processed for access.

That was how I used my emonpi until my battery was installed. To get the data I need now would be difficult with clamps as the battery is high voltage DC and also there is emergency power supply for several circuits . I now get all the data I need from the inverter with a python program and can sync with . My emonpi handles this without and problems with low load average.

Maybe the emonhub will be modified in future to accept data from other sources if the software designers/developers think that it is way to go. Many thanks to all those who contribute to this very useful and functional opensource software/hardware.