niceboygithub / AqaraGateway

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

Fatal Same Issue as #292, M2 POE integration and Entities total dead if it lose connection #306

Open artoodetoo3301 opened 1 month ago

artoodetoo3301 commented 1 month ago

Hi there is a problem which is extremely fatal.

Background: HA installed in Proxmox x86, with a Ryzen R7 5800, in a full ATX rig.

Cause: The M2 POE hubs losing connection for whatever reason, Router reboot? Wifi disconnect? Ethernet screw up? Result: It will lie into a dead end showing Failed Setup, will retry: None.

There is no way waking the hub up for the integration although all things working perfectly for Homekit and under Aqara App.

There are few sitution I encounter:

1) If I delete that hub by integration and re-add it, all the entities custom setting are all dead, history gone.

2) Either reboot HA, or reboot the whole VM of HA, or the whole Proxmox machine, nothing changed, it is still dead.

3) ### FATAL If I click reconfig, the whole Home Assistant DESTROYED, it will shut itself down, UI being not working, nor even the Zigbee Z2M, everything just DEAD, reboot HA VM still making the whole HA into coma, TOTAL LOSS. I have no choice but restoring the whole Home Assistant by backup image.

4) I just restore from Backup image, it may work, not 100%.

Please, what is the cause of it, how to prevent it and how to fix it?

It is an extreme headache.

niceboygithub commented 1 month ago

In some situations, HA lost the configuration of AqaraGateway, like ip and model of M2. The only solution is that remove old one then add again.

artoodetoo3301 commented 1 month ago

In some situations, HA lost the configuration of AqaraGateway, like ip and model of M2. The only solution is that remove old one then add again.

Do you know why the cause of "reconfig" would nuke my HA into death?

AQ-Official commented 1 month ago

295 same issues, cause whole HA dead

niceboygithub commented 1 month ago

Remove AqaraGateway integration and add again because the configuration was missing.

AQ-Official commented 1 month ago

Remove AqaraGateway integration and add again because the configuration was missing.

This indeed solves the problem, but once the bug appears, the entire HA crashes. My current approach is to reinstall HA and, as soon as HA loads for the first time, quickly navigate to the integration page, disable and delete this integration, then re-add it. This is very troublesome.

GalenaHu commented 4 weeks ago

After clicking reconfig by mistake and crashing twice, I found a way to avoid reinstalling HA. Comment the code in /config/custom_components/aqaragateway/__init_\.py via smb. Restart HA and UI connection is back.

jerryhze commented 3 weeks ago

Same problem here, AqaraGateway stopped working, but HA still works. Tried reconfig AqaraGateway, that caused HA to crash. Restarting does not bring back HA. :(

jerryhze commented 3 weeks ago

After clicking reconfig by mistake and crashing twice, I found a way to avoid reinstalling HA. Comment the code in /config/custom_components/aqara_gateway/init.py via smb. Restart HA and UI connection is back.

Thank you!! I was quite hopeless as HA crashes and no GUI is shown, but commenting out all code under init.py indeed brings back HA after a restart.