Interlock_wait_time not working

I’m using ESPHome on Shelly 2.5 to control window roller shutters and interlock_wait_time doesn’t work for me. Or maybe I’m just confused.

Take a look at config below. I setup interlock_wait_time: 5000ms and if I understand it right - it should wait 5000ms between switching OPEN and CLOSE relays?

switch:
  - platform: gpio
    id: open_relay
    name: Shelly 2.5 Open Relay
    pin: GPIO15
    restore_mode: RESTORE_DEFAULT_OFF
    interlock: &interlock_group [open_relay, close_relay]
    interlock_wait_time: 5000ms

  - platform: gpio
    id: close_relay
    name: Shelly 2.5 Close Relay
    pin: GPIO4
    restore_mode: RESTORE_DEFAULT_OFF
    interlock: *interlock_group
    interlock_wait_time: 5000ms

The problem happens when shutter is moving UP, and I click CLOSE button - then CLOSE relay is switched ON immediately (so no 5000ms delay) and OPEN relay is switched OFF right after that.

[07:37:39][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:39][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:40][D][binary_sensor:036]: 'Shelly 2.5 Open Button': Sending state ON
[07:37:40][D][cover:078]: 'Blind' - Setting
[07:37:40][D][cover:086]:   Position: 100%
[07:37:40][D][switch:013]: 'Shelly 2.5 Open Relay' Turning ON.
[07:37:40][D][switch:037]: 'Shelly 2.5 Open Relay': Sending state ON
[07:37:40][D][binary_sensor:036]: 'Shelly 2.5 Close Button': Sending state OFF
[07:37:40][D][cover:172]: 'Blind' - Publishing:
[07:37:40][D][cover:175]:   Position: 0%
[07:37:40][D][cover:188]:   Current Operation: OPENING
[07:37:40][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.06468 A with 2 decimals of accuracy
[07:37:40][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:40][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.58413 A with 2 decimals of accuracy
[07:37:40][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:41][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.58264 A with 2 decimals of accuracy
[07:37:41][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:41][D][cover:172]: 'Blind' - Publishing:
[07:37:41][D][cover:175]:   Position: 2%
[07:37:41][D][cover:188]:   Current Operation: OPENING
[07:37:41][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.58332 A with 2 decimals of accuracy
[07:37:41][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:42][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.58190 A with 2 decimals of accuracy
[07:37:42][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:42][D][sensor:124]: 'Shelly 2.5 Voltage': Sending state 246.35919 V with 1 decimals of accuracy
[07:37:42][D][cover:172]: 'Blind' - Publishing:
[07:37:42][D][cover:175]:   Position: 3%
[07:37:42][D][cover:188]:   Current Operation: OPENING
[07:37:42][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.58170 A with 2 decimals of accuracy
[07:37:42][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:42][D][binary_sensor:036]: 'Shelly 2.5 Open Button': Sending state OFF
[07:37:42][D][binary_sensor:036]: 'Shelly 2.5 Close Button': Sending state ON
[07:37:42][D][cover:078]: 'Blind' - Setting
[07:37:42][D][cover:086]:   Position: 0%
[07:37:42][D][switch:013]: 'Shelly 2.5 Close Relay' Turning ON.
[07:37:42][D][switch:017]: 'Shelly 2.5 Open Relay' Turning OFF.
[07:37:42][D][switch:037]: 'Shelly 2.5 Open Relay': Sending state OFF
[07:37:42][D][switch:017]: 'Shelly 2.5 Close Relay' Turning OFF.
[07:37:42][D][switch:017]: 'Shelly 2.5 Open Relay' Turning OFF.
[07:37:42][D][cover:172]: 'Blind' - Publishing:
[07:37:42][D][cover:175]:   Position: 4%
[07:37:42][D][cover:188]:   Current Operation: IDLE
[07:37:42][D][main:706]: Malfunction detected. Relay welded.
[07:37:42][I][current_based.cover:074]: 'Blind' - Malfunction detected during closing. Current flow detected in open circuit
[07:37:43][D][sensor:124]: 'Shelly 2.5 Open Current': Sending state 0.01773 A with 2 decimals of accuracy
[07:37:43][D][sensor:124]: 'Shelly 2.5 Close Current': Sending state 0.01773 A with 2 decimals of accuracy

As you can see from logs, there is no delay between OPEN/CLOSE relays and it results in the malfunction detection. I expect first to close relay that is opened and then open another relay that is closed with interlocking…?

When I add delay manually it works as expected and there is no malfunction detected:

- platform: gpio
    pin:
      number: GPIO5
    id: close_button
    name: Shelly 2.5 Close Button
    on_press:
      then:
        - cover.stop: blind
        - delay: 1s
        - cover.close: blind

But this solution doesn’t seem to be right - and this will cover only physical switch. It won’t cover open/close via HA UI.

Looking at the documentation it seems it should work like you think. (i.e a bug)
Try opening a issue over at https://github.com/esphome/issues/issues and see if you can get some help.

1 Like