ZHA - IKEA Tradfri on/off switch (incl dimmer)

Have you tried setting this to another mode? Perhaps “Single”?

If not; not what is happening; can you send me a trace of your zha_event when this is happening?
(Developer tools → Events)

There would need to be a condition that checks to stop dimming when it is meeting a minimum brightnes…

Some bulbs turn off when setting to 1%, or some times even 5% is enough to turn them off completely. Therefor i omittted this.
It can be added, for sure

I will try next time it happens. Though as it is imported as a template, I don’t have an option to change mode.

Okay I’ve listened for zha_event in developer tools while this occured. I got an event upon button press, but no new event when the light turned back on by itself 10sec later.

event_type: zha_event
data:
  device_ieee: bc:33:ac:ff:fe:89:19:00
  unique_id: bc:33:ac:ff:fe:89:19:00:1:0x0006
  device_id: fea0a0456ae6a181222c88871610c8c1
  endpoint_id: 1
  cluster_id: 6
  command: "off"
  args: []
  params: {}
origin: LOCAL
time_fired: "2023-01-22T21:10:41.248810+00:00"
context:
  id: 01GQDN3BB0KYAJ7SXD4S61VKHC
  parent_id: null
  user_id: null

And the Trace timeline:

Like I said, I cannot change mode from restart, because it is an imported blueprint, so home assistant won’t let me change anything.

And here it is from the logbook. (My 5 spots is in a zha group)

Is there anything else I can do?

If you do not see any zha_event, this means there is no action coming from homeassistant (and thus this blueprint/automation) to control that light.

Not sure why your light comes back on…

Hmm okay,
Bu then why does the logbook state both the on and off action are triggered by automation, triggered by event?

Anyways, thank you for the help, I’ll have keep looking for the cause.

Hi, you can try to use this version i posted earlier.

When the remote issues a “stop”, in the old version a “light.turn_on” command was sent. I removed it in this one.

https://gist.github.com/jongdesteven/e267f19575cafbe5fc0d756612717a63

1 Like

Thank you, I will try that. I have just updated all my lights to this blueprint. I’ll report back! :slight_smile:

1 Like

I’ve been facing the same issue. I think the cause lies somewhere on a higher level but until that is fixed, I’ve managed to avoid the issue by removing transition values from the blueprint as shown below.

For example, edit this code:

        sequence:
        - service: light.turn_on
          target: !input 'light'
          data:
            transition: 1
            brightness_step_pct: -10

into:

        sequence:
        - service: light.turn_on
          target: !input 'light'
          data:
            # transition: 1
            brightness_step_pct: -10

Or, if transition value is the only data, remove (or just comment) the whole section like this:

    sequence:
    - service: light.turn_off
      target: !input 'light'
      # data:
        # transition: 1

This Blueprint is working fantastic for me. The only annoying thing are these nasty error-messages that occur every time the remote goes into sleep-mode. Then Ι get 3 warnings, meaning that the 3 variables “endpoint_id, cluster_ic and command” are not assigned with a value. In order to avoid this I customized the Blueprint by adding the “endpoint_id” as an additional criterium to the trigger-section like so:

trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input remote
    endpoint_id: 1

This might not be the best solution but for me it works.

1 Like

FYI I tweaked this to use with my osram zigbee switches and works fantastic. Thank you for the blueprint this was a lifesaver when setting up switches. It probably can be used with any zigbee switch id imagine but it’s worked for all mine.

Tried using this blueprint but HA doesn’t seem to find the “device” when I try to setup automation with this blueprint although it shows in Z2M.
Any ideas why?

Hi, got this blueprint up and running with a Trådfri dimmer. However, one thing is bugging me. When turning on the default brightness is 5%… I’ve tried setting the forced brightness levels up to 100% for both night and day, but still same results. Any ideas?

Having the same problem, looks like it has been discussed a bit previously but still not clear what the issue/fix is… One thing I noticed is when you hold the dimmer it defines the brightness in the device card on HA, but when you just press on it just says ‘on’ in the HA card without the brightness. It’s happening on hue bulbs and ikea bulbs connected via hue bridge.

Remove “transition: 1” from the turn_off action.

First of all, i’ve been using the blueprint for my on/off switch almost daily to switch several basic lights on and off… its been working great and i would like to thank you for that.

Today, i wanted to buy another remote for a specific group of lights.
As i was searching in IKEA, I came to the conclusion they discontinued this switch, but they replaced it with the “RODRET Dimmer”. I’ve edited your blueprint as you explain the model in (line 20), i changed it to model: RODRET Dimmer.
This same blueprint works great for the new remote!
Are you able to change this one blueprint so i can use it for both devices or do you want me to upload it myself? Other blueprints for the new RODRET remote just do actions for switches… i like your blueprint as it is so super simple to set up.

Can you test if this works for you?

blueprint:

It looks like i cannot import it…

I noticed you made a typo, it should be RODRET Dimmer.
However, that still doesnt make it work. thanks for the effort.

"
Invalid blueprint: expected str for dictionary value @ data[‘blueprint’][‘input’][‘remote’][‘selector’][‘model’]. Got None
"

Finally got it working.
The input section should be as this:

  input:
    remote:
      name: Remote
      description: The remote that will control the lights
      selector:
        device:
          filter:
            - integration: zha
              manufacturer: 'IKEA of Sweden'
              model: 'TRADFRI on/off switch'
            - integration: zha
              manufacturer: 'IKEA of Sweden'
              model: 'RODRET Dimmer'

Fixed the gist.

1 Like