Repository navigation
Capabilities
On the first refresh() the client asks the unit what it supports. Use the answer to show only the controls that make sense for that unit.
ac.refresh();
Capabilities caps = ac.getCapabilities();
Set<OperatingMode> modes = caps.supportedModes();
boolean silentFan = caps.supports(Capabilities.Feature.FAN_SILENT, false);
double[] heatRange = caps.temperatureLimits(OperatingMode.HEAT); // {16.0, 30.0} or null| Method | Returns |
|---|---|
isReceived() |
whether the unit answered the capability query at all |
get(Feature) |
Boolean, or null if the unit didn't mention it |
supports(Feature, default) |
the flag, or your default if not reported |
asMap() |
all reported flags |
supportedModes() |
modes the unit supports |
temperatureLimits(OperatingMode) |
{min, max} in Celsius, or null
|
supportedModes() counts a mode as supported unless the unit explicitly says it isn't. That's also how Home Assistant decides. FAN_ONLY is always included.
Units report separate set point ranges for cool, auto and heat. Dry and fan only use the cool range.
The client also applies the range for the current mode to AcState.getMinTemperature() and getMaxTemperature(). To override it, use DeviceConfig.Builder.temperatureRange(min, max).
| Feature | Meaning |
|---|---|
HEAT_MODE, COOL_MODE, DRY_MODE, AUTO_MODE
|
modes |
SWING_VERTICAL, SWING_HORIZONTAL
|
swing directions |
SWING_VERTICAL_ANGLE, SWING_HORIZONTAL_ANGLE
|
fixed louver positions |
FAN_SILENT, FAN_LOW, FAN_MEDIUM, FAN_HIGH, FAN_AUTO
|
fan steps |
FAN_CUSTOM |
stepless fan, use fanSpeedRaw()
|
ECO |
eco preset |
ANION |
ioniser |
TURBO_COOL, TURBO_HEAT
|
boost in cooling / heating |
DISPLAY_CONTROL |
display can be switched |
ENERGY_STATS, ENERGY_SETTING, ENERGY_BCD
|
energy reporting |
RATE_SELECT, RATE_SELECT_2_LEVEL, RATE_SELECT_5_LEVEL
|
power limit |
SOUND |
buzzer control |
HUMIDITY |
humidity sensor |
The raw capability values are small enums, not on/off flags. The decoding comes from midea-local, which took it from the msmart project. If a flag looks wrong for your unit, it probably is: the mapping is reverse engineered.
Next: Listeners and polling
midea-ac · MIT License · Protocol based on midea-local · Not affiliated with Midea