-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional support for per meter byte order and some additional per register configs. #205
base: master
Are you sure you want to change the base?
Conversation
l0ne5tar
commented
Dec 21, 2023
- Add optional 'byteorder' field to meters.
- Add optional 'functioncodes' list, enables the config to specify function code used when reading individual registers.
- Add optional 'datatypes' list, allows config to specify int or float type per register. Overrides meter's own 'datatype' when declared.
- Provided example config of sontex EIA-485 modbus module.
- Fix for meter parameter reading where only only one register is declared.
… register configs. - Add optional per meter 'byteorder' field. - Add optional 'functioncodes' list, enables the config to specify function code used when reading individual registers. - Add optional 'datatypes' list, allows config to specify int or float type per register. Overrides meter's own 'datatype' when declared. - Provided example config of sontex EIA-485 modbus module. - Fix for meter parameter reading where only only one register is declared.
Hi, 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. 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.. |
@@ -223,6 +253,11 @@ def read(self): | |||
|
|||
|
|||
def set(self, **kwargs): | |||
|
|||
def as_list(src): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because a single value in the meter field appears to be read as individual chars, i.e.
registers = 724
comes out as if
registers = 7,2,4
@@ -66,6 +66,24 @@ | |||
names = V1,V2,V3,I1,I2,I3,P1,P2,P3,TotalPower,Import_kWh,Export_kWh | |||
precision = 2,2,2,2,2,2,2,2,2,2,2,2 | |||
|
|||
[[SONTEX_EIA485]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just my setup verbatim, it may not be suitable as a generic config example.