Skip to content

ashevchuk/midea-ac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

midea-ac

midea air conditioning smart network device remote control (without m-smart cloud)

an attempt to reverse engineer the air conditioning control protocol of the manufacturer midea (potentially of other brands. it is possible to identify such a device by using "NetHome" software). allows you to control the air conditioning smart device without using a m-smart cloud.

synopsis

./ac.pl --ip 192.168.1.2 --set --power on --mode cool --temp 20

  • --help brief help message

  • --ip device IP address or host name

  • --get fetch device settings

  • --set update device settings

  • --discover searches for compatible devices

  • --power turn power state: [on|off]

  • --temp set target temperature: [16..30]

  • --mode set operational mode: [auto|cool|dry|heat|fan]

  • --fan set fan speed: [auto|high|medium|low|silent]

  • --turbo turn turbo mode: [on|off]

  • --swing set swing mode: [off|vertical|horizontal|both]

  • --eco turn eco mode: [on|off]

  • --buzzer turn audible feedback: [on|off]

  • --value output of values alone

  • --begin beginning of the output string [default: none]

  • --end end of the output string [default: "\n"]

  • --quote use quotes [default: none]

  • --unquote_num do not use quotes for numbers

  • --separator field separator [default: ":"]

  • --delimiter fields delimiter [default: "\n"]

  • --exit exit code 0 if value ON, else exit code 1 [eco|led|error|turbo|buzzer|unit|power]

options

--help

Print a brief help message and exits.

--ip

IP address or host name of the device

--get

The operation of reading device parameters By default, all fields will be displayed

For example, you can display only one field (name with value) using the following arguments:

...--get --temp

Or display only the requested fields using the following arguments:

...--get --temp --mode --power

Or display only the value of the desired field, using the following arguments:

...--get --power --value

--set

The operation of writing device parameters

For example, you can turn on the device using the following arguments and their values:

...--set --power on

Or turn off the device using the following arguments and their values:

...--set --power off

Or at the same time as the device is turned on, set the parameters and modes of its operation, using the following arguments and their values:

...--set --power on --mode cool --swing off --fan auto --temp 20

Or simply change one of the parameters using the following arguments and their values:

...--set --temp 17

--power

The parameter controls the power state of the device

It can take one of the following values: [on|off]

--temp

The parameter controls the target temperature that the device will try to reach

It can take positive integer values from this range: [16..30]

--mode

The parameter controls the operation mode of the device

It can take one of the following values: [auto|cool|dry|heat|fan]

--fan

The parameter controls the operation mode of the device blower fan

It can take one of the following values: [auto|high|medium|low|silent]

--turbo

The parameter controls the turbo mode of the device

It can take one of the following values: [on|off]

--swing

The parameter controls the operation mode of the blinds of the device

It can take one of the following values: [off|vertical|horizontal|both]

--eco

The parameter controls the eco mode of the device

It can take one of the following values: [on|off]

--buzzer

The parameter controls the sound response mode of the device

It can take one of the following values: [on|off]

--value

Enables output of values alone, without field names

To output a simple array of values in JSON notation, use the following combination of arguments and their values:

...--begin "[" --end "]" --delimiter "," --quote "\"" --unquote_num --value

--begin

The string to be put at the beginning of the output

--end

The string to be put at the end of the output

--quote

Specifies the string that will be used at the beginning and at the end of each field name and the value itself individually

--unquote_num

Cancels the string that will be used at the beginning and at the end of each value if the value itself is a number

To display the output as formatted JSON, use the following combination of arguments and their values:

...--begin "{\n\t" --end "\n}\n" --delimiter ",\n\t" --quote "\"" --unquote_num

For unformatted JSON output, use the following combination of arguments and their values:

...--begin "{" --end "}" --delimiter "," --quote "\"" --unquote_num

--separator

The separator to be used between the name of the field and its value (tupple)

--delimiter

Separator to be used between tuples

--exit

The exit code will be used: if the specified parameter is set to ON, then the exit code will be 0, otherwise, the exit code will be 1

It can take one of the following values: [eco|led|error|turbo|buzzer|unit|power]

To check the power status of a device when used in third party scripts, use the following combination of arguments and their values:

...--exit power && echo "ac is on"

or

...--exit power || echo "ac is off"

--discover

Searches for compatible devices on the specified network

The network can take values in the form of:

single IP address:

...--discover --ip 192.168.1.1

network with mask:

...--discover --ip 192.168.1.0/255.255.255.0

network with mask length:

...--discover --ip 192.168.1.0/24

range of IP addresses:

...--discover --ip 192.168.1.1-192.168.1.8

For fast UDP broadcast searches, use the following parameters and their values:

...--discover --ip 255.255.255.255

Dependencies

CPAN modules

  • Crypt::Mode::ECB or openssl binary - selection will be made automatically depending on the availability of one of the options

Perl core modules

  • IO
  • POSIX
  • List::Util
  • Scalar::Util
  • Digest::MD5
  • Getopt::Long
  • Pod::Usage

About

midea air conditioning smart network device remote control (without m-smart cloud)

Topics

Resources

License

Stars

Watchers

Forks

Languages