Skip to content

fix(lcdtemphumidsensor_3): resolve humidity divisor when sleeping TS0601 skips Basic read (#1554) - #1559

Merged
JohanBendz merged 1 commit into
develop-0.4.1from
cursor/lcd-humidity-divisor-1554-cf92
Nov 16, 2026
Merged

JohanBendz merged 1 commit into
develop-0.4.1from
cursor/lcd-humidity-divisor-1554-cf92

Conversation

@JohanBendz

Copy link
Copy Markdown
Owner

Summary

Humidity on _TZE200_bjawzodf / TS0601 in lcdtemphumidsensor_3 was reported 10× too high (415 instead of 41.5) after startup. This is #1554. The per-identity scale itself comes from #1474: divisor 10 only for _TZE200_bjawzodf and _TZE200_zl1kmjqx, raw percent for every other identity in this driver.

Cause

onNodeInit learned manufacturerName only from the Basic cluster. It used a cached attribute when one was already present, otherwise it awaited readAttributes(['manufacturerName']). A sleeping TS0601 does not answer that read, so the name stayed undefined.

The divisor was computed once during init: 10 when the name was in the tenth-percent set, otherwise 1. Set.has(undefined) is false, so a missed Basic read left the divisor at 1 for the rest of the session. A later restart while the sensor was awake could complete the read and look normal again. That matches reports of humidity jumping high and occasionally recovering without a re-pair.

The same init-time name gated Tuya time sync. requiresTuyaTimeSync is true only for _TZE200_locansqn, and the timeSync listener was registered only when that flag was already set. A failed Basic read therefore skipped both the listener and the hourly sync in processResponse. The 8-byte UTC/local payload and the timezone offset math are unchanged. #1545 (the _TZE200_locansqn display clock one hour behind) is not part of this change.

Temperature is not identity-specific in this driver. DP1 remains signedValue / 10 for every manufacturer.

Fix

Resolve the manufacturer without waiting on a sleeping device:

  1. this.getSetting('zb_manufacturer_name'), stored by homey-zigbeedriver at pairing
  2. getData().manufacturerName or getData().zb_manufacturer_name
  3. The interviewed ZigBeeNode manufacturerName passed into onNodeInit (and a name already present on the zclNode)
  4. Cached Basic manufacturerName
  5. A live Basic read, started in the background and never awaited during init

The tenth-percent set is unchanged. Only _TZE200_bjawzodf and _TZE200_zl1kmjqx divide humidity by 10. _TZE200_locansqn, _TZE200_bq5c8xfe, _TZE200_qyflbnbj, _TZE200_vs0skpuc, and _TZE200_44af8vyi stay at 1.

If the name is still unknown after init, the divisor stays provisional instead of being frozen at 1. The next datapoint, including the first humidity report, checks the stored sources again. A failed background read is retried once when a later report shows the device is awake; that retry does not delay the sample already being handled. Once a name is known, the divisor and the _TZE200_locansqn time-sync gate are cached for the session.

Tests

test/lcdtemphumidsensor3-humidity-1554.test.js:

  • Basic manufacturerName missing at init, zb_manufacturer_name _TZE200_bjawzodf → divisor 10, so 415 becomes 41.5 (plus offset). No Basic read, and init does not wait on a read that never answers.
  • Name unknown at init, then resolved from settings on the next humidity report, or by a Basic read that completes after init → divisor 10, then cached. A later change of the stored name does not move the divisor.
  • Settings, getData(), the interviewed node, and the Basic cache each keep the existing divisor for all seven identities in this driver, with no Basic read. Temperature stays /10. Time sync is registered only for _TZE200_locansqn.
  • Resolution order is settings, then device data, then the interviewed node, then the Basic attribute cache.
  • An empty or throwing settings/data read falls through. A failed or unknown Basic identity keeps divisor 1 and does not reject init.
  • _TZE200_locansqn time sync is attached from the stored name, and also when that name arrives only after init. The payload remains 8 bytes.

npm test: 214 tests, 211 pass, 0 fail, 3 todo.
npx homey@4.5.0 app build, npm run check:supported-devices, and npx homey@4.5.0 app validate --level publish all succeed. Generated app.json is unchanged.

Open in Web Open in Cursor 

…S0601 skips Basic

The tenth-percent humidity scale was chosen only from a live Basic read at
startup. A sleeping sensor left that name undefined, so the divisor stayed 1
until a later restart. Use the manufacturer name stored at pairing first, and
cache the divisor once the name becomes known.

Co-authored-by: Johan Bendz <JohanBendz@users.noreply.github.com>
@JohanBendz
JohanBendz merged commit cc5e0ec into develop-0.4.1 Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants