The topic has been raised repeatedly, and there are even solutions, but I will tell you about one more thing. Looking through one of the most popular online sites, I came across a device that I hadn’t known before, Broadlink RM Mini 3. The price at that time was $ 9.90. Which is much cheaper than analogs. But there were also disadvantages about which below.

The device is a cylinder, in the upper part of which 360 degrees IR-sensors are located. Device management occurs through the application. You can control any equipment with an IR receiver. But my goal was one, control the air conditioner. To come home, he has already managed to create a comfortable temperature.
')
My first problem was that my air conditioner did not perceive the commands downloaded automatically from the server after learning the device. Everything was decided by manual adjustment of the console, this feature is present in the program. But it wasn’t all, the next thing I understood was that some commands, for example, changing the fan speed also contains the temperature. It turned out that if I changed the fan rotation speed, then the temperature, which was during the training of the device, also changed.
The next thing it turned out, the application does not see the device through the VPN. In an Android application, the device is automatically detected and also finds it on the network; you cannot select an address manually.
The following is not critical, but a nuance, management via the Internet occurs using the manufacturer’s cloud service. Although the application and the device communicated directly in the local network, someone did not want to give control over the Internet. No open API exists.
Using sniffing traffic on a WiFi router, it turned out that the application and the device communicate with each other UDP packets on port 80.
tcpdump -w /tmp/dump.cap host <ip >

It was decided to make a console on a local web server to control the air conditioner. From the beginning we create a remote control in the corporate application:

Then we start the sniffer and start to slowly execute all the commands. Stopping the sniffer and making sure that the number of packages corresponds to the number of commands executed, copy them into the web application. The only tedious thing was to memorize the temperature at different speeds of rotation. It turned out the following:

Then I closed the device access to the Internet.
All code is posted on
GitHub