Skip to content

Zigbee window treatment: extend step timeout, use input step component - #3319

Open
hcarter-775 wants to merge 2 commits into
mainfrom
zigbee-window-treatment-step-fixes
Open

hcarter-775 wants to merge 2 commits into
mainfrom
zigbee-window-treatment-step-fixes

Conversation

@hcarter-775

Copy link
Copy Markdown
Contributor

Description of Change

Extend the timeout for Zigbee blind step to 120 to account for very slow blinds that do not update their state frequently, so that incremented steps (via scrolling or contiguous button presses) are counted as part of the same movement for a longer period of time.

Summary of Completed Tests

Tests updated.

…ponent

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

zigbee-window-treatment_coverage.xml

File Coverage
All files 96% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/yoolax/init.lua 97% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/sombra/init.lua 95% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/hanssem/init.lua 91% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/axis/axis_version/init.lua 97% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/aqara/curtain-driver-e1/init.lua 92% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/lazy_load_subdriver.lua 57% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/window_shade_utils.lua 94% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/VIVIDSTORM/init.lua 93% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/aqara/aqara_utils.lua 93% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/aqara/init.lua 90% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-window-treatment/src/aqara/version/can_handle.lua 83% ❌

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 1373f85

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Test Results

   73 files    545 suites   0s ⏱️
3 318 tests 3 318 ✅ 0 💤 0 ❌
5 318 runs  5 318 ✅ 0 💤 0 ❌

Results for commit 1373f85.

♻️ This comment has been updated with latest results.

local LATEST_TARGET_LEVEL = "_latestTargetLevel"
-- Timeout in seconds for the stateless step accumulation window
local TARGET_LEVEL_TIME_OUT_SECONDS = 15
local TARGET_LEVEL_TIME_OUT_SECONDS = 120

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems excessively long. What blinds actually take 2 minutes to move through their full range? Was this from a testing situation?

@hcarter-775 hcarter-775 Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It definitely can take over a minute, especially to go 0-100 -- to clarify, if the device reaches the final state, it will stop this timer. So it really is just a backup, catchall. I recall Ikea takes a long time. This is mostly cleanup while investigating improvements while I'm doing Zwave.

end
local timer = device.thread:call_with_delay(TARGET_LEVEL_TIME_OUT_SECONDS, function(d)
device:set_field(LATEST_TARGET_LEVEL, nil)
device:set_field(TARGET_LEVEL_TIME_OUT, nil)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place the target timeout and target level is cleared. You should clear it from the open, close, preset, and setShadeLevel handlers also (which is what matter does). Its needed to avoid a situation where subsequent commands dont have stale data.

Example (all within the 2 min window):

  1. Step +10 from 50-60
  2. close command
  3. report level 0
  4. step +10; expected to move to 10, but moves to 70 instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matter is much more comprehensive, I agree. I put a lot of work into making that driver tick in tune, haha. However, I do not think adding a bunch of handling like that is particular helpful, as the case you described is fairly unlikely in my opinion. I would prefer to track something like you're describing, a more comprehensive state-tracking system, in some kind of follow up. One big difference of Matter, for example, is that there aren't 10 subdrivers that might override open/close, etc in various ways. This basically is just a cleanup commit, to actually nil out what should be unset anyway, but just wasn't.

@CLAassistant

CLAassistant commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

3 participants