Matter Window Covering: Fix shades that get stuck opening/closing#3050
Matter Window Covering: Fix shades that get stuck opening/closing#3050tpmanley wants to merge 1 commit into
Conversation
|
Invitation URL: |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against b5f19e1 |
NoahCornell
left a comment
There was a problem hiding this comment.
LGTM, but would wait for one of the true matter driver dogs to approve before merging.
| device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.opening() or windowShade.closing()) | ||
| elseif state ~= 0 then -- unknown | ||
| elseif state == 0 then -- not moving; schedule a read to resolve final state if no position report arrives | ||
| schedule_position_read(device, ib.endpoint_id) |
There was a problem hiding this comment.
maybe we can just call a refresh command here instead of this unique call?
| schedule_position_read(device, ib.endpoint_id) | |
| driver:inject_capability_command(device, { | |
| capability = capabilities.refresh.ID, | |
| command = capabilities.refresh.commands.refresh.NAME, | |
| args = {} | |
| }) |
Then we wouldn't need this extra logic (which basically repeats itself anyway) at all.
Oops, this would still probably go in the "schedule" function, just in place of the read, we could do a refresh.
|
Looks like several tests are failing on 60. |
As reported in https://community.smartthings.com/t/smartwings-shades-matter-over-thread-stuck-on-opening-and-closing/309925 and thanks to the analysis done by @ldeora, it seems some shades get stuck in an opening or closing state. This attempts to fix this by starting a timer when the shade reports that it stopped moving. If a lift or tilt report is received then it cancels the timer. If the timer fires (meaning a lift or tilt report was not received within the timeout) then it will do a read of lift and/or tilt to determine the current position and update the windowShade state. Resolves: #3043
931af02 to
b5f19e1
Compare
These errors were on a different driver and went away when I rebased on latest main branch |
|
I have created a PR that attempts to solve this in a different way, without adding relatively slow timers that have the ability to complicate handling (by adding time into the mix!). |
As reported in https://community.smartthings.com/t/smartwings-shades-matter-over-thread-stuck-on-opening-and-closing/309925 and thanks to the analysis done by @ldeora, it seems some shades get stuck in an opening or closing state. This attempts to fix this by starting a timer when the shade reports that it stopped moving. If a lift or tilt report is received then it cancels the timer. If the timer fires (meaning a lift or tilt report was not received within the timeout) then it will do a read of lift and/or tilt to determine the current position and update the windowShade state.
Resolves: #3043
Check all that apply
Type of Change
Checklist
Summary of Completed Tests
I have not had a chance to test this with a real device yet and won't be in a position to for some time. Would appreciate some help testing.