This blueprint adds the ability to control home assistant covers (blinds) using an Ikea Tradfri button (E1743), connected via zigbee2mqtt.
This is a fork of Zigbee2mqtt - Ikea on/off switch with dimming
The button actions are mapped to cover services as follows:
Short Press ON - (on) - Open Cover
Short Press OFF - (off) - Close Cover
Long Press ON or OFF (brightness_move_up,brightness_move_down) - Stop Cover
blueprint:
name: Ikea on/off button (E1743) cover control
description: 'Control cover with IKEA Tradfri ON/OFF button (E1743).'
domain: automation
input:
button:
name: button
description: Ikea ON/OFF Button (E1743)
selector:
entity:
domain: sensor
cover:
name: Cover
description: Controlled Cover
selector:
target:
entity:
domain: cover
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'button'
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''off'' }}'
sequence:
- service: cover.close_cover
target: !input 'cover'
data: {}
- conditions:
- '{{ command == ''on'' }}'
sequence:
- service: cover.open_cover
data: {}
target: !input 'cover'
- conditions:
- '{{ command == ''brightness_move_down'' }}'
sequence:
- service: cover.stop_cover
data: {}
target: !input 'cover'
- conditions:
- '{{ command == ''brightness_move_up'' }}'
sequence:
- service: cover.stop_cover
data: {}
target: !input 'cover'