deCONZ - IKEA open/close remote

Tags: #<Tag:0x00007fc414aba830>

afab6c04fd6eca872a0dedf3869054af95bc5a0e

blueprint:
  name: deCONZ - Cover control with Tradfri open/close remote
  description: |
    deCONZ - Control a cover with an Ikea Tradfri open/close button remote over deCONZ

    Short press on ☼ button will open the cover.
    Short press on ☰ button will close the cover.
    Long press on ☼ or ☰  will stop the cover.
  domain: automation
  input:
    remote:
      name: Remote
      description: "IKEA open/close remote to use"
      selector:
        device:
          integration: deconz
          manufacturer: "IKEA of Sweden"
          model: "TRADFRI open/close remote"
    cover:
      name: Cover
      description: The cover to control
      selector:
        target:
          entity:
            domain: cover
trigger:
- platform: event
  event_type: deconz_event
  event_data:
    device_id: !input remote
action:
- choose:
  - conditions:
    - '{{ trigger.event.data.command == "up_open" }}'
    sequence:
    - service: cover.open_cover
      target: !input cover
  - conditions:
    - '{{ trigger.event.data.command == "down_close" }}'
    sequence:
    - service: cover.close_cover
      target: !input cover
  - conditions:
    - '{{ trigger.event.data.command in ("stop", "stop_opening", "stop_closing") }}'
    sequence:
    - service: cover.stop_cover
      target: !input cover
mode: restart

Thanks to @seblu

4 Likes

Quick advice: Would be great if could add some tags like “deconz” to your thread! I always these filter to look for blueprints and didn’t find yours… I found it only when I wanted to create a new thread with virtually the same name :smiley:

1 Like

I have an Ikea fyutur blind and the remote it comes with (this Tradfri one), both added to my deconz network. The blind works fine in HA. The remote seems to work (I can see the blue light blinking in the deconz network when I press it).

I’ve added this blueprint, and selected the remote and the blind entity. The blueprint triggers fine when I press the remote but the blind doesn’t respond. How can I troubleshoot this?

@Myx0xx3
When I configured this automations months ago everything worked but now that it’s getting hotter I getting nothing but errors:

2021-05-05 22:52:32 ERROR (MainThread) [homeassistant.components.automation] Blueprint deCONZ - Cover control with Tradfri open/close remote generated invalid automation with inputs OrderedDict([('remote', None), ('cover', 'cover.window_covering_device_4')]): expected a dictionary for dictionary value @ data['action'][0]['choose'][0]['sequence'][0]['target']. Got None
2021-05-05 22:52:32 ERROR (MainThread) [homeassistant.components.automation] Blueprint deCONZ - Cover control with Tradfri open/close remote generated invalid automation with inputs OrderedDict([('remote', None), ('cover', 'cover.light_1')]): expected a dictionary for dictionary value @ data['action'][0]['choose'][0]['sequence'][0]['target']. Got None

Any idea what goes wrong?

Great blueprint but I didn’t achieve to have it running.
I’m using decong add-on ,it may due to that.
deconz_event report for the device is a bit different apparently:
The response don’t contain command with value down_close for instance but numbers like 1002 which is what is explain as well on the HA documentations.

{
    "event_type": "deconz_event",
    "data": {
        "id": "ikea_command",
        "unique_id": "blabla",
        "event": 1002,
        "device_id": "blabla"
    },
    "origin": "LOCAL",
    "time_fired": "blabla",
    "context": {
        "id": "blablabla",
        "parent_id": null,
        "user_id": null
    }
}
1 Like

I changed the blueprint file with this new conditions (+reload automations) and now it works :grinning:

  - conditions:
    - '{{ trigger.event.data.event == 1002 }}'
    sequence:
    - service: cover.open_cover
      target: !input 'cover'
  - conditions:
    - '{{ trigger.event.data.event == 2002 }}'
    sequence:
    - service: cover.close_cover
      target: !input 'cover'
  - conditions:
    - '{{ trigger.event.data.event in (1003, 2003) }}'
1 Like

@Myx0xx3 Looking at my logs and the deconz event I don’t understand how this could work for me last year… Would you mind updating your blueprint? Did deconz somehow updated their API?

If not, which is totally fine, would you @zigomatic mind sharing your blueprint in a new thread? I think we should have a working deconz ikea cover + matching blueprint in the forum! I integrated your event numbers in the blueprints and they are working great!

@pattyland I don’t have any blueprint. I updated this one localy.

I don’t have that knowledge to do a blueprint.