Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi Aqara Plug (SP-EUC01/lumi.plug.maeu01) Toggles without reason #13903

Closed
gszigethy opened this issue Sep 7, 2022 · 97 comments
Closed

Xiaomi Aqara Plug (SP-EUC01/lumi.plug.maeu01) Toggles without reason #13903

gszigethy opened this issue Sep 7, 2022 · 97 comments
Labels
problem Something isn't working stale Stale issues

Comments

@gszigethy
Copy link

What happened?

I've executed OTA firmware update on the Xiaomi Aqara plug (SP-EUC01). Old fw version: 09-22-2020. New version came from zigb222mqtt OTA location, version 20211206.

2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: lumi.plug.maeu01: unknown key dateCode with value 09-22-2020
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: lumi.plug.maeu01: unknown key swBuildId with value undefined
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: lumi.plug.maeu01: Processed data into payload {}
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: Updating to latest '0x54ef441000157f54' (lumi.plug.maeu01)
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: Using endpoint '1'
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: Received Zigbee message from 'plug_002', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":32,"imageType":24,"manufacturerCode":4447}' from endpoint 1 with groupID 0
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: Got OTA request '{"fieldControl":0,"manufacturerCode":4447,"imageType":24,"fileVersion":32}'
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: ZigbeeOTA: downloaded main index
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: getNewImage for '0x54ef441000157f54', meta {"fileVersion":41,"fileSize":273278,"url":"https://github.com/Koenkk/zigbee-OTA/raw/master/images/Xiaomi/20211209165104_OTA_lumi.plug.maeu01_0.0.0_0041_20211206_0C22EC.ota","sha512":"3d5567a29eb7d4bacaaf823c47b66a700fb1e7b935b1d547673bcacb2ff4efacb7780e8caf72dc80f0ac942c1ec1f6964bf67cfacba359d38132b7bcfe80133b"}
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:30: ZigbeeOTA: downloading firmware image from https://github.com/Koenkk/zigbee-OTA/raw/master/images/Xiaomi/20211209165104_OTA_lumi.plug.maeu01_0.0.0_0041_20211206_0C22EC.ota
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:31: OTA update checksum validation succeeded for '0x54ef441000157f54'
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:31: getNewImage for '0x54ef441000157f54', image header {"otaUpgradeFileIdentifier":{"type":"Buffer","data":[30,241,238,11]},"otaHeaderVersion":256,"otaHeaderLength":56,"otaHeaderFieldControl":0,"manufacturerCode":4447,"imageType":24,"fileVersion":41,"zigbeeStackVersion":2,"otaHeaderString":"ROUTERX-----JN5180--ENCRYPTED000","totalImageSize":273278}
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:31: Got new image for '0x54ef441000157f54'
2022-09-01.13-13-03/log.txt:debug 2022-09-07 08:54:31: Starting upgrade

The upgrade completed without problems.

After that update, whenever I press the button on any IKEA E1812 or E1743, the plug toggles its state which is really undesired. It happens only when the button is connected to that plug (routed via it). Repairing the button using another router helps for a moment but as the network reconfigures itself, the buttons are again routed via the plug, so random buttons start to turn that router plug on and off. Since that plug is not solely a router but provides power to my home office, this is very annoying and made the device unusable. It didn't brick it, but the functionality became useless.

This is in the logs when I press an unrelated button routed through the plug, and switching it:

debug 2022-09-07 16:09:48: Received Zigbee message from 'switch_006', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
info  2022-09-07 16:09:48: MQTT publish: topic 'zigbee2mqtt/switch_006', payload '{"action":"on","battery":87,"linkquality":47,"update":{"state":"idle"},"update_available":null}'
info  2022-09-07 16:09:48: MQTT publish: topic 'zigbee2mqtt/switch_006', payload '{"action":"","battery":87,"linkquality":47,"update":{"state":"idle"},"update_available":null}'
info  2022-09-07 16:09:48: MQTT publish: topic 'zigbee2mqtt/switch_006/action', payload 'on'
debug 2022-09-07 16:09:48: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genOnOff', data '{"245":128283218,"onOff":1}' from endpoint 1 with groupID 0
info  2022-09-07 16:09:48: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":27,"energy":0,"linkquality":47,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"ON","update":{"state":null},"update_available":null,"voltage":229}'

I accidentally realized that these ghost switches work when zigbee2mqtt is down, ie. the plug works in a binding manner with all switching devices that are routed through it. In the meantime sensors routed through it work fine. It seems like when the firmware got upgraded to the one on the OTA server, it makes the plug and all routed switches like binded devices. It may be that the firmware is corrupt, but I have found no way to roll back. I've tried to unbind the switches that are routed through the plug via zigbee2mqtt GUI. The unbind gives a success message but the faulty behaviour remains.

Apparently happened to ohers but not too much traffic in that thread: https://community.home-assistant.io/t/aqara-plug-sp-euc01-lumi-plug-maeu01-toggles-without-reason/451671/2

What did you expect to happen?

After the firmware upgrade the device behaviour is identical and can be switched by binded devices or via zigbee2mqtt.

How to reproduce it (minimal and precise)

  1. Get a Xiaomi Aquara plug with original firmware (mine was 09-22-2020).
  2. OTA upgrade via zigbee2mqtt.
  3. Make a few switches route through it in a zigbee network. I used the following:
    IKEA | E1812 | 20210727 | 2.3.080
    IKEA | E1743 | 20210722 | 2.3.079
  4. Toggle the switch.
  5. Observe that it will toggle the status of the plug.

Zigbee2MQTT version

1.27.2

Adapter firmware version

20220219

Adapter

Slaesh CC2652RB

Debug log

No response

@gszigethy gszigethy added the problem Something isn't working label Sep 7, 2022
@0ip
Copy link

0ip commented Sep 8, 2022

I can confirm and reproduce that behavior. My plug has the same firmware. With my E1743, I can reliably turn on or off the plug.

@Koenkk
Copy link
Owner

Koenkk commented Sep 8, 2022

Seems the plug started listening to group 0, can you try to make a group 0 in z2m, add the plug to it and then remove it again?

@gszigethy
Copy link
Author

gszigethy commented Sep 8, 2022

Creating group:

debug 2022-09-08 09:50:33: Received MQTT message on 'zigbee2mqtt/bridge/request/group/add' with data '{"friendly_name":"plugtest","id":"0","transaction":"5x1m7-2"}'
info  2022-09-08 09:50:34: MQTT publish: topic 'zigbee2mqtt/bridge/response/group/add', payload '{"data":{"friendly_name":"plugtest","id":0},"status":"ok","transaction":"5x1m7-2"}'
debug 2022-09-08 09:50:34: Received Zigbee message from 'rain_001', type 'attributeReport', cluster 'genBasic', data '{"65281":{"1":3165,"10":24590,"100":0,"3":26,"4":13224,"5":12,"6":[0,65537]}}' from endpoint 1 with groupID 0

Adding the plug to the group (plug is 0x54ef441000157f54):

debug 2022-09-08 09:51:31: Received MQTT message on 'zigbee2mqtt/bridge/request/group/members/add' with data '{"device":"0x54ef441000157f54/1","group":"plugtest","transaction":"65o9i-26"}'
info  2022-09-08 09:51:31: Adding '0x54ef441000157f54' to 'plugtest'
info  2022-09-08 09:51:31: MQTT publish: topic 'zigbee2mqtt/bridge/response/group/members/add', payload '{"data":{"device":"0x54ef441000157f54/1","group":"plugtest"},"status":"ok","transaction":"65o9i-26"}'
info  2022-09-08 09:51:31: MQTT publish: topic 'homeassistant/switch/1221051039810110150109113116116_0/switch/config', payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"},{"topic":"zigbee2mqtt/plugtest/availability"}],"availability_mode":"all","command_topic":"zigbee2mqtt/plugtest/set","device":{"identifiers":["zigbee2mqtt_1221051039810110150109113116116_0"],"name":"plugtest","sw_version":"Zigbee2MQTT 1.27.2"},"name":"plugtest","payload_off":"OFF","payload_on":"ON","state_topic":"zigbee2mqtt/plugtest","unique_id":"0_switch_zigbee2mqtt","value_template":"{{ value_json.state }}"}'
debug 2022-09-08 09:51:32: Received MQTT message on 'homeassistant/switch/1221051039810110150109113116116_0/switch/config' with data '{"availability":[{"topic":"zigbee2mqtt/bridge/state"},{"topic":"zigbee2mqtt/plugtest/availability"}],"availability_mode":"all","command_topic":"zigbee2mqtt/plugtest/set","device":{"identifiers":["zigbee2mqtt_1221051039810110150109113116116_0"],"name":"plugtest","sw_version":"Zigbee2MQTT 1.27.2"},"name":"plugtest","payload_off":"OFF","payload_on":"ON","state_topic":"zigbee2mqtt/plugtest","unique_id":"0_switch_zigbee2mqtt","value_template":"{{ value_json.state }}"}'

Testing the switch off and on (switch is 0x8cf681fffe2d74ae, plug is 0x54ef441000157f54):

debug 2022-09-08 09:51:58: Received Zigbee message from '0x8cf681fffe2d74ae', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
info  2022-09-08 09:51:58: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"off","battery":87,"linkquality":51,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:51:58: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"","battery":87,"linkquality":51,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:51:58: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae/action', payload 'off'
debug 2022-09-08 09:51:58: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genOnOff', data '{"245":125989379,"onOff":0}' from endpoint 1 with groupID 0
info  2022-09-08 09:51:58: MQTT publish: topic 'zigbee2mqtt/plugtest', payload '{"state":"OFF"}'
info  2022-09-08 09:51:58: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":29,"energy":0,"linkquality":51,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"OFF","update":{"state":null},"update_available":null,"voltage":233}'
debug 2022-09-08 09:51:58: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genAnalogInput', data '{"presentValue":0}' from endpoint 21 with groupID 0
info  2022-09-08 09:51:58: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":29,"energy":0,"linkquality":51,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"OFF","update":{"state":null},"update_available":null,"voltage":233}'


