
The Zhong Sheng (XY) Temperature, Humidity, Barometer is a Chinese three-in-one RS-485 Modbus sensor that exposes ambient temperature, relative humidity and barometric pressure. It sits on the same OEM family as the well-known XY-MD02 temperature / humidity transmitter, extended with a BMP-class pressure chip — but with a non-standard register layout specific to this rebrand.
The TapHome template connects to the sensor over Modbus TCP via an Ethernet-to-RS-485 gateway, not directly. The gateway bridges TapHome Core (LAN) to the RS-485 bus where the sensor lives at a configurable Slave ID. Three readings are exposed — temperature, relative humidity and barometric pressure — each combined with a per-deployment calibration offset (CORTE, CORH, CORBAR).
Hardware connection
The sensor is a Modbus RTU device on RS-485. TapHome Core reaches it over the network through an Ethernet-to-RS-485 gateway (any standard Modbus TCP ↔ RTU gateway is suitable, e.g. USR-TCP232, Waveshare, or an equivalent DIN-rail converter).
| |
RS-485 wiring

The sensor uses a cold-pressed-terminal cable with four wires following the convention of the Seeed S-THP-01A reference (identical pin-out to most XY-series sensors):
| Wire color | Function |
|---|---|
| Red | V+ (power supply, 4.5–18 V DC) |
| Black | GND (power / signal ground) |
| Yellow | RS-485 A+ |
| White | RS-485 B− |
Connect A+ and B− to the matching terminals on the Ethernet-to-RS-485 gateway, and share GND between the sensor, its power supply and the gateway to avoid common-mode issues.

