Hello,
i am a little stuck here.
i try to add power meter from finder the 7M.24 and 7M.38
made a new file finder.py under /opt/victronenergy/dbus-modbus-client
included it in the dbus-modbus-client.py file and compiled both files.
but the venus os cant find my meter.
i have attached the modbus register declaration as pdfModbus-7M24-7M38_v2_30062021.pdf
this is my finder.py file:
import struct import device import probe from register import Reg, Reg_s16, Reg_s32b, Reg_u16, Reg_u32b, Reg_u64b, Reg_text class Reg_serial(Reg, str): def __init__(self, base, name): Reg.__init__(self, base, 2, name) def decode(self, values): v = struct.unpack('>i', struct.pack('>2H', *values)) return self.update(str(v[0])) class Finder_Meter(device.EnergyMeter): productid = 0xb017 min_timeout = 0.5 def __init__(self, *args): super(Finder_Meter, self).__init__(*args) self.info_regs = [ Reg_serial(9, '/Serial'), Reg_text(13, '/FirmwareVersion'), ] def device_init(self): self.data_regs = [ Reg_u32b(2491, '/Ac/Power', 100, '%.1f W'), Reg_u32b(2498, '/Ac/Frequency', 100, '%.1f Hz'), Reg_u32b(2760, '/Ac/Energy/Forward', 100, '%.1f kWh'), Reg_u32b(2768, '/Ac/Energy/Reverse', 100, '%.1f kWh', invalid=0xffffffffffffffff), # We always have L1 voltage and current Reg_u32b(2500, '/Ac/L1/Voltage', 10, '%.1f V'), Reg_u32b(2516, '/Ac/L1/Current', 100, '%.1f A'), ] def get_ident(self): return 'finder_{}'.format(self.info['/Serial']) class Finder_Meter_1P(Finder_Meter): productname = 'Finder 7M.24 Energy Meter' def device_init(self): super(Finder_Meter_1P, self).device_init() # Copies of overall values, because phase values show not-supported. self.data_regs += [ Reg_u32b(2530, '/Ac/L1/Power', 100, '%.1f W'), Reg_u32b(2762, '/Ac/L1/Energy/Forward', 100, '%.1f kWh'), Reg_u32b(2770, '/Ac/L1/Energy/Reverse', 100, '%.1f kWh'), ] class Finder_Meter_3P(Finder_Meter): productname = 'Finder 7M.38 Energy Meter' def device_init(self): super(Finder_Meter_3P, self).device_init() self.data_regs += [ Reg_u32b(2502, '/Ac/L2/Voltage', 10, '%.1f V'), Reg_u32b(2504, '/Ac/L3/Voltage', 10, '%.1f V'), Reg_u32b(2518, '/Ac/L2/Current', 100, '%.1f A'), Reg_u32b(2520, '/Ac/L3/Current', 100, '%.1f A'), Reg_u32b(2530, '/Ac/L1/Power', 100, '%.1f W'), Reg_u32b(2532, '/Ac/L2/Power', 100, '%.1f W'), Reg_u32b(2534, '/Ac/L3/Power', 100, '%.1f W'), Reg_u32b(2762, '/Ac/L1/Energy/Forward', 100, '%.1f kWh'), Reg_u32b(2764, '/Ac/L2/Energy/Forward', 100, '%.1f kWh'), Reg_u32b(2766, '/Ac/L3/Energy/Forward', 100, '%.1f kWh'), Reg_u32b(2770, '/Ac/L1/Energy/Reverse', 100, '%.1f kWh'), Reg_u32b(2772, '/Ac/L2/Energy/Reverse', 100, '%.1f kWh'), Reg_u32b(2774, '/Ac/L3/Energy/Reverse', 100, '%.1f kWh'), ] models = { 927804978: { # 7M.24 (0x374d2e32) 'model': '7M.24', 'handler': Finder_Meter_1P, }, 927804979: { # 7M.38 (0x374d2e33) 'model': '7M.38', 'handler': Finder_Meter_3P, }, } probe.add_handler(probe.ModelRegister(Reg_u32b(1), models, methods=['rtu', 'tcp'], units=[1, 11], rates=[115200]