AlexxIT / XiaomiGateway3

Home Assistant custom component for control Xiaomi Multimode Gateway (aka Gateway 3), Xiaomi Multimode Gateway 2, Aqara Hub E1 on default firmwares over LAN
https://github.com/AlexxIT/Blog
MIT License
2.39k stars 331 forks source link

Aqara M1S gateway support #146

Open Mantoui opened 3 years ago

Mantoui commented 3 years ago

test chang:

'lumi.gateway.acn01': ["Aqara", "Gateway M1S", "ZHWG15LM"],

def is_gw3(host: str, token: str) -> Optional[str]: try: device = Device(host, token) info = device.info() if info.model != 'lumi.gateway.mgl03' and info.model != 'lumi.gateway.acn01': raise Exception(f"Wrong device model: {info.model}") except Exception as e: return str(e) return None

log:

2020-12-21 15:53:25 DEBUG gateway3 10.2.0.103 | Try enable telnet 2020-12-21 15:53:25 DEBUG gateway3 10.2.0.103 | Prepare Gateway 2020-12-21 15:53:25 DEBUG gateway3 Can't read devices: 'NoneType' object is not subscriptable 2020-12-21 15:53:25 DEBUG gateway3 10.2.0.103 | Prepare Gateway 2020-12-21 15:53:25 DEBUG gateway3 Can't read devices: 'NoneType' object is not subscriptable 2020-12-21 15:53:25 DEBUG gateway3 10.2.0.103 | Prepare Gateway 2020-12-21 15:53:25 DEBUG gateway3 Can't read devices: 'NoneType' object is not subscriptable 2020-12-21 15:53:25 DEBUG gateway3 10.2.0.103 | Prepare Gateway 2020-12-21 15:53:25 DEBUG gateway3 Can't read devices: 'NoneType' object is not subscriptable

telnet is open now

# cat coordinator.info {"sdkVer":"1.3.33","manufacturer":"NXP","manuCode":"0x126e","mac":"0x04cf8cdf3c7f****","channel":15,"panId":"0x597b","coorVer":"5.09","cloudLink":1,"timeZone":8,"preLeave":0,"debugStatus":0}

Mantoui commented 3 years ago

# ls bin data dev etc home init lib mnt proc sys tmp usr var # ls data/ alarm mha_master musics utils zoneinfo firmware.bin miio storage zigbee # ls data/zigbee/ 158d00020189a4.data device.info updateManuCode.log coordinator.info miio.info # ls data/mha_master/ device_properties.json lumi.158d00020189a4.json # cat data/mha_master/lumi.158d00020189a4.json { "lumi.158d00020189a4.mac": "158d00020189a4", "lumi.158d00020189a4.model": "lumi.weather.v1", "lumi.158d00020189a4.prop": "{\"props\":{\"CCA\":1,\"alive\":1,\"battery\":69,\"battery_end_of_life\":0,\"chip_temperature\":0,\"cur_state\":1,\"fw_ver\":0,\"humidity\":2864,\"hw_ver\":0,\"lqi\":0,\"power_tx\":10,\"pre_state\":0,\"pressure\":100900,\"pv_state\":0,\"reset_cnt\":9,\"send_all_cnt\":1,\"send_fail_cnt\":0,\"send_retry_cnt\":0,\"temperature\":2768,\"voltage\":3015}}", "lumi.158d00020189a4.version": "1.2" }

rezmus commented 3 years ago

new batch made 10.2020+ has telnet with password so you have to solder uart.

AlexxIT commented 3 years ago

Can you pack and send me data folder? You can find me in Telegram

Mantoui commented 3 years ago

@AlexxIT The following is the data file. In addition to the music file, I hope it can help. If you need other files, please directly @ me https://drive.google.com/file/d/17sKfU8XesKu-uXAPMvQauGv8Ej1t0nmc/view?usp=sharing

AlexxIT commented 3 years ago

What profit of support this gw do you think? It has good HomeKit implementation and can be connected with it to Hass. And it don't support BLE and Mesh devices.

Mantoui commented 3 years ago

M1s supports ZigBee 3.0, RGB lighting effect, sound generating unit and light sensor At present, homekit supports ha access: alert, RGB lighting, and sub devices It does not support the access of its own sound generating unit and light sensor This device is directly plugged into the power supply, and no external charger is required Indeed, the advantage is not obvious, embarrassing

niceboygithub commented 3 years ago

@AlexxIT

Will you mind that I reference your code to develop the HA custom_component for Aqara Gateway M1S?

AlexxIT commented 3 years ago

If all the same, maybe just add support to this component?

niceboygithub commented 3 years ago

If all the same, maybe just add support to this component?

it is a good idea to add support to this component. I put my first version at https://github.com/niceboygithub/AqaraGateway.

Need to discuss that how to add support to this component.

AlexxIT commented 3 years ago

You made a lot of changes. Need to rewrite all component code structure for support many gateways. Or it will be very difficult to maintain different versions in one repo.

niceboygithub commented 3 years ago

I will create a PR to you after tested the code to support M1S, M2