debug 2022-09-08 09:52:01: Received Zigbee message from '0x8cf681fffe2d74ae', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
info  2022-09-08 09:52:01: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"on","battery":87,"linkquality":51,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:52:01: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"","battery":87,"linkquality":51,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:52:01: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae/action', payload 'on'
debug 2022-09-08 09:52:01: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genOnOff', data '{"245":125989380,"onOff":1}' from endpoint 1 with groupID 0
info  2022-09-08 09:52:01: MQTT publish: topic 'zigbee2mqtt/plugtest', payload '{"state":"ON"}'
info  2022-09-08 09:52:01: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":29,"energy":0,"linkquality":51,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"ON","update":{"state":null},"update_available":null,"voltage":233}'
debug 2022-09-08 09:52:01: Saving state to file /app/data/state.json

Removing the plug from the group:

debug 2022-09-08 09:55:20: Received MQTT message on 'zigbee2mqtt/bridge/request/group/members/remove' with data '{"device":"0x54ef441000157f54","group":"plugtest","transaction":"65o9i-27"}'
info  2022-09-08 09:55:20: Removing '0x54ef441000157f54' from 'plugtest'
info  2022-09-08 09:55:20: MQTT publish: topic 'zigbee2mqtt/bridge/response/group/members/remove', payload '{"data":{"device":"0x54ef441000157f54","group":"plugtest"},"status":"ok","transaction":"65o9i-27"}'
info  2022-09-08 09:55:20: Succesfully disabled reporting for '0x54ef441000157f54/1' cluster 'genOnOff'
info  2022-09-08 09:55:20: Configuring '0x54ef441000157f54'
debug 2022-09-08 09:55:21: Received Zigbee message from '0x54ef441000157f54', type 'readResponse', cluster 'haElectricalMeasurement', data '{"acPowerDivisor":10,"acPowerMultiplier":1}' from endpoint 1 with groupID 0
debug 2022-09-08 09:55:21: Received Zigbee message from '0x54ef441000157f54', type 'readResponse', cluster 'seMetering', data '{"divisor":1000,"multiplier":1}' from endpoint 1 with groupID 0
info  2022-09-08 09:55:21: Successfully configured '0x54ef441000157f54'

Testing the switch off and on (switch is 0x8cf681fffe2d74ae, plug is 0x54ef441000157f54):

debug 2022-09-08 09:56:41: Received Zigbee message from '0x8cf681fffe2d74ae', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
info  2022-09-08 09:56:41: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"off","battery":87,"linkquality":43,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:56:41: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"","battery":87,"linkquality":43,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:56:41: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae/action', payload 'off'
debug 2022-09-08 09:56:41: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genOnOff', data '{"245":125989381,"onOff":0}' from endpoint 1 with groupID 0
info  2022-09-08 09:56:41: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":29,"energy":0,"linkquality":47,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"OFF","update":{"state":null},"update_available":null,"voltage":233}'
debug 2022-09-08 09:56:41: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genAnalogInput', data '{"presentValue":0}' from endpoint 21 with groupID 0
info  2022-09-08 09:56:41: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":29,"energy":0,"linkquality":47,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"OFF","update":{"state":null},"update_available":null,"voltage":233}'

debug 2022-09-08 09:56:43: Received Zigbee message from '0x8cf681fffe2d74ae', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
info  2022-09-08 09:56:43: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"on","battery":87,"linkquality":47,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:56:43: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"","battery":87,"linkquality":47,"update":{"state":"idle"},"update_available":null}'
info  2022-09-08 09:56:43: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae/action', payload 'on'
debug 2022-09-08 09:56:43: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genOnOff', data '{"245":125989382,"onOff":1}' from endpoint 1 with groupID 0
info  2022-09-08 09:56:43: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":29,"energy":0,"linkquality":47,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"ON","update":{"state":null},"update_available":null,"voltage":233}'

The behaviour of the plug is still the same, it switches based on switch commands only routed through it.

@Koenkk
Copy link
Owner

Koenkk commented Sep 8, 2022

That's strange, look that the fw is buggy since it shouldn't respond to that command. Can you try to bind the ikea remote to group 0, unbind it and then bind it to another group (random, e.g. 128). You should bind the onOff cluster.

@max-koptev
Copy link

I have the same problem with LLKZMK11LM relay on firmware 9-22-2021. IKEA remote E1524/E1810 toggles the relay switch at Endpoint: l1 when it routed through it. Seems like the problem is in Aqara devices...

@gszigethy
Copy link
Author

gszigethy commented Sep 8, 2022

What I also noticed since the firmware upgrade is the SP-EUC01 plug creates these kind of errors in the log:

