niceboygithub / AqaraGateway

Aqara Gateway/Hub integration for Home Assistant
523 stars 66 forks source link

temperature of aqara.tow_w.acn001 was sacled by 100 #167

Closed Necroneco closed 1 year ago

Necroneco commented 1 year ago

Hello, I found the temperature of this device was scaled by 100

 2023-02-12 10:19:54 ... aqara.tow_w.acn001 <= {'temperature': 0.26} [1676168394.21824]
 2023-02-12 10:20:00 ... aqara.tow_w.acn001 <= {'temperature': 0.27} [1676168400.6422577]
 2023-02-12 10:20:07 ... aqara.tow_w.acn001 <= {'temperature': 0.29} [1676168407.7392]
 2023-02-12 10:20:08 ... aqara.tow_w.acn001 <= {'temperature': 0.28} [1676168408.4797862]
 2023-02-12 10:20:17 ... aqara.tow_w.acn001 <= {'temperature': 0.29} [1676168417.7577786]
 2023-02-12 10:20:23 ... aqara.tow_w.acn001 <= {'temperature': 0.3} [1676168423.831313]
 2023-02-12 10:20:28 ... aqara.tow_w.acn001 <= {'temperature': 0.31} [1676168428.5194535]
 2023-02-12 10:20:36 ... aqara.tow_w.acn001 <= {'temperature': 0.33} [1676168436.119995]
 2023-02-12 10:20:48 ... aqara.tow_w.acn001 <= {'temperature': 0.35} [1676168448.5035417]
 2023-02-12 10:20:49 ... aqara.tow_w.acn001 <= {'temperature': 0.33} [1676168449.7887335]

how to adapt it?

niceboygithub commented 1 year ago

in line 655 of custom_components/aqara_gateway/core/gateway.py modify it as following

if device['model'] in ('lumi.airmonitor.acn01', 'aqara.tow_w.acn001') and self.cloud == 'miot':
Necroneco commented 1 year ago

I tried it, found self.cloud is 'aiot' ...

changed it as following works fine

if device['model'] == 'lumi.airmonitor.acn01' and self.cloud == 'miot' or device['model'] == 'aqara.tow_w.acn001':