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”:
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
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:
-
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
wsdcgdevices. -
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 of245becomes24.5 °C. -
Optionally adds the external alarm and calibration datapointsAdditional
add_dpid_integercalls can mapext_maxtemp,ext_mintemp,ext_temp_sensivitity, andext_temp_calibration, allowing Home Assistant to read and, if supported, write those thresholds and calibration values. -
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.
-
Install the File Editor add‑on
-
Create a folder for Tuya quirks
-
Paste the quirk code
-
Restart Home Assistant
-
A full restart is recommended so
tuya-device-handlerscan discover your new quirk when the Tuya integration initializes.
-
-
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.




