–Add device
- After the Zigbee device
_TZE204_wwaeqnrfTS0601
is connected to HA, it does not support four-way independent control by default. It is necessary to customize ZHAQuirk to achieve independent access to each switch. - Enable ZHA (ZigbeeHomeAutomation) integration in HomeAssistant and confirm that the device has joined HA through the Zigbee gateway.
–Install necessary add-ons
- Install the necessary add-ons Advanced SSH & Web Terminal and File editor in the add-on store. Open the add-on store and search for Advanced SSH & Web Terminal and File editor.
- After installing Advanced SSH & Web Terminal, turn off the protection mode and set the ssh password in the configuration. After configuration, click Start
The preparation of Advanced SSH & Web Terminal is now complete.
5. Install File editor, then click Display in the sidebar, and then click Start.
—Install configuration file
-
Open the File editor, create a new folder named: zha_quirks, and then upload the provided “switch_customization.py” file to the zha_quirks directory. After uploading, add a new configuration in the “configuration.yaml” file
zha:
enable_quirks: true
custom_quirks_path: /config/zha_quirks -
After configuration, restart homeassistant to load Quirk
After completing file placement and path configuration, restart HomeAssistant, re-add the device or restart the added device
ZHA will recognize it as 4 independentlight
entities, such as:
<light.tze204_wwaeqnrf_ts0601_deng_guang
light.tze204_wwaeqnrf_ts0601_deng_guang_2
light.tze204_wwaeqnrf_ts0601_deng_guang_3
light.tze204_wwaeqnrf_ts0601_deng_guang_4>
At this time, four switches can be controlled
But the modified name of each switch cannot be synchronized to the device.
–Install custom components to synchronize entity names to devices
- Install the “zha_namehook” custom component
8.1 Open the “custom_components” folder through the File editor and upload the provided ‘zha_namehook’ file.
8.2 Configureconfiguration.yaml
and add a new line “zha_namehook:” to the file. The purpose of configuring this line is to set
up the automatic start of the name modification monitoring plug-in
8.3 After restarting homeassistant, new components appear in the integration
- Modify the zha source code to allow the sending of string type data. To modify the zha source code, you need to enter docker and must use the previously installed Advanced SSH & Web Terminal.
-Open Advanced SSH & Web Terminal and execute ‘docker exec -it homeassistant bash’
-Enter ‘cd /usr/local/lib/python3.13/site-packages/zhaquirks/tuya/mcu’
-Enter ls to display the current files, and you will see a file named init.py
After the modification is completed, restart HA
- Modify the switch name
-Enter HA entity settings and name the 4 light entities separately, such as:
ight.tze204_wwaeqnrf_ts0601_deng_guang ->living room lamps
light.tze204_wwaeqnrf_ts0601_deng_guang_2 ->room
light.tze204_wwaeqnrf_ts0601_deng_guang_3 ->smart
light.tze204_wwaeqnrf_ts0601_deng_guang_4 ->zemismart
-hanamehook component will automatically detect name changes and send them to the hardware device via DP