zigpy / zha

Zigbee Home Automation
Apache License 2.0
26 stars 23 forks source link

Cover states stays as Opening or Closing when using Set position #247

Open tasomaniac opened 3 weeks ago

tasomaniac commented 3 weeks ago

This issue reopens https://github.com/home-assistant/core/issues/98933 and https://github.com/home-assistant/core/pull/105467 because they were closed before the fix can be merged. And based on the comment here the issue is reopened in this repository.

The problem

In ZHA: when using the set position feature to open or close a cover to a certain percentage, the cover state changes to Opening or Closing and never change to Open when the desired position has been reached.

Workaround

For those who are facing similar issue and if you find this thread, I was able to work around this issue by setting up the below automation. I realized that setting the position to the exact same value fixes the issue. The automation is triggered by opening or closing events and automatically fixes the state after 2 minutes timeout.

alias: Fix Blinds Stuck
triggers:
  - trigger: state
    entity_id:
      - cover.blind_2_cover
      - cover.blind_3_cover
      - cover.blind_4_cover
      - cover.blind_5_cover
    to: opening
    for:
      hours: 0
      minutes: 2
      seconds: 0
  - trigger: state
    entity_id:
      - cover.blind_2_cover
      - cover.blind_3_cover
      - cover.blind_4_cover
      - cover.blind_5_cover
    to: closing
    for:
      hours: 0
      minutes: 2
      seconds: 0
actions:
  - action: cover.set_cover_position
    target:
      entity_id: "{{ trigger.entity_id }}"
    data:
      position: "{{ state_attr('{{ trigger.entity_id }}', 'current_position') | int }}"
mode: single
puddly commented 3 weeks ago

Can you record a debug log of your shutter opening to a specific position, in addition to posting that shutter diagnostics JSON?

tasomaniac commented 3 weeks ago

I will as soon as possible