Community
OpenEnergyMonitor

Community

Changing emonPi LCD display options?

Hi all,
Over the last few days i have built a emonPi and connected a remote emonTX shield via 433Mhz RF. I have a current CT probe on the TX shield measuring the incoming Mains Grid from my Electricity Meter.

I have sorted out how the TXShield and arduino sketch works but need to change some settings on the Pi.
Is it possible to change the LCD options on the emon Pi to include the remote probes on the TXshield as at the moment only the locally connected probes are shown on the LCD.
Can i also ask where i change the voltage calibration on the emonPi for the local 9v sensor input? Am i correct in thinking that the KWh calculation uses any volt sensor when connected (I only have one connected).

Thanks for any help,
Jonathan

Yes, just change the line emonPi_nodeID=5 in ~/emonpi/lcd/emonPiLCD.py to the node ID of the emonTx sheild (default node ID 6).

To make changes you will ned to put the root FS into r/w mode: $ rpi-rw
You will then need to restart emonPiLCD service

$sudo service emonPiLCD restart

Then put root FS back to r/o

$rpi-ro

Will that include or substitute the emonTx data?

this looks to me as it substitutes the emonTX data, but it causes the switch to stop working as when you get to the volts screen it hangs as i am not running a sketch with the volts option, just CT probes.
Can i add a page in with just the emonTX power1 and 2 readings in addition to the emonPi pages?

You would need to increase the number of LCD views:

then capture the data from the emonTx, the data is published to MQTT in format emonhub/rx/NODE-ID/values

Then create another emonPi LCD screen following the format:

Is there any way of displaying data from other nodes as well?

Regards
Dave

Yes, just change the node ID

Hi Glyn
Sorry, I should have said displaying date from more than one node.

Regards
Dave

Thanks for the information. I will look into this in more detail at the weekend, will let you know how I get on.

I don’t think you’ll manage that without significantly rewriting the emonLCD python code.

My suggestion prior to emonPi launch when the emonpi variant of emonhub was being discussed was to create a EmonHub LCD Interfacer instead of another independent script and that way you could define what info you wanted to see in emonhub.conf, fetch it from emoncms by feedid and display it in the order and with the labels you choose. Much like some users did with transmitting solar data out to their emonGLCD’s from emonhub.

Thanks Paul, maybe in the future that may happen.

Regards
Dave

Thanks Glyn for the pointers above.

I have made the following changes to my emonPiLCD.py file

I changed the emonPi_nodeID to 6 for emonTX shield readings and then altered the page sections of the code as shown below.to display the required information.

I also noticed that the emonTX shield only sends 4 power readings and a voltage reading. so basedata only goes from 0 to 4.

I may work on this a bit more once i get all the sensors i need connected up and tested. I have also changed my voltage calibration as i was getting a reading of 156V with the default “ideal psu/transformer” setting. my measured mains is about 134V on average. and my emonTX Shield volt input was 11.45V

emonPiLDC.py code:

if page == 3:
            basedata = r.get("basedata")
            if basedata is not None:
                basedata = basedata.split(",")
                lcd[0] = 'Power 1: ' + basedata[0] + "W"
                lcd[1] = 'Power 2: ' + basedata[1] + "W"
            else:
                lcd[0] = 'ERROR: MQTT'
                lcd[1] = 'Not connected'

        elif page == 4:
            basedata = r.get("basedata")
            if basedata is not None:
                basedata = basedata.split(",")
                lcd[0] = 'Power 3: ' + basedata[2] + "W"
                lcd[1] = 'Power 4: ' + basedata[3] + "W"
            else:
                lcd[0] = 'ERROR: MQTT'
                lcd[1] = 'Not connected'

        elif page == 5:
            basedata = r.get("basedata")
            if basedata is not None:
                basedata = basedata.split(",")
                lcd[0] = 'Grid Volts in’                        #    'Vrms: ' + basedata[4] + "V"
                lcd[1] = 'Vrms: ' + basedata[4] + "V"           #    'Pulse: ' + basedata[10] + "p"
            else:
                lcd[0] = 'ERROR: MQTT'
                lcd[1] = 'Not connected'

        elif page == 6:
            lcd[0] = datetime.now().strftime('%b %d %H:%M')
            lcd[1] = 'Uptime %.2f days' % (seconds / 86400)

        elif page == 7:
            lcd[0] = "emonPi Build:"
            lcd[1] = sd_image_version

If there any changes you wish testing in future please let me know as i am happy to help if possible.

Regards
Jon

1 Like