Skip to content
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

driver: tuyaMCU: introduce battery-powered device ack-delay #1497

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blocktrron
Copy link
Contributor

This introduces a delay for sending the ACKs on battery powered TuyaMCU sensors.

Rationale is to allow users to delay the return to sleep state. This is useful when e.g. changing settings on the device.

Currently the device is sent back to sleep after the status has been read and commited to MQTT. This can be less than 5 seconds of uptime.

Set this value to a sane default, which allows the device to retain online for enough time for a user to change configuration.

@openshwprojects
Copy link
Owner

While the generic idea is good, I am not sure if it should be 20 by default. People will not notice it and it will drain battery fast.

Maybe change default value to 0 and also add code to change this value to 20 when a pairing button is pressed, or something like that? I am not sure if I remember correctly, but we had some kind of pair message from tuya battery device received...

This introduces a delay for sending the ACKs on battery powered TuyaMCU
sensors.

Rationale is to allow users to delay the return to sleep state. This is
useful when e.g. changing settings on the device.

Currently the device is sent back to sleep after the status has been
read and commited to MQTT. This can be less than 5 seconds of uptime.

Set this value to a sane default, which allows the device to retain
online for enough time for a user to change configuration.

Signed-off-by: David Bauer <[email protected]>
@blocktrron blocktrron force-pushed the pr-tuya-mcu-battery-ack-delay branch from bb4b45a to b0a0a46 Compare February 3, 2025 11:36
@blocktrron
Copy link
Contributor Author

You seem to be right. I'll look into this and ping you once i have something ready.

@blocktrron blocktrron marked this pull request as draft February 3, 2025 11:36
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