bruxy70 / Venetian-Blinds-Control

Control Shutters or Venetian blinds via buttons and MQTT. Use 2 relays (up and down) and 2 binary inputs to independently control position and tilt.
MIT License
44 stars 19 forks source link

Some Blinds do not stop when fully opened #8

Closed DaniEll-AT closed 1 year ago

DaniEll-AT commented 1 year ago

I am using the test-branch. There is one Venetian Blind that does not stop/turn of the relay when fully opened.

config:

cover:
  - platform: venetian_blinds
    name: "Blind-1"
    id: cover1
    open_action:
      - switch.turn_on: relay_1
    open_duration: 42900ms
    close_action:
      - switch.turn_on: relay_2
    close_duration: 43100ms
    tilt_duration: 1100ms
    stop_action:
      - switch.turn_off: relay_1
      - switch.turn_off: relay_2

log:

[10:17:22][D][cover:170]: 'Blind-1' - Publishing:
[10:17:22][D][cover:173]:   Position: 100%
[10:17:22][D][cover:184]:   Tilt: 100%
[10:17:22][D][cover:186]:   Current Operation: OPENING
[10:17:23][D][cover:170]: 'Blind-1' - Publishing:
[10:17:23][D][cover:173]:   Position: 100%
[10:17:23][D][cover:184]:   Tilt: 100%
[10:17:23][D][cover:186]:   Current Operation: OPENING
[10:17:24][D][cover:170]: 'Blind-1' - Publishing:
[10:17:24][D][cover:173]:   Position: 100%
[10:17:24][D][cover:184]:   Tilt: 100%
[10:17:24][D][cover:186]:   Current Operation: OPENING
[10:17:25][D][cover:170]: 'Blind-1' - Publishing:
[10:17:25][D][cover:173]:   Position: 100%
[10:17:25][D][cover:184]:   Tilt: 100%
[10:17:25][D][cover:186]:   Current Operation: OPENING
[10:17:26][D][cover:170]: 'Blind-1' - Publishing:
[10:17:26][D][cover:173]:   Position: 100%
[10:17:26][D][cover:184]:   Tilt: 100%
[10:17:26][D][cover:186]:   Current Operation: OPENING
[10:17:27][D][cover:170]: 'Blind-1' - Publishing:
[10:17:27][D][cover:173]:   Position: 100%
[10:17:27][D][cover:184]:   Tilt: 100%
[10:17:27][D][cover:186]:   Current Operation: OPENING
[10:17:28][D][cover:170]: 'Blind-1' - Publishing:
[10:17:28][D][cover:173]:   Position: 100%
[10:17:28][D][cover:184]:   Tilt: 100%
[10:17:28][D][cover:186]:   Current Operation: OPENING
[10:17:29][D][cover:170]: 'Blind-1' - Publishing:
[10:17:29][D][cover:173]:   Position: 100%
[10:17:29][D][cover:184]:   Tilt: 100%
[10:17:29][D][cover:186]:   Current Operation: OPENING
[10:17:30][D][cover:170]: 'Blind-1' - Publishing:
[10:17:30][D][cover:173]:   Position: 100%
[10:17:30][D][cover:184]:   Tilt: 100%
[10:17:30][D][cover:186]:   Current Operation: OPENING
[10:17:31][D][cover:170]: 'Blind-1' - Publishing:
[10:17:31][D][cover:173]:   Position: 100%
[10:17:31][D][cover:184]:   Tilt: 100%
[10:17:31][D][cover:186]:   Current Operation: OPENING

It seems is_at_target_ does not return true, but I am not experienced enough in c++ to see whats wrong there. I will have a look again later, maybe i can come up with a fix / pull request.

DaniEll-AT commented 1 year ago

Further research has shown: This behaviour is only visible, when close-duration is longer than open-duration. Most of the time this is a misconfiguration (it was in my case), but it has lead me to swapped open- / close-duration assignments in VenetianBlinds::control (@pawelma FYI)

Fixed with #9