ZHA - IKEA on/off switch for shutters

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

Hello,
is it possible to make it work with the 2 button tradfri ikea remote? I have them in ZHA but not in blueprint
thanks for sharing your jobimages

You are lucky, I tried to find these buttons but never succeeded.
There is maybe few things to change to my blueprint to make it works. You could already try without the line

          model: TRADFRI on/off switch

This should allow you to select your button and if the command are the same, bingo.

Otherwise, you will need to log the command names from your button to change them in the blueprint.

Regards,

thanks
when you edit in yaml you have only :
alias: Shutter Remote with Ikea Tradfri 2B
description: ‘’
use_blueprint:
path: seblu/zha-ikea-on-off-switch-for-shutters.yaml
If I copy the full code in blueprint , he daesn’t accept it so I can’t try it

I finally bought a IKEA KADRILJ which provides an IKEA open/close remote.
So, I posted a blueprint for it here: ZHA - IKEA open/close remote for covers.

1 Like