APK v3.18.0 field name extraction — reference for mqtt_monitor decoding #282
Replies: 4 comments 4 replies
|
Thanks for the analysis. |
|
I am working on that part already in a fork but it's up to this point 94 Response models, 111 endpoints and in addition to that the mapping to the functions. Those are not in the Dart part of the app from which the above mentioned came, but in fromJSON part of the decompiled app itself. First part is extracting the info, second part will be making it usable for you. I'm still in the extraction step :) Forgot to mention: the DART part should have the UI (including validation) but in sequential order (disassembled) so it "should" be possible to find field validation, mandatory fields etc. |
|
I dropped the work on the fork with apk reverse engineering since just checking the PRs resulting from it would be a nightmare and honestly, AI work isn't reliable enough for that amount of data. Instead I restructured what was found and made a new Repo with appropriate disclaimers and information about confidence level. https://github.com/moag1000/anker-solix-api-exploration I genuinely hope that this will be of use. The tokens that went into this (due to the sheer amount of data) were ... a lot. In order to better suit the information for this repo, what can I do? |
|
Yeah, I could not filter anything else useful from the repo, a lot of stuff was wrong, shifted etc. The endpoints themselves are documented in the apitypes already, I don't know if anything was missing, I believe I have not seen one that was found and was missing. But not all endpoints have been found by AI. And yes, any UI related functions are useless. I can imagine that other param types are used for settings only, e.g. 14, 15, 17, 21, 22, 24, 25. What does not work are the 1,2,3,5 types in relation to any time_of_use or time_slot settings. Also settings for dynamic tarif tax and fee I could not find yet, neither do I know how to adjust. Any information about dynamic tarif and time_slot mode are completely missing. So I've used a different approach now using the decompiled code and trying to analyze the set and get paths. There's many new things now but I am not sure if I can trust the results. I've added a changelog to show what changed when so no-one has to read the entire thing or trace commits :) If the AI is right, the knowledge should help more now, since it tried to analyze the get and set in the BLE communication as well. What's new (2026-03-28):
Device-tested corrections (on my own SB2 Pro + Smart Plug):
edit: it still gets things wrong i.e. where the write happens (api, mqtt) because it's hard to track, but it appears to deliver at least a bit more useful stuff |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I ran a Blutter decompilation (Dart AOT reverse engineering) against libapp.so from Anker App v3.18.0 and extracted JSON field names from the Dart model classes. Sharing this as a potential reference for mqtt_monitor sessions — not as verified data.
Important caveats
toJson/fromJsonmethods in compiled Dart classes. They reflect what the app internally calls these fields, not necessarily what the MQTT binary protocol uses.What was extracted
toJson/fromJsonmethodsA17b1 (Solarbank E1600) — MQTT short-form keys
These map to the abbreviated JSON keys used in the A17b1 MQTT payload:
socbp/bpupp/ppugp/gpulp/lpuop/opuws/bs/gs/psmmpsbdsdataFlowDataFlow sub-fields:
p2bp,p2lp,p2gp,b2lp,b2gp,g2bp,g2lp,mpp(micro-inverter power — only relevant for systems with external micro-inverter e.g. MI80/A17X7)🆕 A5101 DataCodeType — MQTT binary data codes (not in upstream)
Extracted from the
A5101DataCodeTypeenum. These are the internal MQTT data code names used by the X1/HES for structured binary data. None of these are currently mapped inmqttmap.py:Power flow:
pvPower,pvBatteryPower,pvGridPower,pvLoadPower,pvToChargerPower,batteryPower,batteryLoadPower,batteryGridPower,batToChargerPower,gridPower,gridLoadPower,gridBatteryPower,gridToChargerPower,loadPower,dieselBatterPower,dieselLoadPower,evChargerAllPower,evChargerOnlineNumEMS/Control:
controlMode,workMode,shiftMode,backupMode,peakShaving,peakShavingValue,gridCharging,manualBackupPower,manualBackupEnable,x1AllowChargeGrid:
gridStandardCode,gridSensitivity,gridSensitivityEnable,realGridState,dredRcrState,rsdState,fastStopStateHeat pump:
heatPumpMode,heatPumpSGEnable,secondHeatPumpSGEnable,heatPumpActiveRatePower,heatPumpActiveTime,heatPumpWork,heatPumpStartingProtectionDelayDiesel/Generator:
dieselMode,dieselNormalStartSOC,dieselNormalStopSOC,dieselQuietEnable,dieselQuietStartHour/Min/SOC,dieselQuietStopHour/Min/SOC,dieselMaintenanceCycle/Duration/Enable,dieselNextMaintenanceTime,generatorRatedPower🆕 AI EMS Profit model (not in upstream)
From
AiEmsProfitModel.fromJson:aiems_profit,aiems_profit_total,aiems_self_use_diff,aiems_lifetime_profit,price_unit,running_time,schedule_day,self_use_diff_percent,show_percentage,type🆕 Disaster Preparedness / Storm Guard (not in upstream)
From
DeviceDisasterModeland related:auto_disaster_switch,auto_disaster_status,manual_disaster_switch,manual_disaster_status,disaster_type,disaster_details,current_disaster_detail,start_time,end_time,charging_time,soc,code,event,google_code,uuidMQTT handlers in APK:
_handleMqttAutoDisasterState,_handleMqttManualBackupDisasterState🆕 EV Charger A5190 fields (not in upstream)
Load balancing:
dynamicLoadBalancing,loadBalancingSwitch,loadBalancingConnectedId/Type/ConnectionMode/ErrorCode,loadBalancingMainBreakerCurrent,maximumCurrentLimitGreen energy priority:
greenEnergyPrioritySwitch,greenEnergyPriorityChargingMode,greenEnergyPriorityMinOutputCurrent,greenEnergyPriorityThreePhaseSwitchSmart features:
smartChargingSwitch,plugAndChargeSwitch,rfidCardSwitch/MaxNum,rainTouchPreventionStatus,boostMode,rechargingPowerOutageOCPP/Modbus:
modbusTcpSwitch,tcpModbusIp/Port/MaxCurrent/PhaseLimit/Timeout🆕 A7320 Generator / Range Extender fields (not in upstream)
Engine:
engineIsOpen,engineNumber,engineOilTime,engineStatus,oilEngineSn,faultCodeA/BFuel:
currentFuelType,gasolineMargin,remainingGasolineUsageTime,lPGMargin,lPGGasolineUsageTimeE1 Battery (connected PPS):
e1BatterySOC,e1BatteryChargingPower,e1BatteryControlMode,eOneSnRange Extender PPS:
oilEngineStartCondition,oilEngineStartSoc,oilEngineTargetSoc,oilEngineStrategyStatus,oilUnableExecuteStrategyReason🆕 Grid Config model (not in upstream mqttmap.py)
From
A5101StationGridConfigModel:afci,config,dred,faststop,rcr,rsd,statusEMS Mode model
mode_type,sub_mode,battery_reserve,is_off_grid,price,unit,use_time,weekday,weekend,start_time,end_time,start_month,end_month,seaA5101 (HES/X1) — MQTT device info fields (58)
siteId,sn,onlineState,emsMode,emsStatus,pvPower,pvState,pvToBatPower,pvToLoadPower,pvToGridPower,pvToEvChargerPower,batPower,batState,batElectricQuantity,batTotalCount,batToGridPower,batToLoadPower,batToEvChargerPower,gridPower,gridState,gridToBatPower,gridToLoadPower,gridToEvChargerPower,loadPower,dieselPower,dieselToBatPower,dieselToLoadPower,evChargerAllPower,evChargerOnlineNums,packNumber,packDatas,ppsName,ppsPower,ppsState,ppsElectricQuantity,ppsTotalCount,ppsTotalPower,ppsInfos,ppsRealTimeData,dataFlow,pcsName,pcsData,pcsOnlineNum,pcsTotal,atsName,atsData,deviceCard, ...Devices covered
Field names were extracted for: A17B1, A17C0-C5 (Solarbank), A1782 (PPS), A17E1 (E10), A5101 (X1/HES), A5190 (EV Charger), A7320 (Generator), AX170 (ATS), AE100 (Balcony), AS200 (Car Charger), A2687 (Prime Charger). Full lists available on request.
How this might help
When using mqtt_monitor to decode unknown fields, this list can serve as a vocabulary of candidate field names. It does not tell you which hex byte maps to which field — that still requires the controlled testing approach from Discussion #222. But knowing the field names that exist in the app's data model may speed up identification.
Full Blutter output and raw decompiled Dart files available on request.
Update (2026-03-27): The repo linked above has been significantly expanded since this post:
Details in the CHANGELOG.
All reactions