krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
423 stars 47 forks source link

HA Core 2022.9.6 #213

Closed GeorgeCaliment closed 1 year ago

GeorgeCaliment commented 2 years ago

Hi @krahabb, I guess the new HA Core release broke the meross lan integration, cause of refactoring to mqtt tests they did, devices cannot more connect to mqtt broker. Can you confirm it too? For the moment i just did a rollback to previous version.

nao-pon commented 2 years ago

I had the same problem. For the time being, I have taken the following measures.

def mqtt_publish(hass, topic, payload): """ friendly 'publish' to bypass official core/mqtt interface variations this could be dangerous on compatibility but the ongoing api changes (2021.12.0) are a bit too much to follow with a clean backward compatible code """

hass.async_create_task(hass.data[DATA_MQTT].async_publish(topic, payload, 0, False))

mqtt = hass.data[DATA_MQTT]
client = mqtt.client if hasattr(mqtt, 'client') else mqtt
hass.async_create_task(client.async_publish(topic, payload, 0, False))
timnolte commented 2 years ago

Ugh, and this is what I get for deciding to finally upgrade. If I would have checked here I could have saved myself a world of hurt. Thanks @nao-pon for that code, as that got me back in business.

tomsruk commented 2 years ago

I’ve lost 95% of my 20+ devices to “unavailable” state.

When will HA not be the most painful and excruciating experience?

timnolte commented 2 years ago

@tomsruk if you make the code changes that @nao-pon suggested things should return to a working state.

I think the thing is, the fact that this is a community add-on makes HA Core updates a risk. Unless community add-ons do early testing and update in co-ordination with HA Core we are going to continue to see these problems. I would say that the HA Core team should be providing early details on pending "breaking" changes if they aren't. Then again for community add-ons maintained by folks doing it in their spare time it's not always possible to carve out the time. It's a good idea to wait on updating HA until you can confirm that all of your integrations will continue to work if you update.

krahabb commented 2 years ago

Hello, sorry for being late here...I took a bit of vacation and still trying to get back on business. This is a bit of a hell of course since testing on 2022.9.beta didn't show any apparent issue about MQTT... I agree with @timnolte that the breaking changes (especially those 'in between' the same major release) should be avoided but the HA team is likely focusing on improving the core 'no matter what' and leaving a bit behind all of the community code which needs constant attention in order to maintain compatibility. I'll just stop complaining anyway and try to catch-up with the open issues and release an update sooner than later. Sorry again for the absence!

P.S. I still have mine running on 2022.9.4 with no apparent MQTT issue. I'll try to check where and why the change to HA core happened. @krahabb

timnolte commented 2 years ago

@krahabb let me know if there is anything I can help with. As an open source developer myself I know all too well the challenges of keeping up with the changes happening to the platform you develop add-ons for.

tomsruk commented 2 years ago

Hey folks. I just wanted to clarify I'm not moaning about developers, especially those who do it for nothing. The Meross LAN integration had been working perfectly. It's just frustrating how things get broken so often by HA devs.

I've tried adding that bit of code above but I'm still getting unavailable devices. Weirdly not all of my devices are unavailable.

Perhaps I've got a different issue?

timnolte commented 2 years ago

@tomsruk have you restarted HA? I had to restart HA before it was fixed.

tomsruk commented 2 years ago

Yes a couple of times. Did they come back immediately or did you have to reconfigure anything?

On Mon, 26 Sep 2022 at 22:23, Tim Nolte @.***> wrote:

@tomsruk https://github.com/tomsruk have you restarted HA? I had to restart HA before it was fixed.

— Reply to this email directly, view it on GitHub https://github.com/krahabb/meross_lan/issues/213#issuecomment-1258648306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP6MAM4NOHQYSC7U3QGDKLWAIH4DANCNFSM6AAAAAAQTCOY4A . You are receiving this because you were mentioned.Message ID: @.***>

timnolte commented 2 years ago

Mine were all red and broken, but then also I ended up with a bunch of unconfigured/autodetected items that all ended up recovering after making the code change and restarting HA. I didn't have to reconfigure anything.

timnolte commented 2 years ago

I should also mention that I have all of my Meross devices completely disconnected from Meross Cloud and only have them setup locally with a local MQTT, or just IP for the few that won't properly pair via MQTT.

GeorgeCaliment commented 2 years ago

Hi @krahabb don't worry, with a rollback or @nao-pon temporary fix all came back working. I can confirm that the 2022.9.6 release contains the breaking changes, i have my HA on 2022.9.5 Core and all works fine.