Exact wire colors may differ slightly between OEM batches — always verify against the label on the cable before powering up. Reverse-wiring the power will not damage the sensor (it has reverse-power protection) but the sensor will simply not respond.
For bus runs longer than ~100 m, use twisted-pair cable for
A+/B−and add a 120 Ω termination resistor at the far end of the line. Keep all sensors on the same GND reference.
Enabling Modbus communication
No menu or DIP switches are involved — the sensor ships with Modbus RTU enabled out of the box. The integration is purely about wiring the RS-485 bus, configuring the gateway and providing two values during TapHome import.
RS-485 serial parameters (factory defaults)
The XY-series and the Seeed S-THP-01A reference both leave the factory with the same serial settings. The TapHome template assumes these defaults:
| Setting | Value |
|---|---|
| Baud rate | 9600 bps |
| Data bits | 8 |
| Parity | None |
| Stop bits | 1 |
| Slave address | 1 |
Baud rate and slave address are software-configurable via holding registers on the sensor itself (see the Seeed S-THP-01A user guide, registers 0x0200 / 0x0201, or the XY-MD02 datasheet). The TapHome template intentionally does not expose these registers — changing them from TapHome would break the active connection.
Gateway configuration
Configure the Ethernet-to-RS-485 gateway as a Modbus TCP slave (server) on TCP port 502 that proxies to the underlying RS-485 bus at 9600, 8-N-1. Assign it a static IP address (or a DHCP reservation) so it does not change after a power cycle.
If the gateway supports multiple slave mappings, keep this sensor at Slave ID 1 — it is simpler than rewriting the sensor’s address and matches the template default.
TapHome import parameters
When importing the template in TapHome, provide two values:
| Parameter | Default | Description |
|---|---|---|
| IP address | 192.168.1.0 | IP of the Ethernet-to-RS-485 gateway on the LAN |
| Slave ID | 1 | Modbus address of the sensor on the RS-485 bus |
Module variables — calibration offsets
After import, three module-level variables are available in TapHome → Module Variables for per-deployment calibration. They are applied on top of every raw reading:
| Variable | Default | Unit | Purpose |
|---|---|---|---|
CORTE | 0.5 | °C | Temperature offset added to every raw temperature reading |
CORH | 0.01 | %RH | Humidity offset added to every raw humidity reading |
CORBAR | 17 | hPa | Barometric pressure offset added to every raw pressure reading |
CORBAR = 17is a site-specific altitude correction — it must be re-tuned for every deployment. Leaving it at the factory default will bias every pressure reading by +17 hPa relative to the true local atmospheric pressure. Start withCORBAR = 0and tune against a known reference barometer at the installation altitude.CORTEandCORHshould likewise be verified against a reference thermometer / hygrometer placed next to the sensor.
Device capabilities
The template exposes three read-only sensor devices, all reading holding registers via the gateway:
Temperature
Air temperature from the built-in SHT-family chip, read from H:0 (uInt16) and scaled by raw / 10 + CORTE. Reported in °C with 0.1 °C resolution and ±0.5 °C typical accuracy.
Relative humidity
Relative humidity from the same SHT-family chip, read from H:1 (uInt16) and scaled by raw × 0.001 + CORH. Reported in %RH.
The humidity scaling factor is suspect. A multiplier of
×0.001implies the raw register would hold ≈ 100 000 at 100 %RH, which overflows a 16-bit register (max 65 535). The reference XY-MD02 uses/10and the Seeed S-THP-01A uses/100. The most likely correct formula israw / 10— matching the XY-MD02 convention. Verify readings on real hardware before trusting them; if the reported humidity is clamped or wildly out of range, adjust the template or use a different XY variant.
Barometric pressure
Atmospheric pressure from the built-in BMP-class chip, read from H:4 as a 32-bit unsigned integer (spanning H:4–H:5) and scaled by raw / 100 + CORBAR. Reported in hPa with 0.1 hPa resolution.
The device-level poll interval in the XML template is 1 000 ms for the barometer, which is far too aggressive — atmospheric pressure changes on the order of minutes, not seconds. After import, increase the barometer’s poll interval in TapHome → Device Variables to 15 000–30 000 ms to reduce bus load without losing any useful resolution. The module-level poll interval (30 000 ms) already used by temperature and humidity is a good starting point for the barometer too.
Register map summary
| Register | Parameter | Data type | Scale / offset | Unit | Poll interval |
|---|---|---|---|---|---|
H:0 | Temperature | uInt16 | / 10 + CORTE (0.5) | °C | 30 000 ms (module-level) |
H:1 | Humidity | uInt16 | × 0.001 + CORH (0.01) — verify | %RH | 30 000 ms (module-level) |
H:4–H:5 | Barometric pressure | uInt32 | / 100 + CORBAR (17) | hPa | 1 000 ms (too aggressive) |
The raw
uInt16data type cannot natively represent negative values. On real XY-MD02 hardware, sub-zero temperatures arrive as two’s-complement signed integers. If the sensor is deployed in an environment that regularly falls below 0 °C, verify that negative temperatures are decoded correctly before relying on them.
Troubleshooting
No readings after import
- Ping the gateway IP from the same subnet as TapHome Core — if it does not respond, the issue is on the LAN / power side, not Modbus.
- Confirm the gateway is configured as a Modbus TCP server on port 502, not as a transparent TCP bridge.
- Verify the gateway’s RS-485 serial settings match 9600, 8-N-1 — a mismatch here silently produces timeouts with no readings.
- Check the sensor’s Slave ID matches the value entered during TapHome import (default
1). A second sensor on the same bus with the same address will collide. - Inspect the RS-485 wiring:
A+toA+,B−toB−, shared GND between sensor, power supply and gateway.
Implausible humidity values
The XML template uses a × 0.001 humidity multiplier that is inconsistent with the XY-MD02 family (/10) and the Seeed S-THP-01A reference (/100). If humidity appears stuck near zero or never reaches plausible values, the raw register is likely using the XY-MD02 convention. Cross-check the raw register value with a Modbus debugging tool (e.g. qModbus) against a reference hygrometer; if raw values around 500 correspond to ~50 %RH, the formula should be /10 and the template needs to be corrected.
Pressure reading biased by ~17 hPa
The template default CORBAR = 17 is a legacy site-specific altitude correction. If pressure reads consistently ~17 hPa higher than a nearby reference barometer (e.g. a weather station), set CORBAR to 0 in TapHome → Module Variables and tune against the reference.
High bus load / communication errors
Increase the barometer poll interval from 1 000 ms to 15 000–30 000 ms in TapHome → Device Variables. A 1 Hz poll on a shared RS-485 bus leaves little bandwidth for other slaves and offers no benefit for a barometer.
Negative temperature shows as a huge positive number
The template reads temperature as uInt16. Real XY hardware returns negative temperatures as two’s-complement signed integers — a raw value of 0xFF33 (≈ 65 331) decoded as unsigned becomes ≈ 6 533.1 °C, but should be decoded as −20.5 °C. If the sensor is installed in an environment that can fall below 0 °C, verify the behaviour on real hardware and consider replacing the template with a signed Int16 variant before relying on sub-zero readings.