openenergymonitor / emonhub

Python service linking and decoding input to MQTT & Emoncms
90 stars 83 forks source link

Add optional support for per meter byte order and some additional per register configs. #205

Open l0ne5tar opened 11 months ago

l0ne5tar commented 11 months ago
l0ne5tar commented 11 months ago

Hi, Sorry if this looks a bit rough, I've only been looking at this for a day or so, i thought i'd share in case its useful though.

Anyway, my setup (which was installed for some local electrification of heat gov study) is an SDM630 + sontex superstatic 449 + EIA485 modbus module.

https://sontex.ch/wp-content/uploads/2019/02/supercal531-modbus-ds-en.pdf

I was able to read from the SDM630 out of the box, but the heat meter requires a different byte order to properly read float data. The functioncode and datatypes stuff was added because the device also has a mixture of int and float types, ive experimented with those locally but theyre not used in the example provided.

I wanted to do it this way because IMO the config should be able to configure the device without any hard coded device specific tests in the interfacer code..