-
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
Minimalmodbus add rid175 #179
Open
dave-mc
wants to merge
16
commits into
openenergymonitor:master
Choose a base branch
from
dave-mc:minimalmodbus-addRID175
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d8350d7
add RI-D175M
dave-mc 6730f29
updated data read
dave-mc 407576a
Update debugged RID175 modbus
dave-mc 8786987
updated RID175 decode
dave-mc 77192df
Create .gitkeep
dave-mc 71c874d
Update EmonHubMinimalModbusInterfacer.py
dave-mc ac38281
mixed meter types
dave-mc 3bd265e
New Readme for updated interfacer
dave-mc 2ade402
new minimalmodbus.conf
dave-mc ce9b698
added link to RI-D175 datasheet
dave-mc fc82080
Merge branch 'openenergymonitor:master' into minimalmodbus-addRID175
dave-mc c739f14
updated scales for RID175
dave-mc cd73acc
updated Scales in example conf
dave-mc 85ae44d
Merge pull request #1 from openenergymonitor/master
dave-mc 43bea20
Merge branch 'minimalmodbus-addRID175' into master
dave-mc ecfd1ba
Merge pull request #2 from dave-mc/master
dave-mc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
[[SDM120]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB0 | ||
baud = 2400 | ||
parity = none | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = sdm120 | ||
# prefix = sdm_ | ||
[[[[meters]]]] | ||
[[[[[sdm120a]]]]] | ||
address = 1 | ||
type = sdm120 | ||
registers = 0,6,12,18,30,70,72,74,76 | ||
names = V,I,P,VA,PF,FR,EI,EE,RI | ||
precision = 2,3,1,1,3,3,3,3,3 | ||
[[[[[sdm120b]]]]] | ||
address = 2 | ||
type = sdm120 | ||
registers = 0,6,12,18,30,70,72,74,76 | ||
names = V,I,P,VA,PF,FR,EI,EE,RI | ||
precision = 2,3,1,1,3,3,3,3,3 | ||
|
||
|
||
[[SDM630]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB1 | ||
baud = 9600 | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = sdm630 | ||
# prefix = sdm_ | ||
registers = 0,1,2,3,4,5,6,7,8,26,36,37 | ||
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 | ||
|
||
[[modbusRTU]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB0 | ||
baud = 9600 | ||
parity = none | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = rid175 | ||
# prefix = rid_ | ||
[[[[meters]]]] | ||
[[[[[rid175]]]]] | ||
address = 1 | ||
type = rid175 | ||
registers = 0,6,8,10,14,16,18 | ||
names = TotalkWh,V,A,Power,KVA,PF,FR | ||
scales = 0.01,0.1,0.001,0.1,0.1,0.001,0.01 | ||
[[[[[sdm120]]]]] | ||
address = 2 | ||
type = sdm120 | ||
registers = 0,6,12,18,30,70,72,74,76 | ||
names = V,I,P,VA,PF,FR,EI,EE,RI | ||
precision = 2,3,1,1,3,3,3,3,3 | ||
|
||
[[SAMSUNG-ASHP-MIB19N]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB0 | ||
baud = 9600 | ||
parity = even | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = samsung-ashp | ||
# prefix = sdm_ | ||
[[[[meters]]]] | ||
[[[[[ashp]]]]] | ||
address = 1 | ||
type = mib19n | ||
registers = 75,74,72,65,66,68,52,59,58,2,79 | ||
names = dhw_temp,dhw_target,dhw_status,return_temp,flow_temp,flow_target,heating_status,indoor_temp,indoor_target, defrost_status, away_status | ||
scales = 0.1,0.1,1,0.1,0.1,0.1,1,0.1,0.1,1,1 | ||
precision = 2,2,1,2,2,2,1,2,2,1,1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
## MinimalModbus | ||
|
||
The minimalmodbus interfacer supports a number of Modbus-RTU serial connected electricity meters and devices for monitoring the electricity supply of heat pumps, | ||
EV Chargers Solar etc. | ||
One or more USB to RS485 converter is needed to read from the modbus output of the meter such as: https://www.amazon.co.uk/gp/product/B07SD65BVF. | ||
|
||
Multiple meters of different types can be mixed on the same serial interface provided the serial parameters of all the meters is the same (Baud rate, parity stop bits) | ||
|
||
### Supported Meters include | ||
**SDM120** | ||
A single phase bi-directional electricity meter provides MID certified electricity monitoring up to 45A, ideal for monitoring the electricity supply of heat pumps | ||
EV chargers, Solar etc. | ||
The SDM120 meter comes in a number of different variants, be sure to order the version with a modbus output. | ||
|
||
**SDM630** | ||
A single/ three phase bi-directional electricity meter provides MID certified electricity monitoring up to 100A, ideal for monitoring the electricity supply of heat pumps | ||
EV chargers, Solar etc. | ||
The SDM630 meter comes in a number of different variants, be sure to order the version with a modbus output. | ||
|
||
**RI-D175** | ||
A low cost single phase unidirectional (Import only) electricity meter provides MID certified electricity monitoring up to 45A, ideal for monitoring the electricity supply of heat pumps | ||
EV chargers, Solar etc. | ||
The RI-D175 meter comes in a number of different variants, be sure to order the version with a modbus output. | ||
https://www.rayleigh.com/media/uploads/RI_Data_Sheet_RI-D175_MID_01_12_20.pdf | ||
|
||
**SAMSUNG-ASHP-MIB19N** | ||
Direct connection to a Samsung ASHP MIB19N | ||
|
||
**read_interval:** Interval between readings in seconds | ||
|
||
**type:** Meter Type | ||
|
||
## SDM120 only Meters | ||
``` | ||
[[SDM120]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB0 | ||
baud = 2400 | ||
parity = none | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = sdm120 | ||
# prefix = sdm_ | ||
[[[[meters]]]] | ||
[[[[[sdm120a]]]]] | ||
address = 1 | ||
type = sdm120 | ||
registers = 0,6,12,18,30,70,72,74,76 | ||
names = V,I,P,VA,PF,FR,EI,EE,RI | ||
precision = 2,3,1,1,3,3,3,3,3 | ||
[[[[[sdm120b]]]]] | ||
address = 2 | ||
type = sdm120 | ||
registers = 0,6,12,18,30,70,72,74,76 | ||
names = V,I,P,VA,PF,FR,EI,EE,RI | ||
precision = 2,3,1,1,3,3,3,3,3 | ||
|
||
``` | ||
## Single SDM630 Meter | ||
|
||
``` | ||
[[SDM630]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB1 | ||
baud = 9600 | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = sdm630 | ||
# prefix = sdm_ | ||
registers = 0,1,2,3,4,5,6,7,8,26,36,37 | ||
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 | ||
``` | ||
## RI-D175 and SDM120 on same interface | ||
``` | ||
[[modbusRTU]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB0 | ||
baud = 9600 | ||
parity = none | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = rid175 | ||
# prefix = rid_ | ||
[[[[meters]]]] | ||
[[[[[rid175]]]]] | ||
address = 1 | ||
type = rid175 | ||
registers = 0,6,8,10,14,16,18 | ||
names = TotalkWh,V,A,Power,KVA,PF,FR | ||
scales = 0.01,0.1,0.1,0.01,0.01,0.001,0.01 | ||
[[[[[sdm120]]]]] | ||
address = 2 | ||
type = sdm120 | ||
registers = 0,6,12,18,30,70,72,74,76 | ||
names = V,I,P,VA,PF,FR,EI,EE,RI | ||
precision = 2,3,1,1,3,3,3,3,3 | ||
``` | ||
## Samsung ASHP | ||
``` | ||
[[SAMSUNG-ASHP-MIB19N]] | ||
Type = EmonHubMinimalModbusInterfacer | ||
[[[init_settings]]] | ||
device = /dev/ttyUSB0 | ||
baud = 9600 | ||
parity = even | ||
[[[runtimesettings]]] | ||
pubchannels = ToEmonCMS, | ||
read_interval = 10 | ||
nodename = samsung-ashp | ||
# prefix = sdm_ | ||
[[[[meters]]]] | ||
[[[[[ashp]]]]] | ||
address = 1 | ||
type = mib19n | ||
registers = 75,74,72,65,66,68,52,59,58,2,79 | ||
names = dhw_temp,dhw_target,dhw_status,return_temp,flow_temp,flow_target,heating_status,indoor_temp,indoor_target, defrost_status, away_status | ||
scales = 0.1,0.1,1,0.1,0.1,0.1,1,0.1,0.1,1,1 | ||
precision = 2,2,1,2,2,2,1,2,2,1,1 | ||
|
||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this backward compatible?
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.
Hi Brian,
yes I think so, if no type is defined then it uses the previous method of working out which meter to use.
I have just tested on my install which uses the new version and put the following config in and it picks up the SDM120 and reads the values
[[SDM120]]
Type = EmonHubMinimalModbusInterfacer
[[[init_settings]]]
device = /dev/ttyUSB0
baud = 9600
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
read_interval = 10
nodename = sdm120
# prefix = sdm_
[[[[meters]]]]
[[[[[sdm120]]]]]
address = 3
registers = 0,6,12,18,30,70,72,74,76
names = V,I,P,VA,PF,FR,EI,EE,RI
precision = 2,3,1,1,3,3,3,3,3
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.
heres the elif statements after the type lookups
'''
elif self.datatype == 'int':
value = self._rs485.read_register(int(self._settings['meters'][meter]['registers'][i]), functioncode=3)
elif self.datatype == 'float':
value = self._rs485.read_float(int(self._settings['meters'][meter]['registers'][i]), functioncode=4, number_of_registers=2)
'''