private@homelab: ~/latest
Home Assistant · Zigbee2MQTT · local control
private@homelab:~$ cat guides/article.md
· ·
7–11 minutes
read

Tuya TS0042 2-Button Switch: Zigbee2MQTT & Home Assistant

Pair the Tuya TS0042 two-button switch with Zigbee2MQTT or ZHA, build button-press automations, and check known battery and action-entity quirks first.

If you bought a cheap two-button Zigbee remote to trigger a couple of scenes and the box doesn’t say “Tuya” anywhere on it, that’s normal. The TS0042 is a battery-powered, two-button wireless scene switch that ships under a long list of storefront brand names, and the model string that actually identifies it only shows up once Zigbee2MQTT or ZHA interviews the device during pairing.

Zigbee2MQTT includes a TS0042 converter, and ZHA’s device-handler library includes several TS0042 signatures. A matching unit can reach Home Assistant through your own coordinator without a Tuya account. Record its manufacturer ID and endpoint/cluster signature, because a shared TS0042 model string does not guarantee identical firmware, battery reporting or handler matching.

What the TS0042 actually is

TS0042 is a shared Tuya model string for a two-button, battery-powered wireless scene switch. The Zigbee2MQTT device page names Smart9 S9TSZGB, Lonsonho TS0042 and ClickSmart+ CSPGM2075PW as white labels. The released converter also records Moes ZT-YK02 with manufacturer ID _TZ3000_cllghx1k and Marmitek Push_LO with _TZ3000_dfgbtub0.

Record the manufacturer ID and endpoint/cluster signature as well as the model string. ZHA includes several different TS0042 signatures, so the model alone is not proof of identical firmware or handler matching. Compare the full identification against a support report before applying its workaround. A storefront brand, or a shared _TZ3000_ prefix, is not a complete fingerprint.

It’s an end device, not a router. Like its sibling TS0043, it won’t extend your Zigbee mesh, and it shouldn’t be relied on to relay traffic for anything else on the network.

Because it’s a Zigbee device rather than a Wi-Fi one, the TS0042 also sidesteps the Tuya-cloud local-key requirement that trips people up on Tuya’s Wi-Fi plugs and switches. Pairing goes straight through your Zigbee2MQTT or ZHA coordinator, no Tuya IoT Platform account involved.

Note · compatibility

Supported TS0042 variants have built-in handling. Zigbee2MQTT’s TS0042 entry matches the model string; ZHA’s bundled quirks also match endpoint and cluster signatures. A new signature may require updated support even when the model still reads TS0042.

Pairing and what it exposes

Pairing follows the standard Zigbee join process for a battery device: put the coordinator into pairing mode, hold the button combination the box or included instructions specify (usually a long press on one button), and wait for the interview to complete.

Once paired, the Zigbee2MQTT device page lists action (which button was pressed and how) and battery (percentage). MQTT messages also commonly include linkquality, the received-message link-quality diagnostic; it is not a battery reading. Both buttons support three press types — a short press, a double press, and a hold.

That gives six possible action values, one per button-and-press-type combination: 1_single, 1_double, 1_hold, 2_single, 2_double, 2_hold. Those are the six actions documented for this converter. Automations can combine received events into more elaborate sequences, but they cannot recover an unsupported simultaneous press that the device never reports. The value is also report-only: it appears in the published state when a press happens, with no /get or /set, so do not try to trigger a button action or force a battery report with those MQTT interfaces.

MQTT payload on a button-1 double press
zigbee2mqtt/Living room switch
{
  "battery": 87,
  "linkquality": 60,
  "action": "1_double"
}

Building automations from button presses

Home Assistant automations turn these presses into scene changes. A blueprint can save repetitive setup, but it must match the integration and the events your device actually produces. Zigbee2MQTT uses MQTT device triggers; ZHA’s bundled handlers expose ZHA device triggers/events, which are a different interface.

For Zigbee2MQTT with Home Assistant MQTT discovery enabled, use a device trigger of type action. You don’t need a blueprint to use it. A standard device-based automation trigger works directly:

configuration.yaml
automation:
  - alias: "Living room switch - button 1 short press"
    triggers:
      - trigger: device
        domain: mqtt
        device_id: REPLACE_WITH_YOUR_DEVICE_ID
        type: action
        subtype: 1_single
    actions:
      - action: scene.turn_on
        target:
          entity_id: scene.movie_night

Press each single, double and hold action at least once: Zigbee2MQTT discovers MQTT device triggers after an action is generated. Then use Home Assistant’s device-trigger picker to select the reported action and obtain its real device_id. This example is for configuration.yaml under automation:; an automations.yaml list omits that outer key, and the UI YAML editor uses one automation object. Building it this way rather than templating on an entity’s state also turns out to be the more durable choice, for reasons the next section gets into. And if you’re mapping button presses to Home Assistant scenes rather than Zigbee2MQTT-native scenes, note that the two don’t behave identically.

The battery-reporting quirk

Do not expect a fresh battery percentage immediately after pairing. The current Zigbee2MQTT device page says it can take up to 24 hours to arrive and cannot be read with /get. A working button with a missing battery number is therefore a different symptom from a button that sends no actions.

Issue #6331 is a historical TS0042 report from Zigbee2MQTT 1.17.1-dev in February 2021 where battery values were absent. It is closed; it does not establish a universal unresolved defect in current releases. The converter also records why forced battery-percentage reporting configuration was removed after reports of disconnects and poor battery life. Avoid adding generic reporting changes as a cure without checking the exact fingerprint and current converter.

Warning

If the percentage is missing, stuck or implausible, compare actual action delivery, age of the last report and the manufacturer ID before diagnosing a dead cell. If needed, check the correct battery physically and follow the unit’s replacement instructions. A percentage is an estimate, and an unrelated Tuya sensor’s issue is not evidence of the same fault in this remote.

Check the battery type printed in your unit’s compartment or its exact brand/model manual. Generic TS0042 listings are not enough to establish one cell specification for every enclosure. Do not substitute a differently sized coin cell merely because a discussion of a related switch says it fits.

When there’s no action entity in Home Assistant

A missing text action sensor does not mean the switch has failed. In issue #23089 (Zigbee2MQTT 1.38.0-1, June 2024), the reporter’s MQTT log already contained 1_single and 2_single. Issue #25948 describes missing action entities after Zigbee2MQTT 2.0.0. Those are versioned reports; the current integration documentation is the better guide to which Home Assistant interface to use.

Note · before you re-pair

Press a button while watching Zigbee2MQTT’s log or MQTT state. If the expected action arrives, that press reached the coordinator and converter. Check MQTT discovery and Home Assistant’s device triggers next. This does not certify every radio link or the remaining battery life, but it makes re-pairing an unhelpful first response to a missing sensor entity.

The current Zigbee2MQTT guidance recommends MQTT device triggers. Enable Home Assistant discovery with homeassistant.enabled: true, ensure Home Assistant has its MQTT integration connected to the same broker, then generate each action once so its trigger can be discovered.

Event entities are an optional, experimental alternative, enabled with homeassistant.experimental_event_entities: true. They are not a required fix for TS0042, and their event types/attributes can change. Inspect the actual entity attributes before building an automation. The older action-sensor route uses homeassistant.legacy_action_sensor: true, but it is deprecated and the project recommends device triggers instead.

For ZHA, select the device’s short, double or long-press triggers in Home Assistant. The released TS0042 handlers define these for endpoints 1 and 2 across several signatures. They translate Tuya-specific press commands; they do not establish standard on/off binding support to a bulb. Use coordinator/Home Assistant automations unless your exact variant documents a working direct-binding mode. A TS0042 label alone is insufficient proof that binding will work.

TS0042 vs. TS0043: which one to buy

The decision mostly comes down to how many distinct actions you need from one physical remote.

TS0042 TS0043
Buttons 2 3
Distinct action values 6 (2 buttons x 3 press types) 9 (3 buttons x 3 press types)
Zigbee2MQTT / ZHA support Bundled handling for supported fingerprints; verify signature Bundled handling for supported fingerprints; verify signature
Best for A single room or a simple two-scene toggle (e.g. “movie mode” / “normal”) Multi-scene rooms, or splitting control across more than two states

If two clearly-defined states cover what you actually want to trigger, the TS0042 is the simpler physical object to mount and remember. If you find yourself wanting a third scene, the TS0043 covers that without changing the underlying setup pattern.

FAQ

Why is my TS0042’s battery stuck at 100% or not updating? A first report can take up to 24 hours, and older TS0042 reports describe missing values. Check report age, exact manufacturer/signature and action delivery; do not assume a current universal bug or a dead battery from the percentage alone.

What’s the difference between the TS0042 and TS0043? The standard converter entries expose two buttons/six actions and three buttons/nine actions respectively: single, double and hold per button. Check the identified variant rather than transferring a storefront listing’s claims.

Does the TS0042 work as a Zigbee router or repeater? It is a battery remote/end device and is not a mesh extender. Choose a supported mains-powered router to relay traffic for other devices.

My TS0042 has no action entity in Home Assistant. Is it broken? First check whether Zigbee2MQTT receives an action. If it does, check MQTT discovery and generate the press once to create its device trigger. An optional experimental event entity is another interface; a legacy text action sensor is no longer the recommended one.

Can I use the same automation blueprint for every TS0042, regardless of brand? Use a blueprint for your integration and confirm the reported actions/signature. Zigbee2MQTT and ZHA blueprints are not interchangeable, and one known TS0042 fingerprint does not guarantee that every rebranded variant matches.

What this piece verified

Checked on 24 October 2026 against Zigbee2MQTT’s TS0042 reference and Home Assistant integration guide, the TS0042 converter implementation, zha-device-handlers 2.3.0 and the linked original issue reports. The documented six MQTT actions, report-only battery/action properties, current device-trigger recommendation and ZHA’s signature-specific press mappings are supported by those sources.

No physical remote was paired or tested. Battery behavior, pairing button sequence and direct-binding capability still need the exact unit’s instructions and fingerprint. Reports concerning TS0203 or TS0041 are not treated as proof of a TS0042 defect, and no universal CR2032/alternative-cell specification is inferred from a related product.

local-firstHome Assistantno-cloud