🎮 ZHA, deCONZ, Zigbee2MQTT - Ikea 5-button Remote Universal blueprint - all actions + double click events - control lights, media players and more with Hooks

Tags: #<Tag:0x00007f3260a98118> #<Tag:0x00007f3260a9bac0> #<Tag:0x00007f3260a98910> #<Tag:0x00007f3260a9ffa8> #<Tag:0x00007f3260a9fee0>

Blueprint updates will be published on Awesome HA Blueprints . :rocket:
Docs are also fully reported in this post.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Blueprint docs: https://epmatt.github.io/awesome-ha-blueprints/blueprints/controllers/ikea_e1524_e1810

Blueprint URL. Copy this if you want to use this blueprint in your installation: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml

Hi there,

this blueprint combines the features of many other blueprints found on this forum. Citing a few sources:

Huge thanks to the original authors! :fire:

Description

This blueprint provides universal support for running any custom action when a button is pressed on the provided IKEA E1524/E1810 remote controller. Supports remotes integrated with either Zigbee2MQTT, deCONZ or ZHA. Just specify the integration used to connect the remote to Home Assistant when setting up the automation, and the blueprint will take care of all the rest.

In addition of being able to provide custom actions for every kind of button press supported by the remote, the blueprint allows to loop the long press actions while the corresponding button is being held. Once released, the loop stops. This is useful when holding down a button should result in a continuous action (such as lowering the volume of a media player, or controlling a light brightness).

The blueprint also adds support for virtual double button press events, which are not exposed by the controller itself.

Moreover, automations created with this blueprint can be connected with one or more Hooks supported by this controller.

Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

Requirements

(Optional) Zigbee2MQTT

If you plan to integrate the 5-button remote with Zigbee2MQTT, you must have this integration set up. Installation methods differ between different installation types. Check the documentation for this integration for full details on the required hardware and how to set up Zigbee2MQTT on your system.

Zigbee2MQTT Docs

(Optional) ZHA Integration

If you plan to integrate the 5-button remote with ZHA, you must have this integration set up. The integration can be setup from the Home Assistant UI. Check the documentation for this integration for full details on the required hardware.

ZHA Integration Docs

(Optional) deCONZ Integration

If you plan to integrate the 5-button remote with deCONZ, you must have this integration set up. The integration can be setup from the Home Assistant UI and requires an additional container to run deCONZ on. Head over to the documentation for this integration for full details on the required hardware and how to set up deCONZ on your system.

deCONZ Integration Docs

(Optional) Input Text Integration

This integration provides the entity to store the last button event, which is needed when using ZHA to integrate the remote and determining which button has been released. This should be activated by default so unless you tweaked the default configuration you’re good to go.

Input Text Integration Docs

Inputs

See the full list of inputs for this blueprint in the docs.

Available Hooks

Light

  • Up button short press -> Brightness up
  • Up button long press & hold -> Brightness up (continuous, until release)
  • Down button short press -> Brightness down
  • Down button long pres & hold -> Brightness down (continuous, until release)
  • Left button short press -> Color down
  • Left button long press & hold -> Color down (continuous, until release)
  • Right button short press -> Color up
  • Right button long press & hold -> Color up (continuous, until release)
  • Center button short press -> Toggle

Light Hook docs

Media Player

  • Up button short press -> Volume up
  • Up button long press & hold -> Volume up (continuous, until release)
  • Down button short press -> Volume down
  • Down button long pres & hold -> Volume down (continuous, until release)
  • Left button short press -> Previous Track
  • Right button short press -> Next Track
  • Center button short press -> Play/Pause
  • Center button hold -> Stop

Media Player Hook docs

Additional Notes

The reason why a text input is required to store the last long press event when using a remote with ZHA is because of the actions mapping for the controller in ZHA. Natively, the controller doesn’t allow to distinguish between different button release events, so the blueprint must store the previous clicked button, using the text input. Make sure the input text is not altered by any other agents, since this could break the automation.

It’s also important to notice that the controller doesn’t natively support double press events. This blueprint provides virtual double press events by relying on the text input, used to store the last short press event, and a delay, which represents the maximum time gap between the first and second short press required to trigger the virtual double press.

When a double press action is defined for a specific button, clicking the button results in the automation first waiting for the second button press, then, if none is received within the provided delay, executing the short press action.

If a double press action is not set for a specific button, the corresponding single press action will be executed immediately when the button is pressed.

Changelog

  • 2021-02-07: fix an issue which prevented to create automations for ZHA or deCONZ.
  • 2021-02-08: update example, fix an issue which executed actions twice when the remote was connected via Zigbee2MQTT.
  • 2021-02-18: added example for fully controlling a RGB light (thanks @kks36!)
  • 2021-02-21:
    • add support for virtual double press events
    • block automation runs for empty and repeated messages
    • reduce input_text helper writes
  • 2021-03-03: moved the blueprint in the Controllers-Hooks Ecosystem. See announcement here. :tada:

This was a rather complex blueprint to build, so if something is not working as it should please let me know. Any feedback is highly appreciated!

Happy automating to everyone! :fire:

My other blueprints:

8 Likes

Wow @epmatt, this is a fantastic work for a universal solution for the IKEA 5 button remotes. Thank you for your time and effort you put into this!

I can’t test it yet with my remotes since I am waiting for a new zigbee coordinator (the CC2531 won’t register my remotes with ZHA correctly).

I will definitely post back when I receive it and test your blueprint.

1 Like

I wanted to give this a try, but I cannot get it working. I am testing with a 5-button IKEA remote and an IKEA Tradfri LED bulb E27 600lm, dimmable colour and white spectrum opal white. I create a new automation based on your blueprint and when I press SAVE, nothing happens: no message pops up but also no automation is being created.

This is the YAML when I Edit as YAML:

alias: TEST IKEA 5-button Remote 1
description: ''
use_blueprint:
  path: EPMatt/ikea_e1524_e1810_universal.yaml
  input:
    integration: ZHA
    remote: 2db9252e1f360e9a01449e49cd29db3d
    action_center_short:
      - type: toggle
        device_id: df5cd98c623f1b8049489db1899ede92
        entity_id: >-
          light.ikea_of_sweden_tradfri_bulb_e27_cws_opal_600lm_60ea21fe_level_light_color_on_off
        domain: light
    helper_last_loop_event_input: input_text.ikea_5_button_remote_1

This is in the logs:

Blueprint IKEA E1524/E1810 5-button Remote - Universal Support generated invalid automation with inputs OrderedDict([(‘integration’, ‘ZHA’), (‘remote’, ‘2db9252e1f360e9a01449e49cd29db3d’), (‘action_center_short’, [OrderedDict([(‘type’, ‘toggle’), (‘device_id’, ‘df5cd98c623f1b8049489db1899ede92’), (‘entity_id’, ‘light.ikea_of_sweden_tradfri_bulb_e27_cws_opal_600lm_60ea21fe_level_light_color_on_off’), (‘domain’, ‘light’)])]), (‘helper_last_loop_event_input’, ‘input_text.ikea_5_button_remote_1’)]): Entity ID is an invalid entity id for dictionary value @ data[‘entity_id’]. Got None

Is there some error on my part?

I am running hass.io with core-2021.2.1 and supervisor-2021.01.7.

I’m getting the same error as well

Hi @ribbonofblack @kks36,

Thank you for reporting here, I’m sorry for what you experienced. I’ve just updated the blueprint, this issue should be fixed now.

The problem was on how triggers were defined. The state trigger which was used only for Zigbee2MQTT required a valid entity_id, but this is not provided when using ZHA or deCONZ. I moved this to an event trigger which targets state_changed events for the provided remote. Of course if the input is empty, no event will be caught. This is the best fix I came up with, but if anyone has a better solution I’d be happy to hear your voice.

Please reload the blueprint into your HA installation, and let me know if everything runs smoothly. :slight_smile:

Thank you. I saw you had just changed the code on github so I was already testing your new version. Now I can save my automation, but when I push buttons on the remote, the automation is never triggered.

I have another automation (frenck/zha-ikea-five-button-remote-for-lights.yaml). When I enable that automation, it is triggered by my IKEA remote. When I disable that automation and I enable the automation based on your blueprint, that automation never gets triggered by your blueprint.

Thank you for reporting. Could you please try to change these lines in the blueprint and see if it works?

- platform: event
  event_type: '{{ event_type }}'
  event_data:
    device_id: !input 'remote'
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'remote'

Maybe the issue is that the template is not rendered at all, with the result of the trigger being invalid.

Where do I edit the blueprint? I can only create automation or delete it in Configuration > Automations > Blueprints.

Hi @123,

thank you for the suggestion. In the beginning I thought that was the cause, but while I was trying to come up with a solution for the issue I tested a working config both with and without the line-continuation character with a similar action, and the automation seemed to work properly.

You need access to your raw configuration files and edit yaml, for example with the File Editor addon, but no need to do this just to test this blueprint. So don’t worry, I’ve just updated the blueprint on GitHub with the fix, so you can try to reload it and see if it works. :slight_smile:

You’re correct. I just confirmed it by creating a simple automation with a Device Action:

  - type: turn_on
    device_id: fe920d69040743c090d79d0cc00e8c4e
    entity_id: light.hue_color_lamp_4
    domain: light

and manually changed it to this:

  - type: turn_on
    device_id: fe920d69040743c090d79d0cc00e8c4e
    entity_id: >-
      light.hue_color_lamp_4
    domain: light

and it passed Check Configuration and Reload Automations (and the automation worked).

I’ve deleted my previous post to prevent misleading anyone.

Still not working. I am now editing the blueprint directly (/config/blueprints/automation/EPMatt/ikea_e1524_e1810_universal.yaml) and I get an exclamation mark in the editor:

unknown tag !<!input> at line 150, column 36:
      integration: !input 'integration'
                                       ^

[edited]…but maybe that is only a false positive.

Thank you @kks36,
that should not be a issue though, I think that’s a false positive.

Could you please check with the newest version I’ve published on GitHub? Just delete the blueprint and import it again from the UI.

Perfect, thank you for looking into this @123, really appreciate your feedback. :slight_smile:

@ribbonofblack and anyone interested in using this blueprint with ZHA,

@kks36 and I finally managed to find out what the issue was with ZHA. The blueprint has been updated, now it should be working fine. :tada:

Kudos to @kks36 for spending lots of time and energy into this! Without his help I would not have been able to understand where the problem was. Thanks!

1 Like

Perfect. All working now. Thanks for a great blueprint!

1 Like

Got everything working with zigbee2mqtt, remote and Ikea LED bulb, except color change. Zigbee2mqtt logs say “No converter available for ‘color_temp’ (50)”. Any ideas?

Hi @Tomas_Kibirkstis, thank you for reporting here.
Which Ikea bulb are you using? If you can provide an identifier or model number, that could be helpful to try to solve this issue.

Nice to hear that everything runs smoothly now. You’re welcome @ribbonofblack! :slight_smile:

Hi

I just try on deCONZ device and it is working smoothly thank you for your work!

1 Like