Validation Model

March 25, 2026 · View on GitHub

The Anker App does NOT hardcode validation ranges. It queries the server for device-specific limits and builds UI controls dynamically from the response. This document describes the query→validate→set flow for each setting category.

Sources: Blutter decompilation of controller/logic Dart files (for API/BLE flows), mqtt_monitor sessions on A17C1 FW 1.0.6.10 and A17X8 FW 0.0.2.7 (for verified MQTT commands). Settings marked "Verified" were confirmed with real device traffic.

General Pattern

1. GET endpoint  →  Response with min/max/step/options fields
2. UI built from response values (slider range, picker options)
3. User changes value (constrained by UI)
4. SET endpoint  ←  New value sent to server

Developers implementing controls must follow the same pattern: always query limits first, then validate user input against the response.


Power Limit Settings

Query: get_power_limit (param_type=16)

Response model: StationPowerLimitModel

Response FieldPurpose
minMinimum allowed power (W)
maxMaximum allowed power (W)
stepStep size for slider (W)
init_stepInitial step size
legal_limitLegal limit for region
legal_power_limitLegal power limit (W)
region_power_limitRegion-specific limit
power_limit_optionAvailable power options
power_limit_option_realActual applicable options
acInputLimitAC input limit
supportAcLimitWhether AC limit is supported
parallel_typeParallel system type
exceed_alarmExceed alarm threshold

Set: set_site_device_param (param_type=19)

Function: setSiteDevicePowerLimit Params: site_id, param_type=19, cmd, param_data

App Flow (from station_power_limit_logic.dart)

1. getSitePowerLimit()  →  StationPowerLimitModel
2. UI slider: min=model.min, max=model.max, step=model.step
3. Legal warning if value > model.legal_power_limit
4. setSiteDevicePowerLimit()  ←  new limit value

Home Load / Output Power Settings

Query: get_device_home_load

Response model: A17C1DeviceHomeLoadData / SiteHomeLoadModel

Response FieldPurpose
min_loadMinimum home load (W)
max_loadMaximum home load (W)
stepStep size (W)
current_home_loadCurrent setting
default_home_loadDefault value
default_charge_priorityDefault charge priority (%)
schedule_modeCurrent schedule mode
last_select_modeLast selected mode
parallel_home_loadParallel system load
parallel_displayWhether parallel display is shown
advancedModeMinLoadMin load in advanced mode
rangesTime slot ranges with per-slot settings

Set: set_device_home_load

Params: device_sn, mode_type, custom_rate_plan, home_load_data

App Flow (from a17c1home_logic.dart / energy_home_controller.dart)

1. get17C1DeviceHomeLoadPort()  →  A17C1DeviceHomeLoadData
2. UI slider: min=model.min_load, max=model.max_load, step=model.step
3. Schedule editor: ranges with start_time, end_time, power, charge_priority
4. set17C1DeviceHomeLoadRes()  ←  updated schedule

SOC Reserve / Battery Reserve

Query: get_site_device_param (param_type=18)

Function: getSafetySocParams Response: param_data JSON containing:

Response FieldPurpose
soc_listList of SOC options: [{id, is_selected, soc}]
switch_0w0W switch status
enable_0w0W feature enabled
enable_0w_changeWhether 0W can be changed
feed-in_power_limitFeed-in power limit

Set: set_site_device_param (param_type=18)

Function: setSafetySocParams

Additional: get_device_attrs for per-device SOC

Response model: DevicePowerLimit

Response FieldPurpose
minMinimum SOC (%)
maxMaximum SOC (%)
stepStep size (%)
feeder0w0W feeder status
switch_0w0W switch
ip_regionIP region
regulation_codeRegulation code

App Flow (from soc_setting_controller.dart)

1. getSafetySocParams()  →  soc_list with available SOC options
2. UI shows soc_list options (e.g., 5% and 10%)
3. User selects new SOC reserve
4. setSafetySocParams()  ←  updated soc_list with is_selected

Usage Mode / Energy Mode

Query: get_site_device_param (param_type depends on device)

Functions:

  • param_type=1: getSiteGreenModeDeviceParam — Green mode
  • param_type=2: getSitePeakTimeDeviceParam — Peak/valley
  • param_type=3: getSiteEnablePeakDeviceParam — Peak shaving
  • param_type=5: getSiteLowerLimitDeviceParam — Lower limit

