More Advanced Control for Aqara E1 Blind Controller with IKEA Tradfri Button

Hi - I’ve got Aqara E1 blind controllers in my living room and all is setup and running great. I successfully managed to add this IKEA Tradfri button to MQTT in HA, and set automations to open and close the 4 blinds/controllers when the user clicks OPEN or CLOSE on the button.

At present the button is pretty “dumb” - you click open and it opens, if you click open again while it’s opening, nothing happens and it just finishes it’s open process (which is expected given how the automation is setup). If you click close while it’s in the process of opening, it reverses course and closes the blinds (again, expected).

I’m wondering how difficult it would be to adjust the behaviour so that when a user clicks open, then once the blind is moving - clicks open again, the blinds stop their operation. Example if you wanted to get the blinds to stop halfway up the windows to block some sun, etc. temporarily. Same for the closing function.

Effectively it would be a process where one clicks open/close and if those buttons are clicked again while in operation, the blinds stop. This is how the native Tradfri blinds work with the button above.

I’ve got two separate automations for opening and closing that are pretty simple:

OPEN BLINDS WITH BUTTON

alias: Open Blinds in Living Room (Button 1)
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 8a4c3a921f035d2449971d3119b66376
    type: action
    subtype: open
    discovery_id: 0x086bd7fffe5db3c5 action_open
condition: []
action:
  - device_id: 07cd78b75ba90ea5071fa5c7bdb3735f
    domain: cover
    entity_id: cover.0x54ef4410004a778e
    type: set_position
    position: 100
  - device_id: e864106b616583d07fae101e9ad64172
    domain: cover
    entity_id: cover.0x54ef44100044ee8f
    type: set_position
    position: 100
  - device_id: b584726446cc843854b86ab33a967fb7
    domain: cover
    entity_id: cover.0x54ef44100044f0ff
    type: set_position
    position: 100
  - device_id: a156f92de78304bd20d99fff7155c36d
    domain: cover
    entity_id: cover.0x54ef4410004a5236
    type: set_position
    position: 100
mode: single

CLOSE BLINDS WITH BUTTON

alias: Close Blinds in Living Room (Button 1)
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 8a4c3a921f035d2449971d3119b66376
    type: action
    subtype: close
    discovery_id: 0x086bd7fffe5db3c5 action_close
condition: []
action:
  - device_id: 07cd78b75ba90ea5071fa5c7bdb3735f
    domain: cover
    entity_id: cover.0x54ef4410004a778e
    type: set_position
    position: 0
  - device_id: e864106b616583d07fae101e9ad64172
    domain: cover
    entity_id: cover.0x54ef44100044ee8f
    type: set_position
    position: 0
  - device_id: b584726446cc843854b86ab33a967fb7
    domain: cover
    entity_id: cover.0x54ef44100044f0ff
    type: set_position
    position: 0
  - device_id: a156f92de78304bd20d99fff7155c36d
    domain: cover
    entity_id: cover.0x54ef4410004a5236
    type: set_position
    position: 0
mode: single

Any pointers or assistance would be hugely appreciated. Thank you!