Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for lumi Zigbee AC controller model KTWKQ03ES #101

Closed
ptbsare opened this issue Nov 10, 2020 · 31 comments
Closed

Add support for lumi Zigbee AC controller model KTWKQ03ES #101

ptbsare opened this issue Nov 10, 2020 · 31 comments
Labels
enhancement New feature or request

Comments

@ptbsare
Copy link

ptbsare commented Nov 10, 2020

DeepinScreenshot_select-area_20201110112242

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

This model works with the xiaomi gateway 3 in mihome app.

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

Screenshot_2020-11-10-12-03-04-694_com taobao idlefish
Screenshot_2020-11-10-12-03-34-863_com taobao idlefish
Screenshot_2020-11-10-12-04-19-776_com xiaomi smarthome
Screenshot_2020-11-10-12-04-21-822_com xiaomi smarthome

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 10, 2020

Please enable debug mode (debug: mqtt), read readme. Interact with device, change modes. And show logs (not a picture).

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

HI, THANKS for your response,
I think someone has already tried that:

some useful links:

Koenkk/zigbee2mqtt#3306

https://zigbee2mqtt.discourse.group/t/support-eigenstone-thermostat-s2-ktwkq03es/1099/2

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

I will post my logs later.

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

I tried power off/on
adjust tempreture 30°C to 22°C
adjust fan speed: auto ->low->medium->high->auto
adjust mode : cool->heating->cool
here are the logs:

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

2020-11-10 12:38:20  DEBUG    gateway3      192.168.195.181 | lumi.158d0004054c4f has an unsupported modell: lumi.airrtc.tcpecn02
2020-11-10 12:39:06  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"read","did":"lumi.158d0004054c4f","id":603,"params":[{"res_name":"14.2.85"}],"source":"","time":1604983145217}
2020-11-10 12:39:06  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983145333,"rssi":-40,"params":[{"res_name":"14.2.85","value":288366197},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:39:08  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":604,"params":[{"res_name":"3.1.85","value":0}],"source":"","time":1604983147313}
2020-11-10 12:39:08  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":604,"time":1604983147317,"did":"lumi.158d0004054c4f","results":[{"res_name":"3.1.85","value":0,"error_code":0}]}
2020-11-10 12:39:08  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":604,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983147396,"rssi":-40,"params":[{"res_name":"14.2.85","value":268435455},{"res_name":"14.8.85","value":15},{"res_name":"14.9.85","value":255},{"res_name":"14.10.85","value":15},{"res_name":"3.2.85","value":63},{"res_name":"3.1.85","value":0}]}
2020-11-10 12:39:09  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983147669,"rssi":-40,"params":[{"res_name":"14.2.85","value":19930740},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":0}]}
2020-11-10 12:40:32  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":605,"params":[{"res_name":"3.1.85","value":1}],"source":"","time":1604983230551}
2020-11-10 12:40:32  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":605,"time":1604983230556,"did":"lumi.158d0004054c4f","results":[{"res_name":"3.1.85","value":1,"error_code":0}]}
2020-11-10 12:40:32  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":605,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983230647,"rssi":-44,"params":[{"res_name":"14.2.85","value":536870911},{"res_name":"14.8.85","value":15},{"res_name":"14.9.85","value":255},{"res_name":"14.10.85","value":15},{"res_name":"3.2.85","value":63},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:40:32  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983231045,"rssi":-40,"params":[{"res_name":"14.2.85","value":285220469},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":0},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:40:39  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983238014,"rssi":-40,"params":[{"res_name":"14.2.85","value":288366197},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:40:50  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"heartbeat","id":2000013623,"time":1604983248832,"rssi":-40,"params":[{"did":"lumi.158d0004054c4f","time":1604983248832,"res_list":[{"res_name":"8.0.2006","value":33},{"res_name":"8.0.2002","value":8},{"res_name":"8.0.2022","value":30},{"res_name":"8.0.2023","value":49},{"res_name":"14.2.85","value":288366197}]}]}
2020-11-10 12:40:53  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"read","did":"lumi.158d0004054c4f","id":606,"params":[{"res_name":"14.2.85"}],"source":"","time":1604983251693}
2020-11-10 12:40:53  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983251799,"rssi":-40,"params":[{"res_name":"14.2.85","value":288366197},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:40:58  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":607,"params":[{"res_name":"14.2.85","value":288364149}],"source":"","time":1604983256904}
2020-11-10 12:40:58  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":607,"time":1604983256909,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":288364149,"error_code":0}]}
2020-11-10 12:40:58  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":607,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983257002,"rssi":-44,"params":[{"res_name":"14.2.85","value":288364149},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:40:58  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983257483,"rssi":-40,"params":[{"res_name":"14.2.85","value":288364149},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:02  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":608,"params":[{"res_name":"14.2.85","value":285218421}],"source":"","time":1604983260562}
2020-11-10 12:41:02  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":608,"time":1604983260570,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":285218421,"error_code":0}]}
2020-11-10 12:41:02  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":608,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983260653,"rssi":-40,"params":[{"res_name":"14.2.85","value":285218421},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":0},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:03  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":609,"params":[{"res_name":"14.2.85","value":286266997}],"source":"","time":1604983262375}
2020-11-10 12:41:03  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":609,"time":1604983262381,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":286266997,"error_code":0}]}
2020-11-10 12:41:03  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":609,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983262471,"rssi":-44,"params":[{"res_name":"14.2.85","value":286266997},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":1},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:04  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":610,"params":[{"res_name":"14.2.85","value":287315573}],"source":"","time":1604983263466}
2020-11-10 12:41:04  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":610,"time":1604983263471,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":287315573,"error_code":0}]}
2020-11-10 12:41:05  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":610,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983263658,"rssi":-44,"params":[{"res_name":"14.2.85","value":287315573},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":2},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:05  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":611,"params":[{"res_name":"14.2.85","value":288364149}],"source":"","time":1604983264377}
2020-11-10 12:41:05  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":611,"time":1604983264383,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":288364149,"error_code":0}]}
2020-11-10 12:41:05  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":611,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983264495,"rssi":-40,"params":[{"res_name":"14.2.85","value":288364149},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:08  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":612,"params":[{"res_name":"14.2.85","value":271586933}],"source":"","time":1604983267248}
2020-11-10 12:41:08  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":612,"time":1604983267255,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":271586933,"error_code":0}]}
2020-11-10 12:41:08  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":612,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983267344,"rssi":-40,"params":[{"res_name":"14.2.85","value":271586933},{"res_name":"14.8.85","value":0},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:09  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983267945,"rssi":-40,"params":[{"res_name":"14.2.85","value":271586935},{"res_name":"14.8.85","value":0},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:10  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":613,"params":[{"res_name":"14.2.85","value":288364149}],"source":"","time":1604983268539}
2020-11-10 12:41:10  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"write_rsp","id":613,"time":1604983268548,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":288364149,"error_code":0}]}
2020-11-10 12:41:10  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":613,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983268624,"rssi":-40,"params":[{"res_name":"14.2.85","value":288364149},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-10 12:41:10  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1604983269361,"rssi":-40,"params":[{"res_name":"14.2.85","value":288364151},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":22},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

There are 3 similar models on the market:
KTWKQ01ES
KTWKQ02ES
KTWKQ03ES
I assume that they use the same firmware.

@ptbsare
Copy link
Author

ptbsare commented Nov 10, 2020

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 10, 2020

Property 14.2.85 has some encoded AC state. You need to match the exact settings of the AC with each value of this property.

3.1.85 - power_status

@ptbsare
Copy link
Author

ptbsare commented Nov 11, 2020

hi, each time I adjust it with mihome app, a writ_rsp comand is sent after a write command is recieved:

[MQ] zigbee/recv {"cmd":"write","did":"lumi.158d0004054c4f","id":330,"params":[{"res_name":"14.2.85","value":xxxxxxxxx}],"source":"","time":1605106734489}
zigbee/send {"cmd":"write_rsp","id":332,"time":1605106977123,"did":"lumi.158d0004054c4f","results":[{"res_name":"14.2.85","value":xxxxxxxxx,"error_code":0}]}

the value of "14.2.85" are as below:

fan_speed:auto/low/medium/high
target_temp:17-30
mode: cool/heat
[{"res_name":"14.2.85","value":285220469}] set to: low 30 cool
[{"res_name":"14.2.85","value":286269045}] set to: medium 30 cool
[{"res_name":"14.2.85","value":287317621}] set to: high 30 cool
[{"res_name":"14.2.85","value":288366197}] set to: auto 30 cool
[{"res_name":"14.2.85","value":268443253}] set to: low 30 heat
[{"res_name":"14.2.85","value":269491829}] set to: medium 30 heat
[{"res_name":"14.2.85","value":270540405}] set to: high 30 heat
[{"res_name":"14.2.85","value":271588981}] set to: auto 30 heat
[{"res_name":"14.2.85","value":271586677}] set to: auto 21 heat
[{"res_name":"14.2.85","value":288363893}] set to: auto 21 cool
[{"res_name":"14.2.85","value":285218165}] set to: low 21 cool
[{"res_name":"14.2.85","value":286266741}] set to: medium 21 cool
[{"res_name":"14.2.85","value":287315317}] set to: high 21 cool
[{"res_name":"14.2.85","value":287316341}] set to: high 25 cool

some other actions:

[{"res_name":"14.2.85","value":18880885}] from poweron high 25 cool to poweroff
[{"res_name":"14.2.85","value":287316341}] from poweroff to poweron high 25 cool
[{"res_name":"14.2.85","value":287317621}] set to high 30 cool
[{"res_name":"14.2.85","value":18882165}] from poweron high 30 cool to poweroff
[{"res_name":"14.2.85","value":287317621}] from poweroff to poweron high 30 cool

state report(power on,high fan speed,target temperature 30,current temperature 29,cool):

2020-11-11 23:16:59  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0x6F5E","eui64":"0x00158D0004054C4F","destinationEndpoint":"0x01","clusterId":"0x0000","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xEF","APSPlayload":"0x1C5F116E0AF0FF410CAA8008CE870F8523751E3011","rssi":-44,"linkQuality":224}
2020-11-11 23:16:59  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1605107818772,"rssi":-44,"params":[{"res_name":"14.2.85","value":288366197},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":1}]}
2020-11-11 23:16:59  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0x6F5E","eui64":"0x00158D0004054C4F","destinationEndpoint":"0x01","clusterId":"0x0000","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xF0","APSPlayload":"0x1C5F116F0A00F023005E6F03","rssi":-44,"linkQuality":224}
2020-11-11 23:16:59  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0x638B","eui64":"0x00158D0002C7A097","destinationEndpoint":"0x01","clusterId":"0x000A","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x0A","APSPlayload":"0x1079000000","rssi":-53,"linkQuality":188}

state report(power off,high fan speed,target temperature 30,current temperature 29,cool):

2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":345,"did":"lumi.158d0004054c4f","dev_src":"0","time":1605108339979,"rssi":-42,"params":[{"res_name":"14.2.85","value":18882165},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":2},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":0}]}
2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0xA3E4","eui64":"0x00158D00037391A9","destinationEndpoint":"0x01","clusterId":"0x000A","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x56","APSPlayload":"0x1087000000","rssi":-52,"linkQuality":192}
2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | lumi.158d00037391a9 <= LQI 192
2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessagePreSentCallback {"eui64":"0x00158D00037391A9","destinationEndpoint":"0x01","clusterId":"0x000A","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x00","APSPlayload":"0x188701000000E2702F3F27"}
2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0x6F5E","eui64":"0x00158D0004054C4F","destinationEndpoint":"0x01","clusterId":"0x0000","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x11","APSPlayload":"0x1C5F11710AF0FF410CAA8008CE870F8523741E3001","rssi":-44,"linkQuality":224}
2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | [MQ] zigbee/send {"cmd":"report","id":65,"did":"lumi.158d0004054c4f","dev_src":"0","time":1605108340360,"rssi":-44,"params":[{"res_name":"14.2.85","value":19930740},{"res_name":"14.8.85","value":1},{"res_name":"14.9.85","value":30},{"res_name":"14.10.85","value":3},{"res_name":"3.2.85","value":29},{"res_name":"3.1.85","value":0}]}
2020-11-11 23:25:40  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0x6F5E","eui64":"0x00158D0004054C4F","destinationEndpoint":"0x01","clusterId":"0x0000","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x12","APSPlayload":"0x1C5F11720A00F02300000007","rssi":-44,"linkQuality":224}
2020-11-11 23:25:41  DEBUG    gateway3      192.168.195.181 | [MQ] gw/842E14FFFE1504A0/MessageReceived {"sourceAddress":"0x7056","eui64":"0x00158D00041F1E28","destinationEndpoint":"0x01","clusterId":"0x000A","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x11","APSPlayload":"0x1047000000","rssi":-42,"linkQuality":232}

@AlexxIT AlexxIT added the enhancement New feature or request label Nov 18, 2020
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 18, 2020

Also link with some info https://sprut.ai/client/article/1937

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 18, 2020

@ptbsare please check if I right

  • 3.1.85, power, 0 = off, 1 = on
  • 3.2.85, current temperature
  • 14.8.85, mode, 1 = cool, other values?
  • 14.9.85, target temperature
  • 14.10.85, fan speed, 0 - low, 1 - medium, 2 - high, 3 - auto ?

@ptbsare
Copy link
Author

ptbsare commented Nov 19, 2020

@ptbsare please check if I right

  • 3.1.85, power, 0 = off, 1 = on
  • 3.2.85, current temperature
  • 14.8.85, mode, 1 = cool, other values?
  • 14.9.85, target temperature
  • 14.10.85, fan speed, 0 - low, 1 - medium, 2 - high, 3 - auto ?
  • 3.1.85, power, 0 = off, 1 = on ---correct
  • 3.2.85, current temperature ---correct
  • 14.8.85, mode, 1 = cool, 0 = heat
  • 14.9.85, target temperature ---correct
  • 14.10.85, fan speed, 0 - low, 1 - medium, 2 - high, 3 - auto ---correct
    @AlexxIT

AlexxIT added a commit that referenced this issue Nov 24, 2020
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 24, 2020

Hi. Try latest master version. It can be installed via HACS.
I'm not sure I did everything right.
I am taking the current state from 3.1.85, 3.2.85, 14.8.85, 14.9.85, 14.10.85
And change state from HA with 14.2.85
Also show Retain line from logs.

@ptbsare
Copy link
Author

ptbsare commented Nov 25, 2020

Tested, It works like a charm!
NIce job done!!
Thanks.
DeepinScreenshot_select-area_20201125171732
DeepinScreenshot_select-area_20201125171715

@ptbsare ptbsare closed this as completed Nov 25, 2020
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 25, 2020

Wow. I don't expect it will work in first release.
Also show Retain line from logs.
For restore attributes after restart HA.

@ptbsare ptbsare reopened this Dec 9, 2020
@ptbsare
Copy link
Author

ptbsare commented Dec 9, 2020

2020-12-09 17:58:59  DEBUG    gateway3      192.168.195.181 | lumi.158d0004054c4f lumi.airrtc.tcpecn02 retain: {'ac_state': '288365149', 'ac_status': '', 'alive': 1, 'co2': 0, 'com_cfg': '00070003', 'fw_ver': 30, 'hw_ver': 49, 'power_status': 'on'}

@AlexxIT This is the retain line from log.
I found that the states are not restored for a while after HA restarts

@ptbsare
Copy link
Author

ptbsare commented Dec 17, 2020

@AlexxIT From the Log I can see that the Ac state (mode, target temperature, fan speed.etc) is wrong when the power is off, which may cause mqtt server crashs. When the power is on , the reported ac state is OK.

@ptbsare
Copy link
Author

ptbsare commented Dec 17, 2020

related to issue #111
It may be related to the wrongly decoded ac state (

res_name":"14.2.85","value":268435455
lumi.158d0004054c4f lumi.airrtc.tcpecn02 <= {'climate': 268435455, 'mode': 15, 'target_temperature': 255, 'fan_mode': 15, 'current_temperature': 63, 'power': 0}
 | MQTT disconnected

)

when the power is off, which results mqtt server crashs and it never connects back. I guess.

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 17, 2020

@ptbsare check latest master version. There is a check for errors. It will not fall and show the cause of the problem.

@ptbsare
Copy link
Author

ptbsare commented Dec 17, 2020

@AlexxIT

Logger: custom_components.xiaomi_gateway3.climate
Source: custom_components/xiaomi_gateway3/climate.py:85
Integration: Xiaomi Gateway 3 (documentation)
First occurred: 下午4:52:29 (1 occurrences)
Last logged: 下午4:52:29

Can't read climate data: {'climate': 268435455, 'mode': 15, 'target_temperature': 255, 'fan_mode': 15, 'current_temperature': 63, 'power': 0}
Traceback (most recent call last):
  File "/config/custom_components/xiaomi_gateway3/climate.py", line 85, in update
    self._hvac_mode = HVAC_MODES[data['mode']]
IndexError: list index out of range

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 17, 2020

Fixed in latest master

@ptbsare
Copy link
Author

ptbsare commented Dec 25, 2020

Fixed.

@ptbsare ptbsare closed this as completed Dec 25, 2020
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 25, 2020

I don't fix retain yet

@AlexxIT AlexxIT reopened this Dec 25, 2020
@ptbsare
Copy link
Author

ptbsare commented Jan 11, 2021

@AlexxIT Zigbee AC controller model KTWKQ03ES
The device control works perfectly nowadays. The problem is that when I include this AC controller (climate) in a scene (such as called "people away home") in which this Ac controller's running mode should be set to 'off' without setting a target temperature (in fact I can not set a target temperature when the running mode is off), I can NOT activate the scene because it throwed out the following error:

Can not activate the scene, expected float for dictionary value @ data['temperature']

Other AC ac controllers (not zigbee) in the same scene do not have this issue.
Full error logs when activating the scene are as below:

[140112359292736] expected float for dictionary value @ data['temperature']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/scene.py", line 311, in async_activate
    await async_reproduce_state(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 106, in async_reproduce_state
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 100, in worker
    await platform.async_reproduce_states(  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 83, in async_reproduce_states
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 60, in _async_reproduce_states
    await call_service(
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 45, in call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1399, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 218, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 341, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 337, in _exec
    v = func(v)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 215, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 341, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 339, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected float for dictionary value @ data['temperature']

@ptbsare
Copy link
Author

ptbsare commented Jan 11, 2021

7e5fb98#diff-b588a5a8348e2c9dd93959afa76d67083a64d8fa18350c59d702eb1d6a61a0edR98

Instead of setting target_temp to none, setting a numerical value from AC state retain should fix the problem. or just setting that to the default 26°C when power is off should also fix it.

AlexxIT added a commit that referenced this issue Jan 11, 2021
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 11, 2021

@ptbsare can you show retain line from logs for power off device?

@ptbsare
Copy link
Author

ptbsare commented Jan 11, 2021

@AlexxIT

2021-01-11 23:57:57  DEBUG    gateway3      192.168.195.181 | lumi.158d0004054c4f lumi.airrtc.tcpecn02 retain: {'ac_state': '19929668', 'ac_status': '', 'alive': 1, 'co2': 0, 'com_cfg': '00070003', 'fw_ver': 30, 'hw_ver': 49, 'power_status': 'off'}

powered off from 26°C cool auto fan speed

@ptbsare
Copy link
Author

ptbsare commented Jan 14, 2021

Can confirm that latest master fixed the issue and retain also works. Thanks. I think this should be closed now.

@AlexxIT AlexxIT closed this as completed Jan 14, 2021
@bluefoxlee
Copy link
Contributor

bluefoxlee commented Mar 6, 2021

There are 3 similar models on the market:
KTWKQ01ES
KTWKQ02ES
KTWKQ03ES
I assume that they use the same firmware.

It seems Xiaomi have dropped KTWKQ01ES (lumi.ctrl_hvac.es1) support.
Only KTWKQ02ES (lumi.airrtc.tcpecn02) and KTWKQ03ES (lumi.airrtc.tcpecn02) are supported and can find within MIOT-Spec. That explains why it can't finish the pair process with Gateway V3 (and M1s I spouse).

== Edit ==
The list of Aqara thermostat from Aqara OpenDoc:

  • Lumi.ctrl_hvac.aq1
  • Lumi.airrtc.pcacn2 - MIOT
  • Lumi.airrtc.tcpco2ecn01 - MIOT
  • Lumi.airrtc.tcpecn02 - MIOT
  • Lumi.airrtc.tcpecn01 - MIOT
  • Lumi.ctrl_hvac.v1
  • Lumi.ctrl_hvac.es1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants