Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Changing emonPI display line

Tags: #<Tag:0x00007f1be2667998> #<Tag:0x00007f1be2667740>

Hi, I read this topic but I didn’t find an answer to my problem.

I have an emonPI with one sensor, which correctly displays the power value on line 1. I also have an emontx with another sensor.

I would like to see, on the emonPI display, the data sent from the two sensors (or, maybe, the sum of the two feeds on the second line, I haven’t decided yet which one is better for me).

How should I modify the emonPiLCD.py file in order to accomplish my request? I have emonPiLCD.py version number 3.0.1, which doesn’t contain a line like “emonPi_nodeID = 5

Thanks

Providing your emontx is posting to the same emonPi via rfm or serial (ie not using emonesp or similar) you shouldn’t need to modify the emonPiLCD.py file to display the second feed, just change the MQTT topic for the second feed on or around line 31 of the settings file emonPiLCD.cfg.

I would imagine that would need to become something like emon/emontx1/power2 depending on the name of the emontx in question (set in emonhub.conf).

There are also settings for the displayed name and units for the second value on lines 16 and 18.

Displaying a sum of the 2 feeds could be achieved by simply using a “publish to MQTT” input process in emoncms after summing the 2 values there, then as above, changing the MQTT topic to whatever you chose in setting up the “publish to MQTT”.

The alternative of editing the emonPiLCD.py file to sum them locally is more complex and can cause issues when updating in the future. So whilst it seems more clunky, using the existing routes are favourable.

I hope that helps, welcome to the forum and sorry it’s taken a while for you to get a reply, I hope it’s not too late.

Thank you, you are not too late :slight_smile:
I’m actually using emonesp, because my emontx is too far from the emonPi. Is this a problem?

Not necessarily. You can either just use a publish to MQTT process on the second value in emoncms, just as I suggested above for the summed value, that would work with either MQTT or HTTP from the emonesp (I am assuming you already have that working and posting to the local emonpi) or if using MQTT to post to the local emonPi, then you can still “tap into” that MQTT topic in the same way as if it was from emonhub, I just am not sure what the topic would be offhand, but it should be obvious from the config page of the emonesp.

The bottom line is that by editing the emonPiLCD.cfg you should be able touse any value from an existing MQTT topic (on the same MQTT server) whether it be from emonhub or an emonesp, or alternatively, if there isn’t an existing topic, create one using a “publish to mqtt” input process in emoncms, that should cover most situations.