Skip to content

Commit

Permalink
chore(doc): add get device type and sn in debug doc (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao authored Jan 22, 2025
1 parent 2784afb commit 81a0c1b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
21 changes: 20 additions & 1 deletion doc/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
1. Install Add-on `[Advanced SSH & Web Terminal]` and disable `[Protected Mode]` once it done, you can ssh to your HAOS
2. 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.
## Debug log

you can use below two methods to enable debug log.
Expand Down Expand Up @@ -66,7 +68,7 @@ if you need to manual edit or change source code in `midea_ac_lan` for test purp

### edit `midealocal` source code

`midealocal` is a python3 pip package, and it will be installed in HA core (a docker container in HAOS).
`midealocal` is a python3 pip package, it has been installed in HA Core,and HA Core is a docker container in HAOS.

1. ssh login to your HAOS
2. enter HA Core docker in HAOS: `docker exec -it homeassistant /bin/bash`
Expand Down Expand Up @@ -96,3 +98,20 @@ you can use below command to get a device json config:

> 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.

## Get Device type and SN

`midealocal` is a python3 pip package, it has been installed in HA Core,and HA Core is a docker container in HAOS.

1. ssh login to your HAOS
2. enter HA Core docker in HAOS: `docker exec -it homeassistant /bin/bash`
3. 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:

```shell
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.
21 changes: 20 additions & 1 deletion doc/debug_hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
1. 安装 Add-on `[Advanced SSH & Web Terminal]` ,并禁用保护模式 `[Protected Mode]`
2. 使用任意SSH终端软件(或者HA Web UI中使用 `[Advanced SSH & Web Terminal]` add-on)

> 禁用保护模式 `[Protected Mode]`后才能在HAOS中使用docker命令显示和操作HA Core docker container.
## 调试日志Debug Log

以下二种方法都可以打开调试日志Debug Log, 推荐使用修改`configuration.yaml`并重启HA的方法.
Expand Down Expand Up @@ -65,7 +67,7 @@

### 修改`midealocal`源代码

`midealocal`是python3的pip package, 安装是HA core 中,(属于HAOS里面运行的一个docker container).
`midealocal`是python3的pip package, 安装在HA core 中,而HA Core则属于HAOS里面运行的一个docker container.

1. SSH登录HAOS
2. 在HAOS中执行如下命令进入HA Core所在的docker: `docker exec -it homeassistant /bin/bash`
Expand Down Expand Up @@ -93,3 +95,20 @@
3. 可以使用`ls`命令查看所有文件,可以使用`cat xxx.json`查看某个设备的配置信息,xxx为设备虚拟ID.

> 如无特殊或者异常情况,一般不建议操作该文件。如需操作,可重命名备份该文件配置文件

## 获取设备类型和SN

`midealocal`是python3的pip package, 安装在HA core 中,而HA Core则属于HAOS里面运行的一个docker container.

1. SSH登录HAOS
2. 在HAOS中执行如下命令进入HA Core所在的docker: `docker exec -it homeassistant /bin/bash`
3. 在HA Core的shell中执行如下命令来获取设备类型和SN: `python3 -m midealocal.cli discover --get_sn --host 192.168.2.127` (请替换示例命令中的IP为你的设备IP).

执行以上命令的输出如下:

```shell
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}}
```

请提供设备实际输出的内容, debug时需使用以上信息来确认设备的类型,协议,SN等.

0 comments on commit 81a0c1b

Please sign in to comment.