krahabb / meross_lan

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

Make configuration independent from IP number #229

Closed luisdomg closed 1 year ago

luisdomg commented 1 year ago

Is your feature request related to a problem? Please describe. When there's a power blackout, meross devices get a new IP, and then you loose configuration. Besides, it takes a bit of tinkering to get to know you just lost your IP, as you don't see it on the device page.

Describe the solution you'd like To make this configuration independent from IP number.

Describe alternatives you've considered In my particular router, which is very common in my country, it's a serious PITA to get DHCP to always provide the same IP. If the feature is not feasible, at least be more clear in the integration that you lost the IP.

Additional context Let me know if you need more data, and thank you for your time!

krahabb commented 1 year ago

Hello @luisdomg , This is definitely a nice feature to have but I've always postponed that since I'd need a decent amount of time to test it 'in the wild' since I'm not sure how the DHCP 'renew' and or any other DHCP state transition is really working expecially when it comes to how this is managed by the HA core dhcp integration. I'll put in on list anyway since it is very annoying to have to re-enter device configuration for this scenario. I hope the christmas holydays will give me some good time to spend on this :)

krahabb commented 1 year ago

There's a pre-release now available which 'should' fix the dynamic ip changes. I didn't have the chance to test it in my dev environment but it works in my production setup (which actually has only 1 device active but if it works for 1 I guess it would work for any..) Now it listens for any dhcp change and automatically updates the configuration with the new address for the mac

BrandonNolet commented 1 year ago

I can test this. I have three meross lights. I just have to replace the changed files from the custom_components folder for this integration and then reboot, right?

krahabb commented 1 year ago

Yep!

BrandonNolet commented 1 year ago

I see that the 3.0 release included the fix here so I simply updated. I can confirm that the fix works! Thank you very much for this! It really is a quality of life improvement :D (now if only Tuya and LocalTuya could improve this way :P )