IKEA RODRET + SOMRIG + TRADFRI Remotes - ZHA/Z2M - Control anything

Hey,

I’m not sure anything can be done as-is. I’m setting up both zha event and mqtt triggers, so if you dont have any mqtt integration, it’s probably causing this error log as it’s not recognized as a valid trigger in your setup.

The only thing that could be done would be to split the blueprint for ZHA on one hand and Z2M on the other hand, which is not something I’m planning.
If you’re comfortable enough, you could edit the blueprint to remove any reference to mqtt. Be careful though, as if you keep the source_url and reimport the blueprint in the future, all local changes would be overriden.

Thanks, I’ll try to manually remove mqtt although i am new to HA

Had the same errors.
I added # before every section with MQTT or Z2M and the errors dissapeared from the log

Stucking a bit.

I try to get a combo-key with this blueprint.

This here give me almost 100% the right persistent notifications:

alias: WC Automation Schalter
description: ""
use_blueprint:
  path: damru/ikea_E2201-E2213_ZHA-Z2M_control-anything.yaml
  input:
    remote_device: 31c3d27d3b3bb84d73b7e92251888b20
    on_press_action: []
    on_hold_action: []
    on_double_press_action:
      - target:
          entity_id: input_text.last_button_press
        data:
          value: "on"
        action: input_text.set_value
      - target:
          entity_id: input_text.last_press_time
        data:
          value: "{{ now() }}"
        action: input_text.set_value
      - data:
          message: "Double-Press ON erkannt - Zeit: {{ now() }}"
          title: Button Test
        action: persistent_notification.create
    on_double_press_exposed: true
    off_double_press_exposed: true
    off_double_press_action:
      - data:
          message: >
            {% set time_diff = (as_timestamp(now()) -
            as_timestamp(states('input_text.last_press_time'))) | int %} {% if
            time_diff <= 5 and states('input_text.last_button_press') == 'on' %}
              Double-Press OFF innerhalb 5 Sekunden nach ON! ({{ time_diff }} Sekunden)
            {% else %}
              Double-Press OFF, aber nicht in Sequenz ({{ time_diff }} Sekunden seit letztem ON)
            {% endif %}
          title: Button Test
        action: persistent_notification.create
    helper_double_press_delay: 400

So I try to replace / include some real hue lights and the combination (press double on and within 5sec double off) is not working anymore:

alias: WC Automation Schalter
description: ""
use_blueprint:
  path: damru/ikea_E2201-E2213_ZHA-Z2M_control-anything.yaml
  input:
    remote_device: 31c3d27d3b3bb84d73b7e92251888b20
    on_press_action: []
    on_hold_action: []
    on_double_press_action:
      - target:
          entity_id: input_text.last_button_press
        data:
          value: "on"
        action: input_text.set_value
      - target:
          entity_id: input_text.last_press_time
        data:
          value: "{{ now() }}"
        action: input_text.set_value
      - data:
          message: "Double-Press ON erkannt - Zeit: {{ now() }}"
          title: Button Test
        action: persistent_notification.create
      - delay:
          seconds: 5
      - condition: state
        entity_id: input_text.last_button_press
        state: "on"
      - service: light.toggle
        target:
          device_id: 2ce8d590602ed6416ba65221686a1562
    on_double_press_exposed: true
    off_double_press_exposed: true
    off_double_press_action:
      - data:
          message: >
            {% set time_diff = (as_timestamp(now()) -
            as_timestamp(states('input_text.last_press_time'))) | int %} {% if
            time_diff <= 5 and states('input_text.last_button_press') == 'on' %}
              Double-Press OFF innerhalb 5 Sekunden nach ON! ({{ time_diff }} Sekunden)
            {% else %}
              Double-Press OFF, aber nicht in Sequenz ({{ time_diff }} Sekunden seit letztem ON)
            {% endif %}
          title: Button Test
        action: persistent_notification.create
      - choose:
          - conditions:
              - condition: template
                value_template: >
                  {% set time_diff = (as_timestamp(now()) -
                  as_timestamp(states('input_text.last_press_time'))) | int %}
                  {{ time_diff <= 5 and states('input_text.last_button_press') == 'on' }}
            sequence:
              - service: light.toggle
                target:
                  device_id: 3c1ffa5b53410abd26f7b2cfcd04d21d
              - target:
                  entity_id: input_text.last_button_press
                data:
                  value: "none"
                action: input_text.set_value
          - conditions:
              - condition: template
                value_template: >
                  {% set time_diff = (as_timestamp(now()) -
                  as_timestamp(states('input_text.last_press_time'))) | int %}
                  {{ time_diff > 5 or states('input_text.last_button_press') != 'on' }}
            sequence:
              - service: light.toggle
                target:
                  device_id: d0150e3a4d2c83803d32045511eb9a26
    helper_double_press_delay: 400