Zigbee2MQTT:debug 2022-09-08 14:09:14: lumi.plug.maeu01: unknown key 220 with value 㡬*�`r���

[...]

Zigbee2MQTT:debug 2022-09-08 14:29:14: lumi.plug.maeu01: unknown key 223 with value #�7�#���#���#���!Y�!���!��!��!��!��!��	!+�
!��!��!�!
Zigbee2MQTT:debug 2022-09-08 14:29:14: lumi.plug.maeu01: Processed data into payload {}
Zigbee2MQTT:debug 2022-09-08 14:29:16: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'aqaraOpple', data '{"223":{"data":[22,33,0,0,23,33,0,0,12,33,0,0,24,33,88,2,30,33,195,1,31,33,169,5,32,33,135,11,34,33,163,22,35,33,0,0,36,32,0,37,35,18,249,120,62,250,33,0,0,251,33,0,0,252,35,0,0,0,0,253,35,0,0,0,0,254,35,128,0,4,0],"type":"Buffer"}}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2022-09-08 14:29:16: lumi.plug.maeu01: unknown key 223 with value �!�!!�!X��!���!�� !��"!��#!$ %#��x>�!�!�#�#�#��
Zigbee2MQTT:debug 2022-09-08 14:29:16: lumi.plug.maeu01: Processed data into payload {}
Zigbee2MQTT:debug 2022-09-08 14:29:25: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'aqaraOpple', data '{"229":{"data":[9,0,9,0,0,4,40,141,159,18,74,24,59,18,90,114,165,18,98,114,130,18,80,50,229,18,83,82,61,18,180,12,101,18,204,78,237,37,25],"type":"Buffer"}}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2022-09-08 14:29:25: lumi.plug.maeu01: unknown key 229 with value 		�(���J�;�Zr��br��P2��SR=��e��N�%�

It is written in the log as is, with these special characters.

@gszigethy
Copy link
Author

gszigethy commented Sep 8, 2022

That's strange, look that the fw is buggy since it shouldn't respond to that command. Can you try to bind the ikea remote to group 0, unbind it and then bind it to another group (random, e.g. 128). You should bind the onOff cluster.

When I want to bind the Ikea switch to group 0, the button is not active:

image

I can unbind it on the GUI, then I press a button on the Ikea switch to wake it up, then the GUI says it was successful with the green popup and I see it in the logs.

Zigbee2MQTT:debug 2022-09-08 14:38:43: Received MQTT message on 'zigbee2mqtt/bridge/request/device/unbind' with data '{"clusters":["genOnOff"],"from":"0x8cf681fffe2d74ae/1","to":"plugtest","transaction":"m7n59-5"}'
Zigbee2MQTT:debug 2022-09-08 14:38:43: unbinding cluster 'genOnOff' from '0x8cf681fffe2d74ae' to 'plugtest'
Zigbee2MQTT:debug 2022-09-08 14:38:48: Received Zigbee message from '0x8cf681fffe2d74ae', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2022-09-08 14:38:48: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"off","battery":87,"linkquality":32,"update":{"state":"idle"},"update_available":null}'
Zigbee2MQTT:info  2022-09-08 14:38:48: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae', payload '{"action":"","battery":87,"linkquality":32,"update":{"state":"idle"},"update_available":null}'
Zigbee2MQTT:info  2022-09-08 14:38:48: MQTT publish: topic 'zigbee2mqtt/0x8cf681fffe2d74ae/action', payload 'off'
Zigbee2MQTT:debug 2022-09-08 14:38:48: Received Zigbee message from '0x54ef441000157f54', type 'attributeReport', cluster 'genOnOff', data '{"245":125989476,"onOff":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2022-09-08 14:38:48: MQTT publish: topic 'zigbee2mqtt/0x54ef441000157f54', payload '{"consumer_connected":false,"consumption":0,"current":0,"device_temperature":27,"energy":0,"linkquality":32,"power":0,"power_outage_count":0,"power_outage_memory":true,"state":"OFF","update":{"state":null},"update_available":null,"voltage":233}'
Zigbee2MQTT:info  2022-09-08 14:38:49: **Successfully unbound cluster 'genOnOff' from '0x8cf681fffe2d74ae' to 'plugtest'**
Zigbee2MQTT:info  2022-09-08 14:38:49: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/unbind', payload '{"data":{"clusters":["genOnOff"],"failed":[],"from":"0x8cf681fffe2d74ae/1","to":"plugtest"},"status":"ok","transaction":"m7n59-5"}'

After this the plug still responds to the switch commands if the switch is routed via the plug.

If I bind it to group 128 with the genOnOff cluster, still the same behaviour, the plug toggles.

I stronlgy suspect this is the results of the firmware, is there a copy of the old version, can the device be rolled back?

@Koenkk
Copy link
Owner

Koenkk commented Sep 9, 2022

@Otnow given the bugs in this fw, can we put back the old ones?

@Otnow
Copy link

Otnow commented Sep 9, 2022

@Otnow given the bugs in this fw, can we put back the old ones?

It is a pity that this firmware version (0.0.0_0041) causes such problems.

Created a PR to return the previous version (0.0.0_0032): OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946.ota

@TheJulianJES
Copy link

TheJulianJES commented Sep 10, 2022

Only saw this issue because of the updated OTA files:

This issue is fixed in ZHA by just making the plug leave group 0: https://github.com/zigpy/zha-device-handlers/pull/1706/files
Z2M could probably implement a similar fix.

(The issue is that the plug is in group 0 when paired initially and IKEA remotes also need to be in group 0. The plug can be removed from that group though.)

Edit 1: Looks like this "fix" to have the plug leave group 0 was already discovered somewhat?
Edit 2: I'll have to check whether IKEA remotes affect the plug even if it's removed from group 0 (but with IKEA devices routing through the device) (with the ZHA patch).
Edit 3: Can confirm that the issue still exists when IKEA remotes route through the plug (even with the "ZHA patch").
Edit 4: So far, it also doesn't seem possible to downgrade the plug from v41 to v32.

@johannes-z
Copy link

I have the same issue.

I was unable to make the plug leave group 0, unbind the OnOff cluster, etc. Rolling back the firmware also doesn't work as the device prevents it (tried via Local OTA index).

Is there any way to at least temporarily fix this until a new firmware is released?

@TheJulianJES
Copy link

TheJulianJES commented Sep 12, 2022

WARNING: Do this at your own risk. You could fully brick your device. (Although no one has managed to do so, yet)

Instructions on how to downgrade maeu01 plug to v32 by bypassing the file version check

The Aqara MAEU01 plug only checks that the header file version of the provided OTA image is bigger than the one currently installed.
To bypass this check, here's a modified image of v32 (which shouldn't have the bug) with header file version 42:
OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v42.ota.zip
EDIT: When downgrading v43 plugs, use this file: #13903 (comment)
(Make sure to extract the image from the zip)

((NOTE: The above firmware download is only for the maeu01 plug (round Aqara EU plug).)
(For the square Xiaomi EU plug, use the download given in this comment: #13903 (comment))

Using zigpy/zigpy-cli, the image for the maeu01 plug was created by doing the following:

import pathlib
from zigpy.ota.image import parse_ota_image

data = pathlib.Path('OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946.ota').read_bytes()
image, remaining = parse_ota_image(data)
assert not remaining

image.header.file_version = 42

pathlib.Path('OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v42.ota').write_bytes(image.serialize())

You should be able to use that image to downgrade your plug to v32 from v41. If you're lucky, the device doesn't brick itself.
(I didn't have any issues downgrading using that image with ZHA and my plug but no guarantees it'll work for you).

I did have to re-activate pairing mode on my MAEU01 plug for some reason though. (The device didn't actually re-pair itself to the network though.)

You can confirm the downgrade was successful by checking that app_version on the Basic cluster returns 32 (instead of 41).
(This won't return 42, as we didn't actually modify the OTA image content but just the header. You should be able to upgrade to v41 again if you want.)

If you also try this, please let me know how it went.

(Note: Remove the OTA file after you've downgraded your plug successfully, as ZHA and likely Z2M might try to continuously "upgrade" your plug again. If the update starts again with ZHA, stop HA during the second update, remove the OTA file, start HA again, then re-pair the plug, so it stops requesting the rest of the OTA image.)

You might want to remove and then re-pair the device after the old firmware is installed.


@Otnow Do you know if there are any firmware versions for that plug between v32 and v41?
Edit: Seems like v40 was a testing version (https://www.aqara.com/eu/version/smart-plug-eu)

@Otnow
Copy link

Otnow commented Sep 13, 2022

Instructions on how to downgrade to v32 by bypassing the file version check

Excellent. I hope this will help others to roll back from the problematic firmware version.


Do you know if there are any firmware versions for that plug between v32 and v41?

It seems that there is no judging by the information from the Aqara Developer Platform:

{
  "result": [
    {
      "releaseTime": "1642585695000",
      "necessary": 0,
      "fileSize": 273278,
      "updateLog": "1.Fix the offline problem of device",
      "state": 2,
      "firmwareVersion": "0.0.0_0041"
    },
    {
      "releaseTime": "1603976430000",
      "necessary": 0,
      "fileSize": 278094,
      "updateLog": "1.Fixes known issues",
      "state": 2,
      "firmwareVersion": "0.0.0_0032"
    }
  ]
}

@0ip
Copy link

0ip commented Sep 13, 2022

@TheJulianJES It worked for me, thanks for the tutorial and the image!

@johannes-z
Copy link

@TheJulianJES Thanks, worked for me too!

I used Z2M. In case anybody wonders how to do it:

  • Download the modified firmware, unzip, upload into zigbee2mqtt folder.
  • Add index.json into your zigbee2mqtt/ folder (next to z2m's configuration.yaml).
  • Update the index.json file contents:
[
  {
    "modelId": "lumi.plug.maeu01",
    "url": "OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v42.ota",
    "path": "./OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v42.ota",
    "force": true
  }
]
  • In Zigbee2MQTT go to Settings > OTA updates and add index.json to the OTA index override file name field.
  • Restart Z2M Addon
  • Check for OTA updates and install

@gszigethy
Copy link
Author

@TheJulianJES Thanks, worked for me too!

I used Z2M. In case anybody wonders how to do it:

Thanks, following this I have also successfull downgraded the firmware and the problem got resolved, so this is a viable workaround. Thanks all.

I presume I shouldn't close the issue as it still persists, we just have a workaround until a proper solution is applied.

@greiseknoue
Copy link

@TheJulianJES Hi! Does this also work for the lumi.plug.mmeu01 or do i need another firmware? (Model: ZNCZ04LM Firmware: 01-23-2022)

@TheJulianJES
Copy link

@greiseknoue Does the mmeu01 also have the problem with toggling randomly on the 2022 firmware? Or what exactly are you trying to achieve?

@greiseknoue
Copy link

@TheJulianJES Yes i have the same issue where the E2001/E2002 and E1812 toggles the plug. I have three mmeu01 plugs where the one i updated has this issue. The firmware build on the non-updated plugs are on 09-06-2019.

in one case, i randomly got E2001/E2002 to work only to the coordinator (I noticed it didn't route through the plug in the "map"-section").

@TheJulianJES
Copy link

TheJulianJES commented Sep 27, 2022

NOTE: This is only for the Xiaomi mmeu01 (square EU plug). NOT THE ROUND EU PLUG.
For the round Aqara EU plug, see the instructions here: #13903 (comment)

NOTE: I haven't tried this firmware at all (works fine for me) and it could brick your device. It's the v22 firmware file modded to have a v25 header (so the plug will accept "upgrading" to it from the apparently buggy v24 release).
In about 10 hours, I might be able to to try the downgrade for an mmeu01 plug with that firmware.

For the mmeu01 plug, you can try the following firmware:
OTA_lumi.plug.mmeu01_V22_20190906_D32362.20191008105750_modded_to_v25.ota.zip
(make sure to extract the image from the ZIP)

The instructions for installing that firmware should be basically identical to the ones in #13903 (comment).

@greiseknoue
Copy link

Thank you so much for your help. I think i got it working, but it still says "Firmware build date 01-23-2022" in the ui of the device. I'm guessing i should look somewhere else to find the right firmware?

@TheJulianJES
Copy link

Mhm, date_code should be 09-06-2019 and app_version=22 (both are attributes on the Basic cluster).
Maybe Z2M caches the info for some time. Try to re-read it or re-pair the plug maybe?
(I'll try to see later if the firmware downgrade for the mmeu01 plug works for me and see if I have the IKEA random toggling issue for that plug as well before/after)

@greiseknoue
Copy link

After removing the plug from the wall and plugging it in, it works and it says 09-06-2019! Thank you once again! I will report back if the issue still persist.

@lo97
Copy link

lo97 commented Oct 8, 2022

How to disable ota if the device is already on version 32?

@TheJulianJES
Copy link

@lo97 Are you using ZHA or Z2M?

For ZHA, just remove the modified OTA file from the ota directory.
For Z2M, just remove the OTA index override.

@vetinari
Copy link

vetinari commented Oct 12, 2022

Do you know if there are any firmware versions for that plug between v32 and v41?

It seems that there is no judging by the information from the Aqara Developer Platform:

There may be one, mine has Firmware build date 12-06-2021

@uxdesignerhector
Copy link

uxdesignerhector commented Oct 14, 2022

@TheJulianJES Thanks, worked for me too!

I used Z2M. In case anybody wonders how to do it:

* Download the modified firmware, unzip, upload into `zigbee2mqtt` folder.

* Add `index.json` into your `zigbee2mqtt/` folder (next to z2m's `configuration.yaml`).

* Update the `index.json` file contents:
[
  {
    "modelId": "lumi.plug.maeu01",
    "url": "OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v42.ota",
    "path": "./OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v42.ota",
    "force": true
  }
]
* In Zigbee2MQTT go to `Settings > OTA updates` and add `index.json` to the `OTA index override file name` field.

* Restart Z2M Addon

* Check for OTA updates and install

I'm trying to find that option(add index.json to the OTA index override file name field) in the step (go to Settings > OTA updates...) but I don't see it, could you show me the way? I'm using the addon, thanks
image

@Otnow
Copy link

Otnow commented Dec 26, 2023

@kevinmilner, unfortunately I did not find firmware lower than 0.0.0_0031.

It's a pity that this version of the firmware caused problems, I created a PR to remove it.

@Pospitch
Copy link

Hi, I have issue with new Aqara Smart Plug (EU round) and I think it's same problem like here. But I'm not using Home Assistant. I have Aeotec Hub and using only Smartthings app for control, pairing etc. I just got a few of those Aqara plugs and my oldIKEA Switch (which I use for lights) is controlling one of these plugs by itself. So switching light off is also switching my PC off and that's very unfortunate. I'm trying to find solution, but not sure if that's even possible for me since I'm using only Smartthings app.

@bluemoehre
Copy link

bluemoehre commented Jan 14, 2024

This issue was driving me nuts for days. I tried to connect RODRET switches to the network and they have been routed through my AQARA Plug (model lumi.plug.maeu01) (firmware 0.0.0_0041) which resulted in unexpected toggling of the plug directly. Can confirm firmware 01-13-2023 is also affected.

After I literally turned of everything else in the network (also the coordinator) the plug was still turned off and on by the switch.
I wonder if XIAOMI / AQARA will ever fix this.

Please spread this information and help removing the bugged firmware everywhere in the web.

@jimbo7384
Copy link

just a quick note to thank you everybody for that help ! I'm french and use diffrent Aqara plug some are in v42 some in v43. Following this guideline and downloading the good firmware file allow me to use Aqara with HA and it's working like a charm !

@wagaman
Copy link

wagaman commented Jun 30, 2024

E2123 And aqara eu wall plug … the issue is always here

@Kars-de-Jong
Copy link

So that is what causes this... fortunately the remotes usually route through other devices.
FYI, just got a new plug and it's still at version 43.

@malcp
Copy link

malcp commented Jul 18, 2024

I'm experiencing the same issue but with lumi.switch.b2nc01. Anyone happens to know where to get an older firmware for this device? It's currently on 06-15-2022.

@shrx
Copy link

shrx commented Aug 7, 2024

My plug came with version 43 firmware. I followed the instructions from #13903 (comment) but after restarting the zigbee2mqtt service in the logs I still have

"update":{"installed_version":43,"latest_version":32,"state":"idle"},"update_available":false

My data is organized like this:

data
├── aqara_OTA_downgrade.json
├── configuration.yaml
├── OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v99.ota

configuration.yaml config:

  '0x54ef441000c2acff':
    friendly_name: aqaraPlug
    ota:
      disable_automatic_update_check: true
      zigbee_ota_override_index_location: aqara_OTA_downgrade.json

aqara_OTA_downgrade.json config:

[
    {
      "modelId": "lumi.plug.maeu01",
      "url": "OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v99.ota",
      "path": "./OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v99.ota",
      "force": true
    }
]

Why doesn't it pick up the update?

edit: after I send the command to update it:

mqttcli pub -t zigbee2mqtt/bridge/request/device/ota_update/update -m '{"id": "aqaraPlug"}'

these are the logs:

avg 07 21:27:52 raspberrypi npm[1099281]: Zigbee2MQTT:info  2024-08-07 21:27:52: Updating 'aqaraPlug' to latest firmware
avg 07 21:27:52 raspberrypi npm[1099281]: Zigbee2MQTT:info  2024-08-07 21:27:52: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Updating 'aqaraPlug' to latest firmware","meta":{"device":"aqaraPlug","status":"update_in_progress"},"type":"ota_update"}'
avg 07 21:27:53 raspberrypi npm[1099281]: Zigbee2MQTT:info  2024-08-07 21:27:53: MQTT publish: topic 'zigbee2mqtt/aqaraPlug', payload '{"auto_off":null,"button_lock":null,"consumer_connected":null,"current":null,"device_temperature":null,"energy":0.09,"led_disabled_night":null,"linkquality":86,"overload_protection":null,"power":23.8,"power_outage_memory":null,"state":"OFF","update":{"installed_version":43,"latest_version":32,"state":"available"},"update_available":true,"voltage":null}'
avg 07 21:27:53 raspberrypi npm[1099281]: Zigbee2MQTT:info  2024-08-07 21:27:53: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Update of 'aqaraPlug' failed (No new image available)","meta":{"device":"aqaraPlug","status":"update_failed"},"type":"ota_update"}'
avg 07 21:27:53 raspberrypi npm[1099281]: Zigbee2MQTT:info  2024-08-07 21:27:53: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/ota_update/update', payload '{"data":{"id":"aqaraPlug"},"error":"Update of 'aqaraPlug' failed (No new image available)","status":"error"}'
avg 07 21:27:53 raspberrypi npm[1099281]: Zigbee2MQTT:error 2024-08-07 21:27:53: Update of 'aqaraPlug' failed (No new image available)

edit2: figured it out, the issue was in configuration.yaml
the "ota:" section should not be under the device node but as a root node

@Kopetan4egX
Copy link

@wassereimer86 they are coming with v43 out of the box. You need to use a modified file to flash these. I have been using this one bellow. You also need a 'index.json' in your home assistant zigbee2mqtt folder, and somehow you must copy the OTA file bellow over to that folder as well (I used scp over ssh).

index.json

[
    {
      "modelId": "lumi.plug.maeu01",
      "url": "OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v44.ota",
      "path": "./OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v44.ota",
      "force": true
    }
]

OTA_lumi.plug.maeu01_V32_20200922_C11F8A.20200924102946_modded_to_v44.ota.zip

Note for anyone running into this: please use this ONLY for the round EU plug. After flashing the plug might appear unresponsive. Give it 5 minutes, remove it from the wall, plug it back in, pair it again. Should be fine now. Make sure you disable automatic checking for OTA updates in zigbee2mqtt, so you don't upgrade to the latest official firmware by mistake again, rendering the whole thing useless.

Thanks. With v.43 and this modified one sp-euc01 only occasionally reports voltage and current. Should it work like this? Power is reported fine as i see.

@wagaman
Copy link

wagaman commented Sep 2, 2024

Aqara pushed v45 through m2 in Europe. Can anyone intercept the update and make the OTA possible? So that we can test whether this bug has been fixed. Thanks.

@TheJulianJES
Copy link

v45 was apparently pushed to the zigbee-ota repo: Koenkk/zigbee-OTA#560
Ideally, it should be confirmed quickly if that version fixes the issue. If not, that PR should be reverted.

@wagaman
Copy link

wagaman commented Sep 21, 2024

Koenkk/zigbee-OTA#560

I updated 8 of my Aqara EU plugs, it seems that the problem that the router plug gets turned off and on by a remote is fixed now. Happy to wait for others' responses.

@Kopetan4egX
Copy link

Koenkk/zigbee-OTA#560

I updated 8 of my Aqara EU plugs, it seems that the problem that the router plug gets turned off and on by a remote is fixed now. Happy to wait for others' responses.

Is it reporting voltage with v. 45 properly? With previous v.43 and after downgrading to v.32 it wasn't. Just randomly changing values occasionally.

@przemekgithub
Copy link

przemekgithub commented Sep 24, 2024

Koenkk/zigbee-OTA#560

Is it reporting voltage with v. 45 properly? With previous v.43 and after downgrading to v.32 it wasn't. Just randomly changing values occasionally.

It is better probably. I updated yesterday during day (not all at the same time). Chart for last two days:
IMG_5159

@Procsiab
Copy link

Hello there, I own a lumi.plug.maeu01 which I too recently updated from the 32 to 45 firmware version; it has been half a day and I did not experience strange behaviours. I will keep an eye on it and come back to give more feedback after a couple of days

@shrx
Copy link

shrx commented Sep 24, 2024

Mine still reports null voltage, same as before the upgrade.

@Procsiab
Copy link

Mine still reports null voltage, same as before the upgrade.

Maybe this made a difference: after the update I found duplicate entries in the reporting section of the device settings (this might be cause by my customisations to the reporting) - I therefore removed the device from the network, then put it in pairing mode, added it back again and tryed it with a hairdryer withe the default settings.

After this "adoption dance" the plug reports voltage and energy as before, however I did not check in between.

@shrx
Copy link

shrx commented Sep 24, 2024

No change after re-pairing unfortunately.

info 2024-09-24 12:46:49MQTT publish: topic 'zigbee2mqtt/socket2', payload '{"auto_off":null,"button_lock":null,"consumer_connected":null,"current":null,"device_temperature":null,"energy":0.01,"led_disabled_night":null,"linkquality":86,"overload_protection":null,"power":167.4,"power_outage_memory":null,"state":"ON","update":{"installed_version":45,"latest_version":45,"state":"idle"},"update_available":false,"voltage":null}'

@Flotteemse
Copy link

Disclaimer: I'm not a pro at this so bare with me....

So two days ago HA (Z2M) told me, that there was a firmware update available for my Aqara SP-EUC01. I happily updated. Since then my two plugs have been insanely unstable. They are offline/unavailable most of the time. See the following screenshot:
image
When I click the "about" section for each of the two plugs it tells me two different firmware dates:
Plug1: Firmware build date 07-19-2024
Plug2: Firmware build date 09-22-2020
BUT when I click the "state" section for each plug it tells me the same: "installed_version": 45

So looks like the have both received the latest firmware which have made them incredibly unstable.
Am I the only one experiencing this? Seems like I need to downgrade the firmware.

@shrx
Copy link

shrx commented Sep 24, 2024

Same here, one is 07-19-2024 the other is 09-22-2020. Neither of them report voltage or current (which was also the case before the firmware upgrade).

@TheJulianJES
Copy link

If upgraded plugs do not report anything, re-pair them to Z2M/ZHA. If it still doesn't work, make sure you're running updated firmware on the coordinator(!), then re-pair again.

@Procsiab
Copy link

For context, as pointed out by TheJulianJES: I am using a Sonoff Zigbee 3 Dongle P, with firmware 20240710 (ZStack).
Also from a map I can see that at the moment my plug is only connected to other routers, and no end device is connected to it.

I cannot think of any other differences right now, but I am willing to help with diagnosing this device if you have suggestions.

@Flotteemse
Copy link

If upgraded plugs do not report anything, re-pair them to Z2M/ZHA. If it still doesn't work, make sure you're running updated firmware on the coordinator(!), then re-pair again.

But it reports values, but then it loses connection for some hours, then reconnects itself and reports values again. Before the firmware update I had no issues with them dropping out. :(

@wagaman
Copy link

wagaman commented Sep 25, 2024

image image

This is with the plug with v45 on my end.

@Kopetan4egX
Copy link

image image
This is with the plug with v45 on my end.

Doesn't look like voltage is reported properly. Or you have VERY stable voltage

@bluemoehre
Copy link

bluemoehre commented Sep 28, 2024

I upgraded a plug from v41 to v45:

  • missing cluster FCC0 - Lumi Specific (in Deconz)
  • no Voltage reported (in Phoscon; never found that property in Deconz anyway)
  • no Current reported (in Phoscon; never found that property in Deconz anyway)
  • wrong value for Power (ignoring multiplier attribute 0x0605 - AC Power Divisor)
  • infrequent display of electrical measurements (in Phoscon)
  • new cluster "Alarms" available

before / after:
Screenshot 2024-09-28 021745 Screenshot 2024-09-28 021806

before / after:
Screenshot 2024-09-28 021930 Screenshot 2024-09-28 022041

before / after + comparison
Screenshot 2024-09-28 123328
Screenshot 2024-09-28 123355
Screenshot 2024-09-28 123047

Maybe there is some new mapping of props required?! Seems still buggy to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working stale Stale issues
Projects
None yet
Development

No branches or pull requests