{
    "rtype": 0,  // 0 = modbus, 1 = http/json
    "mtype": 4,  // 0 = other, 1 = meter, 2 = inverter, 4 = battery

    "name": "Marstek Venus Test 1",   // as displayed in the config dialog
    "manufacturer": "Marstek",
    "dev_type": "marstek_e30_test1",   // please change! must be a unique name 

    // 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": 60, 
    "modbus_write": 6,          // function code to write register(s)
    "modbus_write_max_registers": 48,

    // values used to build the model string
    "type_designation": {
        "address": 0,
        "type": "string",
        "fixed": "Marstek Venus E"
    },
    "version": {
        "address": 0,
        "type": "string",
        "fixed": "3.0"
    },
    "firmware_version": {
        "address": 0,
        "type": "string",
        "fixed": "V147"
    },
    "serial": {
        "address": 0,
        "type": "string",
        "fixed": "0"
    },
    
    // instantaneous values
    
    "power_w": {
        "address": 30006,
        "type": "int16",
        "order": "hl",
        "resolution": -1.0
    },
    "voltage_l1": {
        "address": 32200,
        "type": "uint16",
        "order": "hl",
        "resolution": 0.1
    }, 
    "current_l1": {
        "address": 37004,
        "type": "int16",
        "order": "hl",
        "resolution": -4.0
    }, 
	"soc": {
		"address": 34002,
		"type": "uint16",
		"order": "hl",
		"resolution": 0.1
	},
    "import_wh": {
        "address": 33000,
        "type": "uint32",
        "order": "hl",
        "resolution": 10
    }, 
    "export_wh": {
        "address": 33002,
        "type": "uint32",
        "order": "hl",
        "resolution": 10
    }, 
    
    }, 
	"*Reg_42000": {
		"address": 42000,
		"type": "int16",
		"order": "hl",
		"resolution": 0.1
	},
	
	}, 
	"*Reg_42010": {
		"address": 42010,
		"type": "int16",
		"order": "hl",
		"resolution": 0.1
	},
    
    
    "outputs": [
        {  // Batteriesteuerung aktivieren, Modbusregister 42000 mit Wert 21930 beschreiben. Das Register wird periodisch alle 7sek beschrieben
       "address": "${if bat_mode > 0`http://localhost/cnf?cmd=modbus_set&addr=${address}&func=6&id=${id}&reg=42000&val=${bat_mode ? 21930 : 21947}&type=w"
        },
       
       {   // Lademodus aktivieren, Register 42010 mit 1 für Laden beschrieben.
        "address": "#7#${if bat_mode = 1`http://localhost/cnf?cmd=modbus_set&addr=${address}&func=6&id=${id}&reg=42010&val=1&type=w}"
        },    
       {   // Ladeleistung in Watt Modbusadresse 42020
        "address": "${if bat_mode  = 1`http://localhost/cnf?cmd=modbus_set&addr=${address}&func=6&id=${id}&reg=42020&val=${charge_power_w}&type=w}"
        },
        
        {   // Endlademodus aktivieren, Register 42010 mit 2 für Laden beschrieben.
        "address": "#7#${if bat_mode = 1`http://localhost/cnf?cmd=modbus_set&addr=${address}&func=6&id=${id}&reg=42010&val=2&type=w}"
        },    
       {   // Endladeleistung in Watt Modbusadresse 42021
        "address": "${if bat_mode  = 1`http://localhost/cnf?cmd=modbus_set&addr=${address}&func=6&id=${id}&reg=42021&val=${discharg_power_w}&type=w}"
        },
        
        
        
        
    ]
    
    
    
    
}
 
