From a8c0180e41d3ce5af7ac60ffe847a254cfaa12e4 Mon Sep 17 00:00:00 2001 From: Nick DeBoom Date: Wed, 4 Jun 2025 12:52:45 -0500 Subject: [PATCH 1/2] Add Eve MotionBlinds to subdriver Add Eve vid and pid to subdriver to account for position updates while the shade is in motion. --- .../init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua b/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua index b337e31bca..b0877e0d84 100644 --- a/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua +++ b/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua @@ -28,7 +28,8 @@ local StateMachineEnum = { } local SUB_WINDOW_COVERING_VID_PID = { - {0x10e1, 0x1005} -- VDA + {0x10e1, 0x1005}, -- VDA + {0x130a, 0x0055} -- Eve MotionBlinds } local function is_matter_window_covering_position_updates_while_moving(opts, driver, device) From 965b3f665bbdd5fb8369aa58c6dccbae40a2c17b Mon Sep 17 00:00:00 2001 From: Nick DeBoom Date: Wed, 11 Jun 2025 11:12:26 -0500 Subject: [PATCH 2/2] Fix position from being inverted twice There is a bug in the subdriver introduced by a previous PR where the position can be inverted twice in the current status handler, meaning that the windowShade capability could reflect as open when the shade is closed and vice versa. --- .../init.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua b/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua index b0877e0d84..3f451e9e59 100644 --- a/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua +++ b/drivers/SmartThings/matter-window-covering/src/matter-window-covering-position-updates-while-moving/init.lua @@ -66,7 +66,7 @@ local function current_pos_handler(driver, device, ib, response) ) end local state_machine = device:get_field(STATE_MACHINE) - -- When stat_machine is STATE_IDLE or STATE_CURRENT_POSITION_FIRED, nothing to do + -- When state_machine is STATE_IDLE or STATE_CURRENT_POSITION_FIRED, nothing to do if state_machine == StateMachineEnum.STATE_MOVING then device:set_field(STATE_MACHINE, StateMachineEnum.STATE_CURRENT_POSITION_FIRED) elseif state_machine == StateMachineEnum.STATE_OPERATIONAL_STATE_FIRED or state_machine == nil then @@ -90,18 +90,17 @@ local function current_status_handler(driver, device, ib, response) "main", capabilities.windowShadeLevel.ID, capabilities.windowShadeLevel.shadeLevel.NAME ) or DEFAULT_LEVEL - position = reverse_polarity_if_needed(device, position) for _, rb in ipairs(response.info_blocks) do if rb.info_block.attribute_id == clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths.ID and - rb.info_block.cluster_id == clusters.WindowCovering.ID and - rb.info_block.data ~= nil and - rb.info_block.data.value ~= nil then + rb.info_block.cluster_id == clusters.WindowCovering.ID and + rb.info_block.data ~= nil and + rb.info_block.data.value ~= nil then position = reverse_polarity_if_needed(device, math.floor((rb.info_block.data.value / 100))) end end local state = ib.data.value & clusters.WindowCovering.types.OperationalStatus.GLOBAL --Could use LIFT instead local state_machine = device:get_field(STATE_MACHINE) - -- When stat_machine is STATE_OPERATIONAL_STATE_FIRED, nothing to do + -- When state_machine is STATE_OPERATIONAL_STATE_FIRED, nothing to do if state_machine == StateMachineEnum.STATE_IDLE then if state == 1 then -- opening device:emit_event_for_endpoint(ib.endpoint_id, attr.opening())