Skip to content

Command Line Tool

Niklas Linz edited this page Oct 3, 2026 · 1 revision

Command line tool

The jar doubles as a small command line tool, mainly for setup and quick tests.

java -jar midea-ac-1.0.0.jar <command> [options]

Commands

Command What it does
discover lists air conditioners on the LAN
keys --ip IP asks one unit directly, fetches its token and key and checks them
status --ip IP --id ID ... prints the full status and the capabilities
set --ip IP --id ID ... key=value ... changes settings in one command
watch --ip IP --id ID ... polls and prints every update until you stop it

Options

Option Default
--ip address of the unit
--id device id
--protocol 3 2 or 3
--port 6444
--token, --key required for V3
--cloud shared account msmart, nethome or mideaair, for keys
--user, --password cloud login, with --cloud
--interval 30 seconds between refreshes, for watch
--beep true false keeps the unit quiet
--debug prints every frame sent and received

set values

Key Values
power on, off
mode auto, cool, dry, heat, fan_only
temp 16 to 31.5
fan silent, low, medium, high, full, auto
swing off, vertical, horizontal, both
preset none, comfort, eco, boost, sleep, away

Everything goes out as one command. set reads the status first, so it takes about as long as status.

Examples

All examples use placeholder values.

# find units
java -jar midea-ac-1.0.0.jar discover

# get token and key with your MSmartHome account
java -jar midea-ac-1.0.0.jar keys --ip 192.168.1.50 --cloud msmart --user you@example.com --password secret

# status
java -jar midea-ac-1.0.0.jar status --ip 192.168.1.50 --id 151732605161920 --token 4b2f... --key 9a1c...

# switch on, cool to 25
java -jar midea-ac-1.0.0.jar set --ip 192.168.1.50 --id 151732605161920 --token 4b2f... --key 9a1c... power=on mode=cool temp=25

# switch off without beeping
java -jar midea-ac-1.0.0.jar set --ip 192.168.1.50 --id 151732605161920 --token 4b2f... --key 9a1c... --beep false power=off

Tip: passwords and tokens given on the command line end up in your shell history. Clear the line afterwards, or use environment variables in your own code instead.

Next: How it behaves

Clone this wiki locally