Getting stats from Aqara Smart Socket.
How to Get Monitoring Stats from an Aqara Smart Plug EU Version to Home Assistant via a Sonoff Zigbee Coordinator
If you’ve been struggling to get monitoring stats like power usage and voltage from your Aqara smart plug (EU version) visible in Home Assistant, you’re not alone. The problem often lies with outdated firmware on the Sonoff Zigbee coordinator. While the controls for turning the plug on and off may work fine, the coordinator’s old firmware version could be preventing it from transmitting monitoring stats.
In my case, I was using a SONOFF ZigBee 3.0 USB Dongle that I purchased from Amazon. After some troubleshooting, I discovered that the issue was outdated firmware. Here’s how I identified and resolved the problem:
Identifying the Firmware Issue
Check the Firmware Version:
Go to Home Assistant Settings → Devices and search for the coordinator. Mine was listed as "Texas Instruments CC2652."
Click on the coordinator’s entry to view the device info. You’ll find the firmware version listed there. For example, it might look like this:
Firmware: Z-Stack 20210710
.The date in the version number (e.g., 20210710) indicates the firmware’s release date—in this case, July 10, 2021, which is quite outdated.
Updating the Firmware
Here are the steps I followed to update the firmware on my Sonoff Zigbee coordinator. Note: I used a Windows system.
1. Install Required Tools
SRecord: Download here
Python: Download here
Git: Download here
Texas Instruments Flash Programmer: Download here
2. Download the Latest Firmware
Visit the Z-Stack firmware repository.
Look for the package corresponding to your device, named "SONOFF Zigbee 3.0 USB Dongle."
Download the package, e.g.,
CC1352P2_CC2652P_launchpad_*.zip
, and extract it.
3. Convert the Firmware File
Open PowerShell as an administrator.
Navigate to the SRecord directory:
cd "C:\Program Files\srecord\bin"
Copy the extracted hex file to this folder.
Run the following command to convert the hex file to binary (replace the filenames with the ones you downloaded):
.\srec_cat.exe ".\CC1352P2_CC2652P_launchpad_coordinator_20240710.hex" -intel -o CC1352P2_CC2652P_launchpad_coordinator_20240710.bin -binary
4. Enable Bootloader Mode on the Coordinator
Clone the required Git repository:
git clone https://github.com/Nerdiyde/Sonoff_zigbee_3.0_USB_dongle_plus_bootloader_script.git
Navigate to the repository folder:
cd .\Sonoff_zigbee_3.0_USB_dongle_plus_bootloader_script\
Install Python dependencies:
pip install pyserial pip install gevent
Run the bootloader script:
python uartLog.py
The output will look similar to this:
This is a debug log This is an info log This is critical An error occurred COM3 - Silicon Labs CP210x USB to UART Bridge (COM3) Select the serial port (just enter the number of the serial port):
Select the correct COM port when prompted (e.g., enter "3" if it’s listed as COM3).
5. Flash the Firmware
Open the Texas Instruments Flash Programmer tool.
Find the Sonoff Zigbee coordinator in the list of connected devices (e.g., "Silicon Labs CP210x USB to UART Bridge").
Select the IC used on the coordinator (e.g., CC2652P) from the dropdown menu labeled "Select Target Device..."
Choose the binary firmware file you created earlier with SRecord by clicking the browse button.
Check the boxes for:
Erase
Program
Verify
Click the play button to flash your device! The progress bar should display "Success" at the end.
Conclusion
After completing the firmware update, I was able to see power usage and voltage stats from the Aqara smart plug in Home Assistant. Updating the firmware not only resolved this issue but also ensured better compatibility and performance with other Zigbee devices.
If you encounter any issues during the process, double-check each step and ensure all tools are installed correctly. Happy automating!