{
    "rtype":  0,   // 0 = modbus, 1 = http/json

    "name": "Deye LP3 Grid with CT v05",   // as displayed in the config dialog
    "manufacturer": "Deye",
    "dev_type": "deye_lp3_grid_CT_v05",   // will be prefixed by "meter_"
//  "upd_delay": 5000,   // read this inverter only once every x milliseconds

    // modbus parameters
    "rtu": {
        "silence_period": 50,    // msec
        "silence_same_slave": false,
        "retries": 4,
        "rcv_timeout": 120       // msec
    },
    "modbus_read": 3,            // function code to read registers
    "modbus_read_max_registers": 96, 
    "modbus_write": 16,          // function code to write register(s)
    "modbus_write_max_registers": 64,

    // values used to build the model string
    "type_designation": { "fixed": "LP3 Grid" },
    "version": { "fixed": "1.0" },
    "firmware_version": { "fixed": "1.0" },
    "serial": { "address": 3, "type": "string", "length": 5 },

// 598-600 are grid side voltage on phase A,B,C    
    "voltage_l1": { "address": 598, "type": "int16", "resolution": 0.1 },
    "voltage_l2": { "address": 599, "type": "int16", "resolution": 0.1 },
    "voltage_l3": { "address": 600, "type": "int16", "resolution": 0.1 },

// We calculate grid current per phase from the phase power. I = P/U 
// where P is in W, U = 230V, I in mA. resolution = 10 / 230 * 1000 = 4.34

// USE THESE REGISTERS IF YOU HAVE GRID PARALLEL LOADS OR INVERTERS, 
// AND IF YOU USE CT-TRANSFORMERS OR AN EXTERNAL METER ON THE DEYE
    "current_l1": { "address": 616, "type": "int16", "resolution": 4.34 },
    "current_l2": { "address": 617, "type": "int16", "resolution": 4.34 },
    "current_l3": { "address": 618, "type": "int16", "resolution": 4.34 },
    "power_w": { "address": 619, "type": "int16", "resolution": 1.0 },

// USE THESE REGISTERS IF YOU DO *NOT* USE CT TRANSFORMERS ON YOUR DEYE
// AND HAVE ALL YOUR LOADS ON THE DEYE LOAD-PORT
//    "current_l1": { "address": 622, "type": "int16", "resolution": 4.34 },
//    "current_l2": { "address": 623, "type": "int16", "resolution": 4.34 },
//    "current_l3": { "address": 624, "type": "int16", "resolution": 4.34 },
//    "power_w": { "address": 625, "type": "int16", "resolution": 1.0 },

// unfortunately, DEYE always delivers always positive current values on 610-615,
// which is not suitable for cfos to do proper charge management. 
// 610-612 are grid port side current on phase A,B,C
//    "current_l1": { "address": 610, "type": "int16", "resolution": 10 },
//    "current_l2": { "address": 611, "type": "int16", "resolution": 10 },
//    "current_l3": { "address": 612, "type": "int16", "resolution": 10 },
// 613-615 are ext_CT current on phase A,B,C
//    "current_l1": { "address": 613, "type": "int16", "resolution": 10 },
//    "current_l2": { "address": 614, "type": "int16", "resolution": 10 },
//    "current_l3": { "address": 615, "type": "int16", "resolution": 10 },

// 616-618 ext_CT power per phase, 619 is ext_CT total power
//    "*P_grid_l1": { "address": 616, "type": "int16", "resolution": 1.0 },
//    "*P_grid_l2": { "address": 617, "type": "int16", "resolution": 1.0 },
//    "*P_grid_l3": { "address": 618, "type": "int16", "resolution": 1.0 },
// 622-624 grid port phase power, 625 is grid port total power
//    "*P_grid_l1": { "address": 622, "type": "int16", "resolution": 1.0 },
//    "*P_grid_l2": { "address": 623, "type": "int16", "resolution": 1.0 },
//    "*P_grid_l3": { "address": 624, "type": "int16", "resolution": 1.0 },

// accumulated values, result in Wh
    "import_wh": { "address": 522, "type": "int32", "order": "lh", "resolution": 100.0 },
    "export_wh": { "address": 524, "type": "int32", "order": "lh", "resolution": 100.0 } 
    }
 }
 
