since 2023.1 I have the following issue with my Aqara Smart Plug (SP-EUC01) and my Philips Hue Dimmer Switch (RWL021)
When the Aqara Smart Plug is off and I press the “On” button on the Hue Dimmer, the Smart Plug turns on, which I don’t want.
In the past 11 months since I’m using the Aqara Smart Plug (I have Hue dimmer round about two years longer), this issue occurred at the beginning, but I had fixed it by installing newer Firmware (ZHA says Firmware: 0x00000029, which is afaik the latest. I also triggered OTA update, but no newer firmware was found or installed).
Is there a way to prevent this issue?
Thanks in advance
A few words about my system:
HAOS (9.4) VM on Proxmox
HA 2023.1.4
SONOFF Zigbee 3.0 USB Dongle Plus with Z-Stack-firmware 20220219
Had a similar problem with my aquara plugs and sonoff buttons, turns out to be a firmware problem described here which can be solved by downgrading the firmware (check bottom of first post)
Since I also use ZHA I then used this guide to apply the modified firmware
I had to use step 4 in the guide and I recommend using the logging configuration to be able to see the progress of the ota transfer (it took quite a while for me).
After waiting a while the plugs just kept flashing red so I repaired them and now they work great!
Mine have reported Firmware: 0x00000029 from the beginning and are still reporting the same after the modified firmware ota update, I think you have to look at “Manager zigbee device” > Clusters > Ota > current_file_version > Read attribute. 41 is the bugged one.
As to why this stopped happening for you and then came back after your update I have no clue but afaik the problem only occurs if the button is routed through the smart plug (which you can see on the network visualization) so maybe it wasn’t routed through your plug before.
No worries, I’ll try to give a step by step rundown of how I did it for ZHA using the resources I linked above.
Make sure you really are running the SP-EUC01 (lumi.plug.maeu01) (not the square US version) and keep in mind that although mine came out fine, applying this modified firmware can brick your plug! Do this at your own risk!
Download or build the modified firmware version 32 zip from this comment https://github.com/Koenkk/zigbee2mqtt/issues/13903#issuecomment-1244720072 , the download and build instructions are collapsed (little icon).
Reason: Downgrades are normally not accepted by the plug so this modification tricks the plug into thinking this is a newer version (Just header information, if successful it will report version 32, meaning you can still “upgrade” it back to 41)
Unzip the download and upload it to a new directory inside HA, I placed my .ota file inside of the /config/zigpy_ota directory I created
Modify your configuration.yaml file to include the following:
Required: (change the otau_directory if you chose a different directory)
logger:
default: info
logs:
homeassistant.components.zha: debug
zigpy: debug
Restart home assistant
If logging has been configured:
If you have a terminal via ssh or UI addon use cat /config/home-assistant.log | egrep 'zigpy.ota|zigpy.util|zigpy.*OTA' to check previous progress or tail -f /config/home-assistant.log | egrep 'zigpy.ota|zigpy.util|zigpy.*OTA' to tail new messages which might be related to the ota update.
If you don’t have a terminal you can check the full logs in Settings > System > Logs > Load full logs and search for “OTA” or “zigpy” but there might be a lot of unrelated messages.
If you see many lines ending in some increasing progress value the update started by itself. Skip step 7.
If the update didn’t start by itself (and mine didn’t either) see step 7.
Manually start the update for each plug: (You can keep the logs open)
7.1 Navigate to the plug and inside the Zigbee info copy the IEEE number
7.2 Issue the following command in Developer Tools > Services: (replace the ieee)
Check the logs again, the ota update should now slowly transfer to the plug. If you didn’t enable logs wait half an hour, the transfer is pretty slow.
After the update mine started to flash red and I had to repair them again (the same way one initially pairs them) but home assistant will recognize them as your existing plugs so your automations shouldn’t be impacted.
Cleanup: Remove or comment out (#) the logging configuration if you don’t want your logs to be spammed by zha and zigpy messages. Remove or move the .ota file so HA doesn’t try to automatically update your plugs in the future since technically the .ota firmware version will always be greater than the reported firmware version.
That’s it! On the plug’s device page you can check “Manager zigbee device” > Clusters > Ota > current_file_version > Read attribute and it should now report 32
Hopefully Aqara will fix this issue in the future via some official firmware update but until then I hope my guide helps!
But I think you misunderstood my second instruction, you can either
A) Download the modified firmware file provided in the comment by TheJulianJES, provided you trust him OR
B) Modify the original v32 ota file yourself. you don’t have to do both!
Or are you trying to compare the files?
In that case I both downloaded the modded version and used the build script and both files ended up being exactly the same.
That being said your build instructions should still have produced a v42 image, was there any Python error?
If your ota file does not produce this very same sha256 hash you likely uploaded the unmodified v32 image to your ota directory
Just in case someone stumbled upon this (very useful) thread and faces the same issues:
I tried in vain to downgrade the firmware but kept seeing in the logs that there was no update available. I assumed the directory with the OTA was not being loaded and was right.
With HomeAssistant 2024.6.1 and thus zigpy 0.64.0, the config should look like this
zha:
zigpy_config:
ota:
advanced_ota_dir: /config/zigpy_ota
allow_advanced_ota_dir: I understand I can *destroy* my devices by enabling OTA updates from files. Some OTA updates can be mistakenly applied to the wrong device, breaking it. I am consciously using this at my own risk.
This configuration field has apparently already been deprecated in the latest zigpy version and advanced ota providers need to be configured.