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

This method worked for me when nothing else did. Pairing near another Ikea router was the key, I think. Thank you!

I have z2m + mqtt running and one somrig and 2 rodrets.
With z2m v2.0 the blueprint says no device found


Would be great to get some advice

edit:
I edited the blueprint and removed the filter and could manually select my rodret.

#         - integration: mqtt
#           manufacturer: IKEA
#           model: RODRET wireless dimmer/power switch (E2201)

image
Nevertheless the filter values are correct

hi, can you explain what you did?

regards

1 Like

I access the configuration/blueprint path and edited the yaml with a text editor:

Perfect.This works.

Tank you!

@damru With z2m in V2 the double press event is also broken. If I click once it is handled as a double click event. Both buttons affected.


Hi,

Thanks for pointing this out.
I did the change in the blueprint, this should be fixed now.

1 Like

Hey,

I tried with my Rodret + Z2M, and could not reproduce your issue.
Did you try lowering the Double press delay ?

1 Like

I will try again

Thanks a lot!
Just yesterday I had the problem, that the Ikea Rodret and the Ledvance mini switches I had just installed, were not accessible by the blueprints I had installed for them. In your blueprint, I was not able to select a device.
Since I am quite new to Z2M, and also new to these switches and to blueprints, I was not sure if this was a configuration problem, and in which part of home assistant.

Some minutes ago, I saw your posting, that you “did the change in the blueprint”, re-imported it, and now it is possible to select a device!

Thank you!

Hopefully the other blueprint for the Ledvance will also be updated to work with Zigbee2MQTT 2.0., I will see how to contact the author.

Single press is still recognized as a double press.
This seems to be a general problem:

The delay is on 300ms (also tested with 100ms) now.

this is that I get in the logs for a single press:

in zigbee2mqtt itself:


info 2025-01-06 09:53:48z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"on","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
info 2025-01-06 09:53:48z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
info 2025-01-06 09:53:48z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
info 2025-01-06 09:53:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"off","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
info 2025-01-06 09:53:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
info 2025-01-06 09:53:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'

in Home Assistant → Addons → z2m → log

[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"on","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
[2025-01-06 09:53:47] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'on'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"off","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1', payload '{"action":"","battery":84,"identify":null,"linkquality":212,"update":{"installed_version":16777303,"latest_version":16777303,"state":"idle"},"update_available":false}'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'
[2025-01-06 09:53:56] e[32minfoe[39m: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rodret1/action', payload 'off'

@damru looks like that the on action appears 6 times instead of just a single hit.

on the other side:

in the logbook the actions do not appear 6 times. They correctly reflected my button presses.

Can you check if you have some legacy option in your configuration.yaml ?
The behaviour on my end is correct.
I also already migrated the blueprint to the new device trigger specification (instead of using action button) a while back.
The only thing different from you that I can see is that I dont have the Action available anymore since migrating to Z2M v2.

1 Like


No “legacy” options in my configuration (also checked the yaml file)

After a HA restart, the action button is gone:
image
And it seems to work now.
Disabling the option breaks the Styrbar E2002 :disappointed_relieved:

Hi,

I setup the automation, all working as expected, but
i get an error in HA logs

================================================
Logger: homeassistant.components.automation.rodret_study
Source: components/mqtt/device_trigger.py:379
integration: Automation (documentation, issues)
First occurred: 12:15:03 PM (26 occurrences)
Last logged: 12:17:41 PM

Error setting up trigger Rodret Study

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/device_automation/trigger.py”, line 65, in async_attach_trigger return await platform.async_attach_trigger(hass, config, action, trigger_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/mqtt/device_trigger.py”, line 379, in async_attach_trigger mqtt_data = hass.data[DATA_MQTT] ~~~~~~~~~^^^^^^^^^^^ KeyError: ‘mqtt’

=====================================================

I only use zha, not mqtt
So, i am wondering why i get this error
Is there anything i can do ?

thanks,

1 Like

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?