MiLight Hub esp8266 mqtt communication disconnect

I’m pretty new to Home Assistant, but feel like I’m starting to get a handle on things. I have several MiLight bulbs and was excited to see (and build) a MiLight hub on an esp8266 from Chris Mullins. I got it setup and it seems to work, most of the time.

I’m having this issue where it appears to stop communicating with HA. After awhile (Can’t seem to figure out a consistent time. Often times within a couple of hours.) I can no longer control the lights from HA and the status doesn’t update from the hub. If I delete the device from HA and reboot the hub it will re add it and work just fine for awhile. Sometimes I have to remove mqtt all together then re add everything. To be clear the hub continues to work with the lights just fine.

I’m currently on HA 2022.2.5 and version 1.10.8 for the MiLight Hub. Can anyone point me in the right direction of how to fix this? I don’t mind doing the research I’m just stuck on what I need to look for.

You should open an issue with the developer. This is the closest one I could find to the issue you are experiencing:

Thank you. I’ll bring it up with him and see what he says.

I haven’t reached out to the developer yet, but I did look at that link and tried looking at the serial logs (I’m not completely sure I did it right). What I found was “Failed to connect to MQTT server rc=-2”. Given that if I delete the device on HA and re add it that it works that would imply to me it’s an issue with HA. Or am I thinking of this all wrong?
I’m running HA on a vm on Hyper-V. Both components are sitting on a separate network. Hyper-V host is on lan while the device is Wi-Fi. I’ve tried Hyper-V on Wi-Fi as well. I’m not using credentials for the mqtt server. I suspect it has something to do with the mqtt server, but I don’t even know where to look.
Am I thinking of this all wrong?

Well I walked away for a few days and had the hub powered off. Plugged it in yesterday and it appears to have been working for the last 24 hours. I’ll keep testing it and see if it breaks again.

This is when you put “fixed AIBM*” on the fault repair ticket.

* (as if by magic).

Thank you for your help on this btw. As someone who works in support I hate being that person that has his issue fixed AIBM.