MOES SVL01-Z — ZHA quirk

ZHA quirk for MOES SVL01-Z Smart Human Presence Sensor Switch

I’ve created a ZHA quirk for the MOES SVL01-Z presence sensor (_TZE200_llvwkkde, TS0601). The quirk was developed and tested with the 3-button version of the SVL01-Z. However, since the implementation is based on the common Tuya MCU data points rather than the number of physical buttons, it should also work with the 1-button and 2-button variants without modification.

The quirk was developed based on technical documentation provided by MOES, combined with hands-on testing of the actual device and analysis of its Tuya MCU data points.

The implementation exposes all useful functions available from the device, including:

  • Presence
  • Sensitivity
  • Trigger Hold
  • Power-on Behaviour
  • Backlight
  • Auto On
  • Auto Off

The device-specific Tuya MCU cluster defines the corresponding attributes, enums and DP-to-attribute mappings, so the configuration options are available as proper ZHA entities rather than requiring manual Tuya commands.

One unusual part of the implementation

The quirk also performs a delayed Tuya MCU query_data (0x03) request after the cluster is initialized.

This was not added simply as a precaution. During testing it became apparent that after initialization/re-interview the device does not always provide its current DP values to ZHA automatically. As a result, some configuration values could be missing or stale even though the device itself was functioning correctly.

The delayed query gives the Tuya MCU a little time to complete its initialization and then explicitly requests the current DP values. This makes the exposed entities reflect the actual state of the device after initialization and re-interview.

The quirk is working with my SVL01-Z and has been submitted upstream to zigpy/zha-device-handlers:

PR #5293 — Add MOES SVL01-Z Tuya MCU cluster implementation

View the Pull Request #5293

The current quirk source is available here:

View moes_svl01_z.py on GitHub

And the raw Python file can be downloaded directly here:

Download moes_svl01_z.py

The quirk is already working in my installation. Comments, suggestions or corrections are welcome.