Skip to content

RollerShutter can remain opening/closing if final DONE state frame is missed #682

@mnaggatz

Description

@mnaggatz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions