During live testing with a Somfy roller shutter, the KLF200 sent a valid movement sequence when opening and closing the shutter.
For example, when opening from 100 % to 0 %, the sequence was:
GW_COMMAND_SEND_CFM: ACCEPTED
GW_NODE_STATE_POSITION_CHANGED_NTF: current=100 %, target=0 %, state=NOT_USED
GW_COMMAND_RUN_STATUS_NTF: run_status=EXECUTION_ACTIVE
GW_COMMAND_REMAINING_TIME_NTF: seconds=17
GW_NODE_STATE_POSITION_CHANGED_NTF: current=100 %, target=0 %, state=EXECUTING
...
GW_COMMAND_RUN_STATUS_NTF: run_status=EXECUTION_COMPLETED
GW_SESSION_FINISHED_NTF
GW_NODE_STATE_POSITION_CHANGED_NTF: current=0 %, target=0 %, state=DONE
pyvlx correctly marks the device as moving when it receives the EXECUTING state frame. It only clears is_opening / is_closing when a later GW_NODE_STATE_POSITION_CHANGED_NTF indicates that the movement has stopped, e.g. state=DONE with current_position == target.
However, in Home Assistant I observed that the same Somfy roller shutter can remain stuck in opening for a long time after the physical movement has already completed. This can happen if the final GW_NODE_STATE_POSITION_CHANGED_NTF with state=DONE is missed or delayed. In that case, pyvlx may already have received GW_COMMAND_RUN_STATUS_NTF with run_status=EXECUTION_COMPLETED, and later heartbeat/status requests may report the correct final MP position, but the movement flags are not cleared from those frames.
Suggested fix:
When NodeUpdater.process_frame_status_request_notification() handles a FrameStatusRequestNotification for an OpeningDevice and receives:
- a concrete
NodeParameter(0) / MP position
run_status != RunStatus.EXECUTION_ACTIVE or specifically RunStatus.EXECUTION_COMPLETED
then pyvlx should update the position and also clear is_opening / is_closing, including state_received_at and estimated_completion.
This would let heartbeat/status request recovery bring the entity back from opening / closing to a stable state even if the final house-monitor DONE frame was missed.
During live testing with a Somfy roller shutter, the KLF200 sent a valid movement sequence when opening and closing the shutter.
For example, when opening from 100 % to 0 %, the sequence was:
pyvlx correctly marks the device as moving when it receives the
EXECUTINGstate frame. It only clearsis_opening/is_closingwhen a laterGW_NODE_STATE_POSITION_CHANGED_NTFindicates that the movement has stopped, e.g.state=DONEwithcurrent_position == target.However, in Home Assistant I observed that the same Somfy roller shutter can remain stuck in
openingfor a long time after the physical movement has already completed. This can happen if the finalGW_NODE_STATE_POSITION_CHANGED_NTFwithstate=DONEis missed or delayed. In that case, pyvlx may already have receivedGW_COMMAND_RUN_STATUS_NTFwithrun_status=EXECUTION_COMPLETED, and later heartbeat/status requests may report the correct final MP position, but the movement flags are not cleared from those frames.Suggested fix:
When
NodeUpdater.process_frame_status_request_notification()handles aFrameStatusRequestNotificationfor anOpeningDeviceand receives:NodeParameter(0)/ MP positionrun_status != RunStatus.EXECUTION_ACTIVEor specificallyRunStatus.EXECUTION_COMPLETEDthen pyvlx should update the position and also clear
is_opening/is_closing, includingstate_received_atandestimated_completion.This would let heartbeat/status request recovery bring the entity back from
opening/closingto a stable state even if the final house-monitorDONEframe was missed.