squishykid / solax

🌞 Solax Inverter API Wrapper
MIT License
100 stars 57 forks source link

Info for Solax X1AC Battery only inverter #73

Open rwg0 opened 2 years ago

rwg0 commented 2 years ago

Well, this seems to be the best place on the web to find info about how to decode the data from Solax inverters, and I got a lot of hints from looking through the code here, so I thought I would share what I discovered to allow you to add (what I think) is a currently unsupported model.

The X1-AC is a battery only inverter to add battery storage when you already have an existing solar panel array. There's also a separate 'RetroFit' version that has EPS (which we will be swapping to - the wrong one got ordered for us...)

Anyway, you can get the data by

curl -s -X POST http://espressif --data 'optType=ReadRealTimeData&pwd=WIFISTICKCODE'

This works on the main WIFI network as well as the 5.8.8.8 one, but you need the WIFI stick code, which I think is a thing from newer versions of the WIFI adapter. You may need to use the IP address instead of the espressif name. No traditional auth is required - the pwd parameter in the post body is fine.

Data that comes back is

{"sn":"<WIFI STICK CODE>","ver":"3.003.02","type":9,"Data":[0,0,0,0,0,0,0,0,0,0,9,12,0,12,0,0,0,25,10,0,13,5,0,0,0,0,0,8,0,0,0,0,0,8,100,0,0,494,0,0,0,0,0,0,64863,65535,4307,0,8170,0,673,0,0,1314,900,318,200,226,206,33,0,0,0,0,0,0,0,0,0,0,0,0,33,1,1,1,3,0,2,0,0,0,0,0,20,0,221,0,0,0,0,0,0,0,0,0,3,0,68,0,0,0,0,0,13,2,0,0,0,0,0,0,0,0,0,0,1,256,2093,1811,5638,594,520,8995,0,0,0,0,0,17,1174,0,0,3264,3258,11647,0,21302,14389,18753,12593,16689,12355,13876,21302,14389,18753,12593,16689,12355,13876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,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,9,"<INVERTER SERIAL NUMBER>",8,1.20,0.00,1.20,1.04,0.03,1]}

Note that this is actually data with the battery asleep, so some things are zero that are valid when the battery is active.

Here's the data mapping I have worked out so far (zero based indices). Values in the data are all unsigned 16 bit, negative values are 65535=-1, etc.

0 : AC voltage at inverter 10 (zero in sleep mode) 1 : AC current from battery 10 (-ve = to battery) 2 : AC power from battery 9 : AC frequency 100 14 : Battery voltage 100 15 : DC Battery current * 100 (positive = charging) 16 : DC Battery power (positive = charging) 17 : Battery temperature (C) 18 : Battery % remaining - note stops discharging at floor of 10% 44 : Grid power - negative = import 50 : Grid import + AC power draw from battery - sort of net site usage

46 (perhaps 46/47) and 48 (48/49) look like they are counters of some sort - low word / high word pairs? I haven't deciphered what though.

Anyway, hope this is useful to someone :)