Is there a reason why?

damru thank you very much for your super blueprint. It works very well, especially the double-click.

I use my rodret in direct bind with various hue lamps.
so now i really like to use the double-click to start different things, in my case the double-click off does a segment cleaning with my dreame x40 running valetudo. The double-click on switches off all the other lamps in the apartment. I love it!

well, in some areas it would be great to be able to open and close the curtains or the front door, for example.

I wondered if it would be possible, if double-click can be realized in blueprint, then why not:

  • on - off
    &
  • off - on

be a pattern that your blueprint can recognize.

I have adapted and extended the code but unfortunately it does not work:

@damru Do you have an idea why it doesn’t work?

For me E2201 z2m double click acts like single. No matter what the delay is.
Lecacy action sensors in z2m settings is disabled.

My E2201s also lost the ability to double-click. All settings end with a single click.

cc @Pitaszek

Did you reimport the blueprint to latest version ?
If so, could you check the execution history for a double press ?

Hi !
I just discovered this blueprint literally half an hour ago, and I want to thank you for it, it’s very well done!
I also got the same issue as Ptica and Routout, a double press event is seen as a single press.
This is the history I got :

trigger: device
domain: mqtt
device_id: 5258bdaf04c12d7c95c60c3d40008a5f
type: action
subtype: 'on'
id: press-on-z2m-e2201

Could it maybe be a bug in Zigbee2MQTT ? I’m running the version 2.0.0-2

I got double click to work by controlling scene with it. When first tried to control one z2m group with one single z2m bulb it acted like single click. But when controlling scene it’s working fine now.

Did you check the Rodret Options > Expose virtual double press “xxx” event
I’m not able to reproduce on my end, running Z2M v2 and everything is fine with double clicks.

You are totally right, I hadn’t seen about that Expose option in the blueprint :slight_smile: It seems to be detected now.


I checked my Zigbee2MQTT settings, but I couldn’t find the ‘Expose virtual double press’ option anywhere. It doesn’t seem to be available for my device.

It’s in the blueprint settings.

I’m still new to HA, as it’s a part of my endless and excruciatingly slow remodel (I suck at being my own General Contractor). I’ve mainly been adding devices at a rapid pace, as my goal is to have everything in my home working within HA.

I bought a ZBT-1 a month ago, but hadn’t used it yet. I was at IKEA yesterday and on my way out I noticed a bunch of IKEA Zigbee devices in the returns/damaged area. I bought several, including a RODRET, which is my first Zigbee controller. After adding it via zha, I tried to develop my first Automation to control a single smart bulb, which was a frustrating, humbling and ultimately failed experience.

I prayed to Google for Enlightenment, and was blessed with the URL to this Blueprint, which is the first HA Blueprint I’ve used.

My first Automation works great! I especially like I was able to enable then configure RODRET up/down double-clicks to jump to full/dim. This is now my ideal physical lighting control.

Thanks!

1 Like

Hey @damru
First of all, thanks for your work.
Blueprint is working fine so far.

Maybe i’d contribute a feature request.
It could be possible to add multiple “triggern” to the automation.
e.g. in my staircase there are 6 rodrets, all doing exactly the same - switching All the staircase lights on/off.
As of now, i need to add 6 automations for that, all independent from each other, so every change inside leads to alot of work editing all automations.
Maybe the blueprint could allow for multiple switches or maybe a group of switches?

Hey

I’m already working on this feature but it’s not fully integrated yet.
I’ll post an update once it’s done. This will most likely be a breaking change, as after updating the blueprint the device selector will allow multiple devices instead of just 1

2 Likes

Hey !

New version is here :rocket:

v2.2.0 :boom: Breaking Changes

  • feat: added TRADFRI on/off switch (E1743), thanks to @yarafie
    :mega: :warning: Files were renamed to reflect the Tradfri support, so in order to update smoothly you should:
  1. import the new blueprint version
  2. open your existing automation
    2.1 Edit in yaml mode
    2.2 Update line 4 from path: damru/ikea_E2201-E2213_ZHA-Z2M_control-anything.yaml to path: damru/ikea_E1743-E2201-E2213_ZHA-Z2M_control-anything.yaml
  • feat!: allow multiple remotes
    :mega: :warning: Please update any automation using these blueprints in order to reselect the remote (and add new ones if needed)

Check the :blue_book: first post to download the blueprint

@damru

Thanks for the update. Unfortunately after updating the blueprint and the automations it doesn’t work anymore.

Can anyone give me feedback if it’s just a problem on my side or not?

For me neither I’ve rolled back to V2.1