Repository navigation
fix(lcdtemphumidsensor_3): resolve humidity divisor when sleeping TS0601 skips Basic read (#1554) - #1559
Merged
Conversation
…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>
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Humidity on
_TZE200_bjawzodf/ TS0601 inlcdtemphumidsensor_3was 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_bjawzodfand_TZE200_zl1kmjqx, raw percent for every other identity in this driver.Cause
onNodeInitlearnedmanufacturerNameonly from the Basic cluster. It used a cached attribute when one was already present, otherwise it awaitedreadAttributes(['manufacturerName']). A sleeping TS0601 does not answer that read, so the name stayedundefined.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.
requiresTuyaTimeSyncis true only for_TZE200_locansqn, and thetimeSynclistener was registered only when that flag was already set. A failed Basic read therefore skipped both the listener and the hourly sync inprocessResponse. The 8-byte UTC/local payload and the timezone offset math are unchanged. #1545 (the_TZE200_locansqndisplay clock one hour behind) is not part of this change.Temperature is not identity-specific in this driver. DP1 remains
signedValue / 10for every manufacturer.Fix
Resolve the manufacturer without waiting on a sleeping device:
this.getSetting('zb_manufacturer_name'), stored by homey-zigbeedriver at pairinggetData().manufacturerNameorgetData().zb_manufacturer_namemanufacturerNamepassed intoonNodeInit(and a name already present on the zclNode)manufacturerNameThe tenth-percent set is unchanged. Only
_TZE200_bjawzodfand_TZE200_zl1kmjqxdivide humidity by 10._TZE200_locansqn,_TZE200_bq5c8xfe,_TZE200_qyflbnbj,_TZE200_vs0skpuc, and_TZE200_44af8vyistay 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_locansqntime-sync gate are cached for the session.Tests
test/lcdtemphumidsensor3-humidity-1554.test.js:manufacturerNamemissing 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.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._TZE200_locansqntime 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, andnpx homey@4.5.0 app validate --level publishall succeed. Generatedapp.jsonis unchanged.