Skip to content

Instantly share code, notes, and snippets.

@Zuulcode
Last active July 21, 2023 14:11
Show Gist options
  • Save Zuulcode/16b2ffe182fc5160971e767bc8c1eb5c to your computer and use it in GitHub Desktop.
Save Zuulcode/16b2ffe182fc5160971e767bc8c1eb5c to your computer and use it in GitHub Desktop.
IKEA curtain switch
blueprint:
name: IKEA curtain switch
description: A blueprint that allows Ikea curtain switch to be used to open, close and stop blinds, made by Zuul.
domain: automation
input:
switch:
name: Switch
description: The Ikea switch to be used to controll the blinds.
selector:
entity:
domain: sensor
blinds_moving:
name: Blinds moving
description: Create an input_boolean to be used to indicate weather the blinds are currently moving.
selector:
entity:
domain: input_boolean
blinds:
name: Blinds
description: The blinds that will be controlled by the switch.
selector:
entity:
domain: cover
trigger:
- platform: state
entity_id:
- !input switch
to: "open"
id: "open"
- platform: state
entity_id:
- !input switch
to: "close"
id: "close"
- platform: state
entity_id:
- !input blinds_moving
to: "opened"
id: "isOpened"
- platform: state
entity_id:
- !input blinds_moving
to: "closed"
id: "isClosed"
condition: []
action:
- if:
- condition: or
conditions:
- condition: trigger
id: isOpened
- condition: trigger
id: isClosed
then:
- service: input_boolean.turn_off
data: {}
target:
entity_id: !input blinds_moving
else:
- if:
- condition: state
entity_id: !input blinds_moving
state: "on"
then:
service: cover.stop_cover
entity_id: !input blinds
else:
- if:
- condition: trigger
id: open
then:
- service: cover.open_cover
target:
entity_id: !input blinds
- service: input_boolean.turn_off
target:
entity_id: !input blinds_moving
else:
- service: cover.close_cover
target:
entity_id: !input blinds
- service: input_boolean.turn_off
target:
entity_id: !input blinds_moving
mode: restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment