krahabb / meross_lan

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

msg100 - Garage Opener wrong state #415

Closed mguilherme closed 6 months ago

mguilherme commented 8 months ago

Somehow, home assistant is reporting wrong states for msg100 - Garage Opener

Configuration


Add your logs here.

Describe the bug

After the latest Meross lan update (v5.0.3) my garage Opener - msg100 started to act weird.

Everything is fine in Apple home kit but the states are wrong in home assistant.

image

https://github.com/krahabb/meross_lan/assets/699510/4498a9b8-2c39-433a-89ec-5cbbdc58cff7

Debug log


Add your logs here.
krahabb commented 8 months ago

Hello @mguilherme, I've tried to look at the code and couldn't find a reason for this. The algorithm managing the garage door was rewritten in v5.0.0 and never touched after it, but its logic 'should' be the same as in previous (pre 5.0.0) versions.

From which version did you upgrade to 5.0.3 ?

Also, if you could get a Debug trace while issuing those commands I could better understand what's wrong

mguilherme commented 8 months ago

thanks for the answer

went there to actually get the debug trace but for some reason it seems to be working now, there was a HA core update if I'm not mistaken that could have something to do with. I'll monitor this but like you said, it doesn't seem to have anything to do with meross lan

cpish commented 7 months ago

I've just started experiencing this same issue out of nowhere. I also noticed that the diagnostic entity "Garage Door Problem" started being set to "Problem", but the Meross app isn't reporting any problems with the door.

Debuge trace: 2024-03-31_06-02-17_84761c433b058d1c4a6e0b228ffa54e0.csv

krahabb commented 7 months ago

I see your device is linked to the Meross cloud profile and in this scenario the component optimistically relies on MQTT to listen for state changes. I think the issue lies in the fact that the MQTT channel is not providing the garage open/close state update. Could you try set the protocol to 'HTTP' and see if this alleviates the issue? I'll anyway check if I could implement a more safe/conservative approach to querying the state. This logic anyway, is the same since initial implementations, so the issue should have exposed itself before. Another reason might be that, even if this behavior is the same through meross_lan versions, noone ever used (until now) the garage door configured and linked with both MQTT (cloud or not) and HTTP.

Side note: The diagnostic entity works by checking that, after the expected timeout from the last command (open/close timeout for open/close command) the state is 'really' as it should be. Its intent is to be used as an helper tool to maybe raise notifications or any other action when the door doesn't reach its intended state after a command since the garage door malfunctioning might pose security risks at your house.

cpish commented 7 months ago

Thanks for the quick reply. Setting the protocol to HTTP seems to have fixed this, much appreciated!

Another reason might be that, even if this behavior is the same through meross_lan versions, noone ever used (until now) the garage door configured and linked with both MQTT (cloud or not) and HTTP.

I just setup the integration and used whatever defaults I was given as it seemed to be working over the last week. I assume the optimal setup here would be to use MQTT over LAN, I just haven't had time to configure that yet.

Seems like that diagnostic entity works perfectly 😄 thanks for the explanation.

BlackBadPinguin commented 7 months ago

Hey, I had the same problem and was also able to fix it by setting the protocol to HTTP. Just as further confirmation.

Wright55 commented 7 months ago

Think I have a similar issue with MSG100

Garage Door garage was closed 11:51:03 - 6 minutes ago

Garage Door garage became unavailable 11:50:33 - 6 minutes ago

Garage Door garage was closed 11:41:57 - 15 minutes ago

Garage Door garage became unavailable 11:41:27 - 15 minutes ago

Garage Door garage was closed 11:32:51 - 24 minutes ago

Garage Door garage became unavailable 11:32:21 - 25 minutes ago

Garage Door garage was closed 11:23:45 - 33 minutes ago

Garage Door garage became unavailable 11:23:15 - 34 minutes ago

Garage Door garage was closed 11:14:39 - 42 minutes ago

Garage Door garage became unavailable 11:14:09 - 43 minutes ago

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/meross_lan/helpers/manager.py:433 integration: Meross LAN (documentation, issues) First occurred: 09:33:54 (1 occurrences) Last logged: 09:33:54

Error doing job: Exception in callback ConfigEntryManager.trace_open.._trace_close_callback() at /config/custom_components/meross_lan/helpers/manager.py:401 Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/meross_lan/helpers/manager.py", line 404, in _trace_close_callback self.trace_close() File "/config/custom_components/meross_lan/meross_device.py", line 532, in trace_close super().trace_close() File "/config/custom_components/meross_lan/helpers/manager.py", line 433, in trace_close self._trace_future.set_result(self._trace_data) asyncio.exceptions.InvalidStateError: invalid state

I tried the change to HTTP from Auto but still occurs.

krahabb commented 7 months ago

Hello @Wright55, I don't think this is the same issue since your disconnection is pretty regular (on a 9 minutes timeout) and looks like not being related to a garage transition/run

Also, the error log seems not related to the disconnections while it is likely triggered by a 'diagnostics' collections: did you try use the 'Download diagnostics' ?

Wright55 commented 7 months ago

Changed to MQTT and now no issues.

Previously was 'auto' setting and no issues since installing last year, just for the last couple months.

On Tue, Apr 16, 2024, 21:07 krahabb @.***> wrote:

Hello @Wright55 https://github.com/Wright55, I don't think this is the same issue since your disconnection is pretty regular (on a 9 minutes timeout) and looks like not being related to a garage transition/run

Also, the error log seems not related to the disconnections while it is likely triggered by a 'diagnostics' collections: did you try use the 'Download diagnostics' ?

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