solax-local-api-docs icon indicating copy to clipboard operation
solax-local-api-docs copied to clipboard

X1-Hyrid-G3 incorrect data mapping

Open andmagri opened this issue 2 years ago • 4 comments

I'm finding some values in Data2.txt don't match for this inverter type (3) e.g. Yield_Total: read32BitUnsigned(Data[11], Data[12]) / 10

Data[11] = 64258 Data[12] = 1

Yield_Total = 1 + 65536 * 64258 = 4,211,276,546 / 10 Solax Cloud says that the total yield is 12.58MW

{"sn":"****","ver":"2.035.01","type":3,"Data":[2323,8,1,0,0,0,0,1,2,5000,2,64258,1,88,0,0,19660,10,5,22,100,0,35663,0,71,0,0,0,0,0,0,0,0,0,0,0,0,100,0,22,3608,0,0,0,274,0,0,0,63416,65535,5752,0,35641,1,2121,22,256,2160,1740,0,185,130,120,32,32,573,1,1,13566,0,41592,0,55360,1,251,0,65534,65535,154,0,0,0,0,0,0,0,0,0,125,0,1708,0,0,251,0,87,0,0,0,0,0,0,0,0,0,0,0,0,1,22016,5134,2066,6145,0,0,0,0,513,0,0,0,0,0,0,0,273,1970,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,257,257,257,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "Information":[3.680,3,"****",1,3.35,0.00,3.29,1.05,0.00,1]}

andmagri avatar Jan 08 '24 17:01 andmagri

That is how application't code seems to read it though :man_shrugging:

nazar-pc avatar Jan 08 '24 17:01 nazar-pc

I've come across this for a Gen4: def pack_u16(a, b): return (b << 16) + a

'On-grid total yield': pack_u16(data[11],data[12])*0.1

Source: https://community.openenergymonitor.org/t/reading-data-from-a-solax-x1-hybrid-gen4-hybridx-inverters/23842

How would I translate this into bash cause it's the only scripting language I understand?

andmagri avatar Jan 09 '24 07:01 andmagri

This is really not the place to ask such questions :confused:

nazar-pc avatar Jan 09 '24 09:01 nazar-pc

...however @andmagri bitwise shift in bash can be done:

 a=1; b=8; echo $(( ( $b << 2 ) + $a ))

darmach avatar Nov 10 '24 12:11 darmach