Skip to content
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 multiple meters #176

Merged
merged 19 commits into from
Aug 24, 2022
Merged

Conversation

glynhudson
Copy link
Member

@glynhudson glynhudson commented Aug 19, 2022

Add support for reading from multiple modbus meters.

The required emonhub.conf interfacer format for Minimalmodbus should be as follows:

Single SDM120 Meter

[[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/ttyUSB0
        baud = 2400
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = sdm120
        # prefix = sdm_
        [[[[meters]]]]
            [[[[[sdm120]]]]]
                address = 1
                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

Multiple SDM120 Meters

[[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/ttyUSB0
        baud = 2400
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = sdm120
        # prefix = sdm_
        [[[[meters]]]]
            [[[[[sdm120a]]]]]
                address = 1
                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
                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 Samsung ASHP

[[SAMSUNGASHP]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/ttyUSB0
        baud = 9600
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = samsung-mib19n
        # prefix = sdm_
        [[[[meters]]]]
            [[[[[ashp]]]]]
                address = 1
                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

Note: in order to read from multiple meters each meter needs to have a unique modbus address and use the same baud rate and modbus data format

On the SDM120 the modbus address can be set via the push button LCD menu

@glynhudson glynhudson merged commit 3989825 into master Aug 24, 2022
@glynhudson glynhudson deleted the minimalmodbus_multiple_meters branch August 24, 2022 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants