Skip to content

Instantly share code, notes, and snippets.

@krillerdk
Last active May 19, 2023 11:41
Show Gist options
  • Save krillerdk/b5e9f8eaa2c9fd842a6941e8265e7e2d to your computer and use it in GitHub Desktop.
Save krillerdk/b5e9f8eaa2c9fd842a6941e8265e7e2d to your computer and use it in GitHub Desktop.
Ikea E1743 cover automaion with window open detection
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
window_sensor:
name: Window sensor
description: Optional sensor to prevent closing when the window is open
default: []
selector:
entity:
filter:
device_class: opening
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- choose:
- conditions:
- '{{ trigger.event.data.command == "on" }}'
- condition: state
entity_id: !input window_sensor
state: "off"
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" }}'
- condition: state
entity_id: !input window_sensor
state: "off"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment