This is a blueprint to control shutters (a.k.a cover) with an IKEA on/off switch.
blueprint:
name: Shutter Remote with Ikea Tradfri 2B
description: |
Control a shutter with an Ikea Tradfri two button remote over ZHA
Short press on I button will toggle the shutter state.
Short press on 0 button will stop the shutter.
Long press on I button will open the shutter.
Long press on 0 button will close the shutter.
domain: automation
input:
remote:
name: Remote
description: IKEA 2btn remote to use
selector:
device:
integration: zha
manufacturer: IKEA of Sweden
model: TRADFRI on/off switch
cover:
name: Shutter
description: The shutter to control
selector:
target:
entity:
domain: cover
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- choose:
- conditions:
- '{{ trigger.event.data.command == "on" }}'
sequence:
- service: cover.toggle
target: !input cover
- conditions:
- '{{ trigger.event.data.command == "off" }}'
sequence:
- service: cover.stop_cover
target: !input cover
- conditions:
- '{{ trigger.event.data.command == "move" }}'
sequence:
- service: cover.close_cover
target: !input cover
- conditions:
- '{{ trigger.event.data.command == "move_with_on_off" }}'
sequence:
- service: cover.open_cover
target: !input cover
mode: restart