I wrote a bit of python3 to monitor my Batrium BMS.
You can modify it using info here: https://github.com/Batrium/WatchMonUdpL ... 20v1.0.pdf
I plan to incorporate it into my pvoutput upload script.
# Batrium UDP monitor in Python3 # John Lindsay import select, socket import struct port = 18542 # where do you expect to get a msg? bufferSize = 1024 # whatever you need s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(('',port)) s.setblocking(0) byterecord = struct.Struct('B') intrecord = struct.Struct('H') floatrecord = struct.Struct('f') global got_soc got_soc = False global got_volts got_volts = False completed = False while not(completed): result = select.select([s],[],[]) msg = result[0][0].recv(bufferSize) if msg[:3] == b'\x3a\x33\x3f': battery_soc=((float(byterecord.unpack(msg[32:33])[0])/2)-5) # byte -5% to 105% 0.5% per bit => /2 - 5 got_soc = True if msg[:3] == b'\x3a\x32\x3e': battery_min = intrecord.unpack(msg[8:10])[0]/1000.0 #Uint16 x 1000 battery_max = intrecord.unpack(msg[10:12])[0]/1000.0 #Uint16 x 1000 battery_bypass_count = (byterecord.unpack(msg[33:34])[0]) battery_volts = intrecord.unpack(msg[40:42])[0]/100.0 #Uint16 x 100 battery_amps = floatrecord.unpack(msg[42:46])[0]/1000.0 #float4 x 1000 got_volts = True completed = (got_volts and got_soc) print ("soc%:",battery_soc) print ("min:", battery_min) print ("max:", battery_max) print ("bypass:", battery_bypass_count) print ("volts:",(battery_volts)) print ("amps:",(battery_amps))