krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
416 stars 45 forks source link

Wrong device being controlled (Received a response from a mismatching device) #408

Closed asportnoy closed 6 months ago

asportnoy commented 6 months ago

Version of the custom_component

I believe v5.0.1 (installed via HACS)

Configuration

N/A - just UI configuration

Describe the bug

Recently, it seems like there is some kind of mismatch between which devices are being control. For example, I'll turn on a certain smart plug and it'll sometimes also turn on a random smart bulb (both Meross but unrelated devices). I believe it's also causing devices to be sometimes unresponsive. The effects aren't fully consistent but I have been seeing the error log below showing up pretty frequently lately.

Debug log

This error originated from a custom integration.

Logger: custom_components.meross_lan.mss110_###############################3
Source: custom_components/meross_lan/helpers/__init__.py:246
Integration: Meross LAN (documentation, issues)
First occurred: 12:01:51 AM (1 occurrences)
Last logged: 12:01:51 AM

Received a response from a mismatching device (received uuid:<redacted>, configured uuid:<redacted>)

This is just the error log, if you need additional logs let me know. I'm unsure if the UUIDs here are sensitive at all so redacting them just in case. They are different values for each one.

krahabb commented 6 months ago

Hello @asportnoy, This was observed too some time ago (#341) and the bug underlying it was fixed in Cloudy.5 Long story short, the devices had their IP changed by DHCP but meross_lan didn't get the refresh (either because not running at the moment of the update or for many other reason)

Now, when this happens and the DHCP update doen't get recognized, meross_lan is able to detect the mismatching and so immediately disables the device waiting for a manual fix (there should be an 'issue' raised in HA that guides you to the device configuration in order to set the ip/host address to the correct value for the device since DHCP auto-update was not able to get it.

As for why this happens (it shouldn't since there's a mechanism to receive the dhcp updates and fix them in configuration 'on the fly') there could be many reasons typically involving the LAN topology/configuration and or transient conditions (like I've said if HA is not running at the time of the change or so...)

You might find some logs for meross_lan in case the DHCP update process fails but it's not a clear indication: i.e. if the DHCP mesdsages don't get to HA meross_lan/HA are totally unaware of these changes.

All in all it's always good practice to configure DHCP at the router to try always assign the same IP addresses to devices.

asportnoy commented 6 months ago

Hi @krahabb, thanks for that information. I went though my devices and found that some of the IP addresses had in fact changed. I did do some changing of my network configuration last week, during which my router (and therefore home assistant as well) was periodically offline, so this makes sense with the information you gave.

I manually updated the IPs to match the new ones and as far as I can feel I'm no longer getting the error. I also assigned static IPs to those devices so hopefully this shouldn't happen again.

Thanks for your help!