Kojima SPB-ZGB-W Button (ZHA) - Single/Double/Long Press with Debounce

KoMi Kojima SPB-ZGB-W Button Blueprint (ZHA)

This blueprint provides full support for the KoMi Kojima SPB-ZGB-W Zigbee button connected via ZHA. It handles single, double, and long press actions with configurable debounce protection.

:bullseye: Features

  • Single click (command: toggle)
  • Double click (command: on)
  • Long press (command: off)
  • Configurable debounce (0.1 - 2.0 seconds) to prevent accidental double-triggering
  • Device filtering - only shows compatible devices in the selector
  • Clean implementation - filters out attribute_updated events at trigger level

:package: Requirements

  • Home Assistant 2026.8.0 or later
  • ZHA integration
  • KoMi Kojima SPB-ZGB-W button (Tuya TS004F, manufacturer: _TZ3000_wc3gjyp3)

:wrench: Installation

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or manually import using this URL:

https://gist.githubusercontent.com/alex-demon/03bfdb25f21d1fe7b6268fe145f23a54/raw/e699c68c8151ab8e91576b4ac692148995fb7ace/kojima-spb-zgb-w.yaml?spm=a2ty_o01.29997173.0.0.13e055fbXGjRJf&file=kojima-spb-zgb-w.yaml

:light_bulb: Usage

  1. Go to Settings → Automations & Scenes → Blueprints
  2. Click Import Blueprint and paste the URL above
  3. Create a new automation from this blueprint
  4. Select your KoMi Kojima SPB-ZGB-W button device
  5. Configure actions for single, double, and long press
  6. Adjust debounce delay if needed (default: 0.3s)

:magnifying_glass_tilted_left: Technical Details

This blueprint uses three separate triggers with trigger.id for clean event filtering. It specifically ignores attribute_updated events that Tuya devices generate alongside actual button commands, ensuring reliable operation.

The debounce is implemented using mode: single with a configurable delay at the end of the action sequence, which is the recommended Home Assistant approach for preventing rapid re-triggering.

:bug: Troubleshooting

Button not showing in device selector?

  • Verify your device manufacturer is exactly _TZ3000_wc3gjyp3
  • Verify your device model is exactly TS004F
  • Check in Settings → Devices & Services → ZHA → [Your Device]

Actions not triggering?

  • Check the automation trace to see which command is being received
  • Some firmware versions may use different commands - adjust the blueprint accordingly

:page_facing_up: Source Code

Available on GitHub Gist

:memo: Changelog

v1.0 (2026-09-01)

  • Initial release
  • Support for single/double/long press
  • Configurable debounce protection
  • Device filtering by manufacturer and model