Fixing Tuya’s “Tem&Hum Sensor with Probe” in Home Assistant with a Custom Quirk

Some Tuya temperature and humidity sensors with an external probe only expose the internal temperature to Home Assistant via the official Tuya integration.
The external probe clearly works in the Tuya app and appears in the Tuya IoT Platform as ext_temp (DP 101), but Home Assistant never creates an entity for it.

To solve this, we built a custom Tuya quirk using the tuya-device-handlers library that Home Assistant already uses internally for normalizing Tuya devices.
This quirk teaches Home Assistant about the extra datapoints on the device so it can expose the external temperature (and optional probe-related settings) as entities.


Why this quirk was needed

The specific device is a Tuya “Tem&Hum Sensor with Probe”:

  • Tuya category: wsdcg

  • Product ID: m7kacaxrxbxeegfs

In the Tuya IoT Platform logs, the device reports additional datapoints for the probe, including:

  • ext_temp (DP 101) – external probe temperature

  • ext_maxtemp (DP 102) – external high-temperature alarm limit

  • ext_mintemp (DP 103) – external low-temperature alarm limit

  • ext_temp_sensivitity (DP 104) – probe temperature sensitivity

  • ext_temp_alarm (DP 105) – alarm mode

  • ext_temp_calibration (DP 106) – calibration offset

However, Home Assistant’s diagnostics and the official Tuya integration only showed:

  • Internal temperature (va_temperature)

  • Humidity (va_humidity)

  • Battery state (battery_state)

The probe temperature simply did not exist in Home Assistant, which makes the device far less useful for monitoring freezers, tanks, or remote locations where the external sensor matters most.


How the quirk was built

Home Assistant’s Tuya integration uses a small library called tuya-device-handlers that defines “quirks” – Python snippets mapping raw Tuya datapoints (DPs) into structured, typed entities.

For this sensor, we created a quirk file that:

  1. Targets the device by product ID

    python
    .applies_to(product_id="m7kacaxrxbxeegfs")

    This ensures the quirk only applies to this exact Tuya product, not all wsdcg devices.

  2. Adds the external probe datapoint as an integer temperature sensor

    python
    .add_dpid_integer( dpid=101, # ext_temp dpcode="ext_temp", # or another mapped temperature code dpmode=DPMode.READ, unit="℃", min=-200, max=1000, scale=1, step=1, )

    The range and scaling mirror the internal temperature definition (va_temperature), so a raw value of 245 becomes 24.5 °C.

  3. Optionally adds the external alarm and calibration datapointsAdditional add_dpid_integer calls can map ext_maxtemp, ext_mintemp, ext_temp_sensivitity, and ext_temp_calibration, allowing Home Assistant to read and, if supported, write those thresholds and calibration values.

  4. Registers the quirk in the global registry

    python
    .register(TUYA_QUIRKS_REGISTRY)

    This makes the quirk discoverable by the Tuya integration at startup.

The end result is a small, self-contained Python file that instructs Home Assistant how to interpret DP 101–106 as proper temperature and configuration entities instead of ignoring them.


Installing the quirk in Home Assistant (File Editor method)

You don’t need to modify Home Assistant’s core files. Instead, you install the quirk as a custom Tuya quirk in your /config directory, similar to how custom ZHA quirks are used.

  1. Install the File Editor add‑on

    • Go to Settings → Add-ons → Add-on Store.

    • Install File Editor (or use Studio Code Server if you prefer).

  2. Create a folder for Tuya quirks

    • In File Editor, open /config.

    • Create a new folder, for example:
      tuya_quirks

    • Inside this folder, create a new file, for example:
      wsdcg_bf0376ec16496a5b0apzxs.py (the filename can be anything; the content is what matters).

  3. Paste the quirk code

    • Paste the Python quirk code for your probe sensor into that file – the DeviceQuirk() builder, the add_dpid_integer for DP 101 and any other probe DPs you want, and .register(TUYA_QUIRKS_REGISTRY) at the end.

    • Save the file.

  4. Restart Home Assistant

    • A full restart is recommended so tuya-device-handlers can discover your new quirk when the Tuya integration initializes.

  5. Reload or re-add the Tuya device

    • In Settings → Devices & Services → Tuya, click Reload or remove and re-add the specific device to force Home Assistant to rebuild entities based on the updated quirk.


Using the new external temperature entity

After the restart and reload, the Tuya device should expose an extra temperature sensor entity, typically named something like:

  • sensor.tem_hum_sensor_with_probe_external_temperature
    or

  • sensor.tem_hum_sensor_with_probe_ext_temp

You can now:

  • Add it to dashboards just like any other sensor.* entity.

  • Use it in automations (for example, to alert if a fridge goes above 8 °C).

  • Log and graph it over time in the History and Statistics views.

Note that many Tuya battery-powered sensors only send updates when temperature changes by a certain threshold or at specific intervals, so you may not see rapid updates from the probe.


Conclusion

By combining Home Assistant’s official Tuya integration with a small custom quirk in tuya-device-handlers, we can unlock hidden datapoints like the external temperature probe on the “Tem&Hum Sensor with Probe.”
The process is lightweight—just a single Python file in /config/tuya_quirks edited via the File Editor add‑on—and turns an “almost right” sensor into a fully usable probe for serious temperature monitoring in Home Assistant.

Recommended products1

%s ...
%s
%image %title %code %s