ZHA - IKEA TRADFRI - 5 Button Remote - Custom Actions

Check out this blueprint to simulate the IKEA TRADFRI Remote (5 button version) through ZHA events with your own custom actions.

Button Action
Power (short) User defined action
Dim-Up (short) User defined action
Dim-Down (short) User defined action
Right (short) User defined action
Left (short) User defined action
Power (long) User defined action
Dim-Up (long) User defined action
Dim-Down (long) User defined action
Right (long) User defined action
Left (long) User defined action

Get started

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

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

Or import this Blueprint by using the Gist URL:
https://github.com/niro1987/homeassistant-config/blob/master/blueprints/automation/niro1987/zha_ikea_tradfri_5button_remote_custom.yaml

Buy Me A Coffee

11 Likes

Great Blueprint, very useful.
Is there a way to have a smoother dimmering of lights, maybe keeping the button pressed instead of press it several times until the desired power?
Thanks a lot!

1 Like

Hi @Brunelma

I’ve made some similar blueprints that already have dimming included with half a second transition.

You might like on of these:
ZHA - IKEA TRADFRI - 5 Button Remote - Color Lights
ZHA - IKEA TRADFRI - 5 Button Remote - Warm White Lights

1 Like

Hi @niro1987,

Thanks for your reply.
I saw the other Blueprints, anyhow the Custom Action one allows a lot of more freedom on controls, including controlling different lights with Dimmer and arrow buttons.
Is it possible to have a smooth transition on dimmering in this blueprint as well?
Thanks a lot, again great job.

Hi @Brunelma,

While this is possible, it wouldn’t make much sense to create a blueprint for such a specific purpose. You could dig into the YAML of this automation and modify the sequence on each button as you want it to be.

@Brunelma Reading back on this - Yes, there is a way to get smooth transition in this blueprint but because everything is basically a single action, you’ll need to use the choose-hack.

Basically, you add a Choose action and remove the condition that was added by default. Now, in the default section, you add an action that increases the brightness with a short transition time (say 1 second), followed by a delay action for that same transition time.

The YAML would looks something like this:

choose: []
default:
  - service: light.turn_on
    data:
      transition: 1
      brightness_step_pct: 10
    target:
      entity_id: light.woonkamer
  - delay:
      seconds: 1
2 Likes

@niro1987

Great Blueprint mate, well done!

1 Like

Thanks! I though the middle (“power”) button would only allow short presses. And indeed, if I associate an action to the “Power (long)” button, nothing happens. Am I missing something?

1 Like

You can listen for zha_event in Developer Tools > Events. The Long-Press on the Power Button is triggered by a move_to_level_with_on_off command. If you see that passing by, it’s not the blueprint :wink:

Also, you can track the execution of the automation from the automations page.

OK, thanks (I’m new to HA, I was not implying it’s your blueprint’s fault! :stuck_out_tongue: )

I looked into the history of that automation (I hadn’t “discovered” that section yet, thanks for the tip!), and for the long press (move_to_level_with_on_off) it reports “This node was not executed and so no further trace information is available.”.

If I do a long press, a short press (toggle) is reported in the history instead… :thinking:

Any ideas?

How long is long? Keep it pressed 5 seconds. It should report a short-press, followed by a long-press and finally a release (if you do ever let go that is).

I see, maybe I was not pressing it long enough. All events are captured… but as you say/expected, it reports a short press first, then the long press and finally the release… which means (?) that the short press user defined action will always be run before long-press user defined action…?

Yes, that is inevitable

I have the opposite problem. I can do a long press, but not short one. Mine is integrated via deCONZ.

This Blueprint is ment for ZHA. I have no experience with deCONZ.

1 Like

No worries. I’ve changed over to ZHA. So I’ll give the blue print a run shortly. Thanks.

I use and love this blueprint, so thank you for it ! I can finally map all of the 5 buttons.

Too bad you are forced to execute the short press action in every situation before the long press action though. I used to work with the frenck blueprint for this remote, and i miss its ability to execute only the long press actions though.

EDIT : This short/long press issue only happens with the main ON/OFF button. Totally works for the other buttons. Thank you !!

I understand the problem with the short-press action. I do not see how this could be improved as the remote itself sends a short-press action when you hold it down. It is only after a few seconds that the remote sends the “ooh wait, I am still being pressed” action.

One solution would be to wait for this second command and only execute the short press if it does not come, but that would make for a very laggy experience on the short-press.

I´m connecting to my Ikea remote through the Ikea hub. Is this blueprint still applicable for that situation or is this only for ppl who are using a ZHA dongle?

Only for ZHA. With the IKEA bridge, the remote is not directly connected with the bridge, always through a light.