- Install Add-on
[Advanced SSH & Web Terminal]
and disable[Protected Mode]
once it done, you can ssh to your HAOS - Use any SSH Terminal software (or HA
[Advanced SSH & Web Terminal]
add-on web UI)
disable
[Protected Mode]
can show HA Core docker container with docker command.
you can use below two methods to enable debug log.
edit configuration.yaml
and reboot HA is the recommended method.
-
SSH Login to your HA device
-
cd /config/
-
Add below lines to your
configuration.yaml
, for examplevi configuration.yaml
logger: default: warn logs: custom_components.midea_ac_lan: debug midealocal: debug
we should enable
midea_ac_lan
andmidealocal
-
Restart HA
-
Trigger debug log with some action with bug or error
-
Download full debug log file via HA web UI (
Settings --> System --> Logs
)
-
Login to your HA Web UI
-
Goto
Developer Tools
->Actions
-> selectLogger: Set Log Level
->GO TO YAML MODE
-
Paste below yaml content to the form,and run
action: logger.set_level data: custom_components.midea_ac_lan: debug midealocal: debug
Tips: this mode doesn't require reboot, but it can't capture device startup error log, so is still recommended to edit
configuration.yaml
file to enable debug mode. -
Trigger debug log with some action with bug or error
-
Download full debug log file via HA web UI (
Settings --> System --> Logs
)
if you need to manual edit or change source code in midea_ac_lan
for test purpose, follow below steps:
-
SSH login to your HAOS
-
switch to
midea_ac_lan
root directory with command:cd /config/custom_components/midea_ac_lan
-
now you can manual edit source code with
vi
, orscp
to upload file, orwget
to download github raw file. -
once you upload or download a new file to HA, replace the old source code to new one.
-
reboot HA to load it.
for example: there is a github PR exist, and we should manual update
light.py
, we can got github raw file URL, and use belowwget
command with-O light.py
to download latest file and overwrite existlight.py
>wget https://github.com/wuwentao/midea_ac_lan/raw/xxxx/custom_components/midea_ac_lan/light.py -O light.py
midealocal
is a python3 pip package, it has been installed in HA Core,and HA Core is a docker container in HAOS.
- ssh login to your HAOS
- enter HA Core docker in HAOS:
docker exec -it homeassistant /bin/bash
- get
midealocal
install path withpip show midea-local
, it will show path info to you, for example, my location is Location:/usr/local/lib/python3.13/site-packages
- switch to
midealocal
root path withcd /usr/local/lib/python3.13/site-packages/midealocal/
- now you can manual edit all the source code with
vi
, orscp
to upload file, orwget
to download file. - once you upload or download a new file to HA, replace the old source code file to new file.
- reboot HA to load it
/config
path will be available in both HAOS and HA Core, you can transfer/share file with it.
for example: there is a github PR exist, and we should manual update devices/cd/message.py
got github raw file URL, and use below
wget
command with-O devices/cd/message.py
to download latest file and overwrite existdevices/cd/message.py
>wget https://github.com/midea-lan/midea-local/raw/xxxx/midealocal/devices/cd/message.py -O devices/cd/message.py
When a device is added successfully, midea_ac_lan
will save this device config to HA storage.
we will use this config file to prevent add this device for multiple times.
in addition, if you removed this device from Web UI, we still can use this config file for future device add with cloud login.
you can use below command to get a device json config:
- SSH login to your HAOS
- switch to json config root dir:
cd /config/.storage/midea_ac_lan
- use
ls
to check file list,and usecat xxx.json
to show a device json config,xxx
is device id.
if there is no any error exist, please don't remove or edit this file. if you want to change it, you can rename and backup it.
midealocal
is a python3 pip package, it has been installed in HA Core,and HA Core is a docker container in HAOS.
- ssh login to your HAOS
- enter HA Core docker in HAOS:
docker exec -it homeassistant /bin/bash
- run below command to get device type and device SN in HA Core shell
python3 -m midealocal.cli discover --get_sn --host 192.168.2.127
(replace the example ip address to your device IP).
output example:
2025-01-21 18:06:33.552 INFO (MainThread) [cli] Found 1 devices.
2025-01-21 18:06:33.552 INFO (MainThread) [cli] Found devices: {193514046726897: {'device_id': 193514046726897, 'type': 176, 'ip_address': '192.168.2.127', 'port': 6444, 'model': '0TG025JG', 'sn': 'xxxx', 'protocol': 3}}
post these output to us, it's a important debug info for your device, we can confirm with your device type/SN/protocol for debug purpose.