-
Notifications
You must be signed in to change notification settings - Fork 4k
fix(moes): correct time base for ZHT-SR thermostat and enable automat… #10693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ic local time sync
This PR fixes the incorrect local time offset used by the Moes ZHT-SR (TS0601 / _TZE204_lpedvtvr) smart ring thermostat.
Previously, the device used `timeStart: "2000"`, causing the internal day-of-week calculation to drift and show the wrong weekday after pairing or reboot.
Changes:
- Updated `extend` line to use the correct epoch base:
from: `tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })`
to: `tuya.modernExtend.tuyaBase({ dp: true, timeStart: "1970" })`
- Added `onEvent: tuya.onEventSetLocalTime` to automatically push the current local time when the device (re)joins.
This resolves the persistent "wrong weekday" issue (e.g., device showing Wednesday when it was actually Saturday).
All other exposes and datapoints remain unchanged.
… sync
This PR fixes the incorrect local time offset used by the Moes ZHT-SR (TS0601 / _TZE204_lpedvtvr) smart ring thermostat.
Previously, the device used `timeStart: "2000"`, causing the internal day-of-week calculation to drift and show the wrong weekday after pairing or reboot.
Changes:
- Updated `extend` line to use the correct epoch base:
from: `tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })`
to: `tuya.modernExtend.tuyaBase({ dp: true, timeStart: "1970" })`
- Added `onEvent: (tuya as any).onEventSetLocalTime,` to automatically push the current local time when the device (re)joins.
This resolves the persistent "wrong weekday" issue (e.g., device showing Wednesday when it was actually Saturday).
All other exposes and datapoints remain unchanged.
AudreynHeadburn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed:
onEvent: tuya.onEventSetLocalTime,
to:
onEvent: (tuya as any).onEventSetLocalTime,
src/devices/moes.ts
Outdated
| extend: [tuya.modernExtend.tuyaBase({dp: true, timeStart: "2000"})], | ||
| extend: [tuya.modernExtend.tuyaBase({dp: true, timeStart: "1970"})], | ||
|
|
||
| onEvent: (tuya as any).onEventSetLocalTime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be needed, can you test without?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Koenkk,
I’m a little confused by your comment. The suggested change fixes the incorrect date on the MOES Thermostat. Without this change it won’t work and always syncs the date with Wednesday.
I thought I could help others with my small fix.
Nico
|
Thanks! |
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Koen Kanters <[email protected]>
…ic local time sync
This PR fixes the incorrect local time offset used by the Moes ZHT-SR (TS0601 / _TZE204_lpedvtvr) smart ring thermostat.
Previously, the device used
timeStart: "2000", causing the internal day-of-week calculation to drift and show the wrong weekday after pairing or reboot.Changes:
extendline to use the correct epoch base: from:tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })to:
tuya.modernExtend.tuyaBase({ dp: true, timeStart: "1970" })onEvent: tuya.onEventSetLocalTimeto automatically push the current local time when the device (re)joins.This resolves the persistent "wrong weekday" issue (e.g., device showing Wednesday when it was actually Saturday).
All other exposes and datapoints remain unchanged.
Link to picture pull request: TODO