Chuangmi.plug.v3

@syssi after the last update of chuangmi.plug.v3 in xiaomi app, even if the switch is turned off, after a while the home assistant will turn it on even if the switch remains off. there is some solution ??

Could you describe the behavior in detail and provide some logs with debugging enabled?

even if the switch is off, after about 10 seconds on home assistant return on even if the switch is really off. how do i see for the log?
this has been happening since xiaomi updated the switch firmware

Have you seen the bug?

Could you provide the firmware version or your device? I cannot reproduce the issue.

2.0.4_0026 firmware version

2.0.4_0026 firmware version

in home assistant the state always remains on even if in xiaomi home it turns out to be off and really is off.
when I go to use the switch on the home assistant, in reality the switch turns off but after a few seconds, on the home assistant it virtually switches on again. 2.0.4_0026 firmware version

I face the same exact problem as well.

1 Like

@syssi is the developper.

The component isn’t compatible with the most recent firmware version. In the past, you could send two requests (req a, req b) and the device response in the correct order (resp a, resp b). The behavior of firmware v2 looks like this: req a, req b, resp b, resp a.

is it possible to found a solution?

I have the same problem with 2.0.6_0012 firmware

Here is the solution. https://github.com/rytilahti/python-miio/pull/665

how can i implement this change?

do you know how i can resolve ths issue?

I could not understand how to apply this solution.
Since I manage the plug only from the Home Assistant, i came up with a simple solution:
I created an MQTT sensor to store the actual sate of the plug.
Then i created 2 simple rule:

  1. When the plugh goes into the off state, the “off” state is sent to the MQTT topic and sesnor also goes into a “off” state.
  2. When I turn on the socket from HA, the MQTT topic is written “on” and sesnor goes into a “on” state