Response model: SiteConsumptionStrategyModel

Response FieldPurpose
mode_typeCurrent mode
min_loadMinimum load for this mode
max_loadMaximum load for this mode
stepStep size
reserved_socReserved SOC for this mode
custom_rate_planCustom rate plan definition
blend_planBlend plan (smart plug mode)
data_authData authorization flag
exceed_alarmExceed alarm setting
ai_emsAI EMS configuration

Set: set_site_device_param

Function: set17C1SiteDeviceParam Also via MQTT: Command 005e (usage_mode + schedule, see PR #283)

App Flow (from power_usage_scenario_logic.dart)

1. get17C1SiteDeviceParam()  →  SiteConsumptionStrategyModel per mode
2. getAiModeStatusRequest()  →  AiModeStatusModel (AI EMS state)
3. UI shows available modes with their constraints
4. set17C1SiteDeviceParam()  ←  new mode + schedule

Country Code / Grid Code

Query: get_site_device_param (param_type=20)

Function: getStationCountryCode

Set: set_site_device_param (param_type=20)

Function: setStationCountryCode


Third-Party PV

Query: get_site_device_param (param_type=26)

Function: getThreePvParam Response: param_data containing third_part_pv_setting, show_third_party_pv_panel

Set: set_site_device_param (param_type=26)

Function: setThreePvInstallSwitch


EV Charger Max Current

App Flow (from max_charge_controller.dart)

1. Read ev_max_current from device info
2. UI slider constrained by device rated current
3. Set via MQTT or API

Tracked fields: ev_max_current, ev_event_duration, ev_entrance, ev_is_success


Dynamic Price / TOU

Query: dynamic_price/support_option

Function: getDynamicPriceSupportOption Params: site_id

Query: dynamic_price/price_detail

Function: getDynamicPriceDetail Response model: DynamicPriceDetailModel

Response FieldPurpose
timeTime points
pricePrice values
currencyCurrency
todayAvgPriceToday average price
todayPriceTrendToday price trend
tomorrowAvgPriceTomorrow average
tomorrowPriceTrendTomorrow trend

Set: set_site_device_param with electricity_strategy

Function: setDynamicPrice Params: device_sn, mode, protocol_key, status


Disaster Preparedness / Storm Guard

Query: check_function

Response model: CheckFunctionModel

Response FieldPurpose
auto_disasterAuto disaster supported
supportGeneral support flags
ems_disableEMS disabled flag
peak_shavingPeak shaving supported

Query: get_auto_disaster_prepare_status

Response model: AutoDisasterPrepareStatusModel Fields: code, disasterPrepareStatus, events, targetPage

Set: Manual disaster via API

Params: identifier_id, type, disaster_type, manual_disaster_switch, start_time, end_time



MQTT-Only Settings (Solarbank A17C0-C5)

These settings are controlled exclusively via MQTT commands, not through the cloud API. The validation values come from the device's status messages (0405/0408).

Important: MQTT command numbers are device-specific. The same command number can have different meanings on different devices. For example, 0068 is the LED command on A17C1 but CMD_SB_INVERTER_TYPE on A17C0. Similarly, 005e is CMD_SB_USAGE_MODE on Solarbanks but CMD_AC_FAST_CHARGE_SWITCH on PPS devices. Always check mqttmap.py for the device-specific mapping under the correct model key.

LED / Light Mode

Details
MQTT cmd0068 (A17C1 — on A17C0 this is inverter type!)
Fieldsa2=light_mode (0=normal, 1=mood), a3=light_off_switch (0=on, 1=off)
Status0405 fields d2, e1
BLE actionaction_set_ambient_light_switch
VerifiedA17C1 FW 1.0.6.10 (mqtt_monitor 2026-03-25)

Temperature Unit

Details
MQTT cmd0050
Fieldsa2=temp_unit (0=Celsius, 1=Fahrenheit)
Status0405 field a9
BLE actionaction_set_temperature_type
VerifiedA17C1 FW 1.0.6.10

Power Cutoff Thresholds

Details
MQTT cmd0067
Fieldsa2=output_cutoff (5|10), a3=lowpower_input (4|5), a4=input_cutoff (5|10)
Status0405 fields b4, b5, b6
OptionsFixed: output/input=[5,10], lowpower follows output (5→4, 10→5)
VerifiedA17C1 FW 1.0.6.10

Max Load (direct)

Details
MQTT cmd0080 (from app), 005a (from cloud)
Fieldsa2=max_load (W), a3=max_load_type (0=manual, 3=auto/parallel)
Status0405 field c2
OptionsDepends on get_power_limit response: Single=[350,600,800,1000], Multi=[1200,2400,3600,4800]
VerifiedA17C1 FW 1.0.6.10

Usage Mode + Schedule

Details
MQTT cmd005e (A17C1 Solarbank — on PPS devices this is CMD_AC_FAST_CHARGE_SWITCH!)
Fieldsa2=usage_mode (1=SmartHome, 3=Volleinspeisung, ...), a3=schedule_enabled, a4-be=7 weekday slots
Slot format8 bytes LE: start_min(2B):end_min(2B):home_load_W(2B):charge_priority(2B)
Also via APIset_site_device_param with mode-specific param_type
VerifiedA17C1 FW 1.0.6.10, modes 1+3

Grid Export

Details
MQTT cmd0080 (command group: max_load + grid_export)
Fieldsa5=off_grid_enable?, a6=disable_grid_export (0=allow, 1=disable), a9=grid_export_limit
Status0405 field fb (bitmask 0x01)
Also via APIset_device_attrs with pv_power_limit attribute

AC Input Limit

Details
MQTT cmd(part of device control, msg type varies)
BLE actionaction_set_ac_params
Status0405 field: ac_input_power?

PV Power Limit

Details
APIset_device_attrs with pv_power_limit attribute
ValidationFrom get_device_attrs response: pv_power_limit, legal_power_limit

Device Timeout

Details
MQTT cmdDevice-specific command
Status0405 fields vary

MQTT-Only Settings (SmartPlug A17X8)

Plug Switch

Details
MQTT cmd007a
Fieldsa2=switch (0=OFF, 1=ON)
Status0405 field a4 (ac_output_power_switch)
VerifiedA17X8 FW 0.0.2.7

Plug Schedule

Details
MQTT cmd007c
Fieldsa2=action (0=delete, 1=create, 2=modify), a3=slot (1-x), a4=enabled (0/1), a5=time (min:hour), a6=switch (0=OFF, 1=ON), a7=weekdays (day numbers 1=Mon..7=Sun, variable length)
Optionsa2=[0,1,2], a4=[0,1], a6=[0,1], a7=1-7 per byte
VerifiedA17X8 FW 0.0.2.7, 4 sessions

Plug Timer / Countdown

Details
MQTT cmd007e
Fieldsa2=toggle_switch (0=cancel, 1=start, 2=pause, 3=resume), a3=delay_time (3 bytes LE, seconds), a4=back_switch, a5=back_delay_time
Status0405 field ad (8 bytes: delay_time[3B] + setting[1B] + status[1B] + elapsed[3B])
Status valuesstatus: 0=off, 2=paused, 3=running
VerifiedA17X8 FW 0.0.2.7, pause/resume confirmed

BLE/IoT SDK Actions (A5101/X1, AX170, A17E1)

These settings use the akiot.device.invoke_action or akiot.device.write_property path.

Backup Strategy (AX170)

Details
BLE actionaction_set_backup_strategy
Fileax170_command.dart

Branch Circuit Config (AX170)

Details
BLE actionaction_set_custom_branch
Fileax170_command.dart

Connection Sensitivity (AX170)

Details
BLE actionaction_set_connection_sensitivity
Fileax170_command.dart

Generator / Oil Machine Params

Details
BLE actionsaction_set_oil_machine_params (A17E1), action_set_standby_oil_machine_params (AX170), action_set_third_oil_params (A17E1), action_set_third_oil_AX170, action_set_third_oil_type

Heat Pump

Details
APIset_station_evchargers with heat_pump_setting param
BLE actionNone found (API-only for heat pump)
Fieldsheat_pump_mode, heat_pump_manual_enable, heat_pump_min_running_time, heat_pump_min_launch_time, heat_pump_power

Electricity Price / Grid Code

Details
BLE actionaction_set_electricity_price_and_unit (A17E1)
BLE actionaction_set_power_limit_country_code (init flow)
BLE actionaction_set_biggest_frequency (AX170)

Distribution Box / Grid Config

Details
BLE actionaction_set_distribution_box
BLE actionaction_set_system_self_check

Off-Grid Port Switch (A17E1)

Details
BLE actionaction_set_offline_port_switch, action_set_offline_port_switch_memory

BLE/IoT SDK Actions (EV Charger A5190)

Load Balancing

Details
BLE actionprop_write_load_balancing
FieldsloadBalancingSwitch, loadBalancingMainBreakerCurrent, maximumCurrentLimit

Green Energy Priority

Details
BLE actionprop_write_green_energy_priority
FieldsgreenEnergyPrioritySwitch, greenEnergyPriorityChargingMode, greenEnergyPriorityMinOutputCurrent

RFID

Details
BLE actionsprop_read_rfid, prop_write_rfid, prop_write_by_evcharger_rfid

OCPP

Details
BLE actionsprop_read_ocpp_info, prop_write_ocpp_info

EV Charger General Config

Details
BLE actionprop_write_evcharger
BLE actionaction_set_schedule (schedule_ble.dart, ev_charge_command.dart)

BLE/IoT SDK Actions (PPS / Charger)

AC/DC/Car Port Params (A1782 PPS)

Details
BLE actionsaction_set_ac_params, action_set_bms_params, action_set_car_charger_params
BLE actionaction_set_tou_system_params, action_set_cycle_charging_power

Screen / Display (A2345/A2687)

Details
BLE actionsaction_set_screen_saver_params, action_set_screen_off_time, action_set_screen_orientation, action_set_lcd_backlight_brightness

Charging Protocol (A2687)

Details
BLE actionsaction_set_charging_protocol, action_set_charging_fixed_protocol, action_set_laboratory_charging_protocol, action_set_laboratory_function_switch

DC Port Control (A2687)

Details
BLE actionsaction_set_dc_port_switch, action_set_dc_port_countdown

Custom Mode (A2687)

Details
BLE actionsaction_set_custom_mode_delete, action_set_custom_mode_switch_type

Charging Schedule (A2693)

Details
BLE actionsaction_set_charging_schedule, action_get_charging_schedule

Sleep Mode (A25X7)

Details
BLE actionaction_set_sleep_mode

Gyroscope (A2687)

Details
BLE actionaction_set_gyroscope_switch

Tomato Timer

Details
BLE actionaction_set_tomato_time


BLE Settings (AS200 Car Charger)

All AS200 settings use a single BLE action action_set_system_params with different param keys.

Temperature Unit

Details
BLE actionaction_set_system_params
Param{temperatureUnit: <int>}

Shutdown / Standby

Details
BLE actionaction_set_system_params
ParamsshutdownStatus (bool), shutdownTimeout (int), shutdownTimeoutV2 (int), neverShutdown (bool)

Work Mode

Details
BLE actionaction_set_system_params
Param{currentWorkMode: <int>}

Power On/Off

Details
BLE actionaction_set_system_params
Param{powerSwitch: <bool>}

Power & Output Voltage

Details
BLE actionaction_set_system_params
Params`{reverseModePower

Scene / Battery Config

Details
BLE actionaction_set_system_params
ParamsbatteryType (int), batteryVoltageType (int), powerUnlock (int), lowLoadAutoShutdownTimeout (int)

BLE + API Settings (A7320 Generator / Range Extender)

A7320 uses both BLE property writes (22 commands) and cloud HTTP API (18 endpoints).

BLE Settings (via writeProperty)

SettingBLE PropertyParams
Screen timeoutscreen_off_timetimeout value
Atmosphere light brightnessa7320_atmosphere_lights_hrightnessbrightness level
Factory resetrestore_factory_settings
Manual exercise startmanual_workout_startexercise params
Oil reminderremaining_oil_reminderremaining value
Automatic exerciseautomatic_exerciseschedule params
AC timed shutdowntimed_shutdown_actimeout
AC cancel shutdowntimed_shutdown_cancel_ac
Engine operation controlengine_operation_controlcontrol params
Gas volume monitoringgas_volume_monitoring_switchon/off
LPG tank remainingweight_full_LPG_tank_remainingfullTank, remaining, source, typeEngine
LPG deleteadded_LPG_deleteGAS
LPG sensor addadded_LPG_sensorsensor params
Calendar remindercalendar_expiration_remindesetTime, setWeek, setMonth, resetSameTime
Maintenance updatemaintenance_updateupdate data
Periodic counterperiodic_counterrcounter value
Unit of measurementunit_of_measurementunit
Engine operation modeoil_engine_operation_modemode
Stop enginestop_engine

Cloud API — Maintenance

EndpointParams
set_oil_consumption_reminder_plandevice_sn, interval_period_month, interval_period_week
set_oil_consumption_reminder_switchdevice_sn, oil_consumption_reminder_switch
set_oil_machine_exercise_plandevice_sn, effective_mode, automatic_exercise, manual_exercise
start_oil_machine_exercisedevice_sn, execution_time, execution_result
set_parts_maintenance_plandevice_sn, parts_maintenance_items
set_maintain_parts_notice_switchdevice_sn, notice_switch
set_maintain_parts_ignore_remindersdevice_sn, item_id, item_name, ignore_reminders
batch_maintain_oil_engine_partsdevice_sn, maintenance_items: [{item_id, item_name, description}]

Cloud API — Range Extender System

EndpointParams
add_extender_systemdevice_list
del_extender_systemextender_system_id
set_extender_system_nameextender_system_id, extender_system_name
update_extender_system_strategyextender_system_id, extender_system_params
batch_add_extender_system_deviceextender_system_id, device_list
batch_del_extender_system_deviceextender_system_id, device_sn_list
get_strategy_last_recordextender_system_id, strategy_type

Strategy Model Fields

oilEngineSystemStatus, oilEngineStartCondition,
oilEngineStartSoc, oilEngineStartTime, oilEngineTargetSoc,
oilEngineWorkModeList: [{workMode, startTime, end_time}],
transactionId

Summary: Which endpoints to call BEFORE setting a value

Setting CategoryGET firstResponse tells youSET method
Power limitget_power_limit(16)min, max, step, legal_limitset_site_device_param(19)
Home loadget_device_home_loadmin_load, max_load, stepset_device_home_load
SOC reserveget_site_device_param(18)soc_list (available options)set_site_device_param(18)
Usage modeget_site_device_param(1-6)mode constraints, min/max_loadset_site_device_param / MQTT 005e
Country codeget_site_device_param(20)current countryset_site_device_param(20)
3rd-party PVget_site_device_param(26)pv_setting flagsset_site_device_param(26)
Peak shavingget_site_device_param(3)enable statusset_site_device_param
Dynamic pricedynamic_price/support_optionsupported optionssetDynamicPrice
Disaster prepcheck_functionfeature support flagsAPI set commands
LED modeMQTT status 0405current modeMQTT 0068
Temp unitMQTT status 0405current settingMQTT 0050
CutoffMQTT status 0405current valuesMQTT 0067
Max load (direct)get_power_limitpower_limit_optionMQTT 0080
Grid exportMQTT status 0405current flagMQTT 0080 (a5/a6)
PV limitget_device_attrspv_power_limit, legalset_device_attrs
Plug switchMQTT status 0405a4 switch stateMQTT 007a
Plug schedule(none — create directly)MQTT 007c
Plug timer(none — set directly)MQTT 007e
EV load balanceBLE prop_readcurrent configBLE prop_write_load_balancing
EV green energyBLE prop_readcurrent configBLE prop_write_green_energy_priority
EV RFIDBLE prop_readcard listBLE prop_write_rfid
Generator paramsBLE prop_readcurrent configBLE action_set_oil_machine_params
Backup strategy(via station config)branch prioritiesBLE action_set_backup_strategy
Heat pump(via station config)mode, timingAPI set_station_evchargers
Screen/DisplayBLE prop_readbrightness, timeoutBLE action_set_screen_*
AC/DC ports (PPS)BLE prop_readswitch statesBLE action_set_ac/bms/car_params
AS200 work modeBLE device infocurrent modeBLE action_set_system_params
AS200 power configBLE device infomode power, voltageBLE action_set_system_params
AS200 shutdownBLE device infotimeout, never flagBLE action_set_system_params
A7320 engine controlBLE device infoengine statusBLE writeProperty(engine_operation_control)
A7320 exercise/maintAPI get_device_exercise_detailsschedule, logsAPI set_oil_machine_exercise_plan
A7320 oil reminderAPI get_oil_consumption_reminder_plan_detailsintervalAPI set_oil_consumption_reminder_plan
A7320 RE strategyAPI get_strategy_last_recordstrategy_type, SOCAPI update_extender_system_strategy