I recently had a Solar and house battery added to my home installation and the installer used the Rayleigh Instrument D175m modbus meter in the installation so i wanted to add these to my OpenEnergy Monitor system.
The RI-D175 is slightly cheaper than the SDM120 and is widely available in the UK from electrical wholesalers like CEF, from an installation perspective it also has the advantage of taking up to 10mm cable and having 2 x Neutral connections making it simple to wire inline without needing a separate “T” connection in the neutral. The down sides are that the meter is unidirectional (only measures imported power) and uses a BCD coded long as its return message.
After looking at the MBUS interfacer I have updated the minimalmodbus interfacer to incorporate the necessary decoding for the RI-D175 and have added an additional Key to the config for “type” so that a number of different meters can share the same modbus serial connection (provided the serial parameters match) This has allowed me to run 4 meters 2x SDM120 and 2x RID-175 on the same serial connection all running at 9600baud.
I left all the existing meter detection/configuration in place so the updated interfacer should work with existing config files with no change, but can be updated to use the type key if and when needed.
Potentially adding the meter type key would allow other modbusRTU devices to also be added easialy in the future.
Can you have a look over PR Minimalmodbus add rid175 and see if you can incorporate this into the main or a test branch at some point or if not let me know what else I need to do.
The Datasheet for the meter is https://www.rayleigh.com/media/uploads/RI_Data_Sheet_RI-D175_MID_01_12_20.pdf
I do have the Modbus register list and a windows utility to allow meter parameters to be changed which I can upload if useful.
That looks really good, thanks - @TrystanLea.
Oh there is a specific SDM120 interfacer so not sure this is the right way to go (but it might be!). emonhub/EmonHubSDM120Interfacer.py at master · openenergymonitor/emonhub · GitHub
@TrystanLea I see the recent discussion around ModBus (Installing Emoncms onto a PC (or Mac) and using with multiple modbus meters (e.g. SDM230) - #8 by thedawnbefore) the Minimal Interfacer is being used rather than the SDM120 one so I am confused (easily done)!
@davem Can you post the Register list please - I’m currently battling with 3 Phase meter RI-D70C and trying to fathom out what they really mean for the BCD encoded values - most of the values I’m reading appear to be 32 bit unsigned Int even though the doc says BCD (however some registers seem to be giving me values that make no sense at all).
Hi Stewart, its not clear from the documentation but on the RI-D175 the meter returns a LONG int but the data is coded as decimal digits in each 4 bit nibble.
Rayleigh were very helpful, if you send them an email to thier support address you should get the modbus datasheet.
assuming the registers are similar to the D175 you should be able to use my updated version of the Interfacer to read your meter as its only the runtime config that would need to change, and if needed adding a new type is very straightforward.
RI-D175-C-COM-Modbus protocol-V02.pdf (412.8 KB)
PS @G0LGS there is a bcd_decode function in my update to the interfacer which you will need to make sense of the data. A similar function also exists in the MBus interfacer though I have not tried this on the RI meter.
@borpin @TrystanLea I used the minimalModbus interfacer as the basis as this seemed more generic than the SDM120 and already includes at least three meter(device) types. However the type detection was done at the interface level so all devices on the same interface would need to be the same (or compatible) meter types.
Thanks @davem this looks great! We will test and merge.
Yes the minimal modbus interfacer is the correct one to use. The SDM120 interfacer ended up being less reliable than the minimal modbus interfacer, something in the underlying libraries used. We should probably depreciate and remove the original SDM120 interfacer now…
Could a Readme be introduced here emonhub/src/interfacers at master · openenergymonitor/emonhub · GitHub to help with these sorts of oddities? Just a line that says use/don’t use and possible options (like different meters). Details can be in the interfacer specific readme.
So I have an EmonTX3, which interfacer should I use? (and I wasn’t looking for an answer here).
The 120 is still listed here https://github.com/openenergymonitor/emonhub
And I know this is mission creep, but how do we tell folk to use/migrate to a different interfacer?
Could the update script look for specific items in the
emonhub.conf, for instance and then report to the user? Other things on the boil, I know .
@borpin @TrystanLea I have added the sample conf file for minimalModbusInterfacer along with my Update.