Blueprint: IKEA E2001/E2002 Styrbar Remote Control for Lights (Zigbee2MQTT Compatible)

Thank you for providing this blueprint.
I recently purchased the IKEA Styrbar E2002 dimmer, as my Philips Hue one gave up after years of use.
I had a hard time to find a blueprints which supports the Styrbar with MQTTs actual release.
I looking forward on updates of this blueprint with even more color adjusting possibilities…

Great work …

it would be awesome that we can program the left and right button or add more light entities. i.e. switch scenes with the left and right buttons. Or do some other things.

Edit:
I changed something in your blueprint, so the right button will be a scene switcher.
herefor you need a input switch helper where you put in your scenes you ant to toggle. You can also add multiple lights to control with the styrbar. The right button is connected to the sceneswitcher hard coded. Using !input scene_switcher gave errors.

blueprint:
  name: Styrbar Remote Control for Lights
  description:
    "Provides integration and control for the IKEA E2001/E2002 Styrbar
    remote control. Allows for turning lights on/off, adjusting brightness, and changing
    color temperature. Designed for a Zigbee2MQTT group of light bulbs.

    "
  domain: automation
  input:
    light_entity:
      name: Light Entity
      description: The light to control.
      selector:
        entity:
          domain:
            - light
          multiple: true
    scene_entity:
      name: Scene Entity
      description: The scene to control.
      selector:
        entity:
          multiple: false
    mqtt_device:
      name: Styrbar Remote Control
      description: The IKEA E2001/E2002 remote control.
      selector:
        device:
          multiple: false
    brightness_step:
      name: Brightness Step
      description: Brightness adjustment step (slider percentage, 1-100%).
      default: 5
      selector:
        number:
          min: 1.0
          max: 100.0
          step: 1.0
          unit_of_measurement: "%"
          mode: slider
    delay_ms:
      name: Delay (ms) Between Steps
      description: Delay in milliseconds between brightness adjustment steps.
      default: 300
      selector:
        number:
          min: 100.0
          max: 2000.0
          step: 100.0
          unit_of_measurement: ms
          mode: slider
    transition_seconds:
      name: Transition Time (Seconds)
      description: The duration in seconds for the light transition effect.
      default: 1
      selector:
        number:
          min: 0.1
          max: 9999.0
          step: 0.1
          unit_of_measurement: s
          mode: slider
  source_url: https://github.com/ouhlar/home_assistant/blob/main/blueprints/styrbar_light_remote_control.yaml
trigger:
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: "on"
    id: light_on
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: "off"
    id: light_off
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_left_click
    id: change_color_left
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_right_click
    id: switch_scene
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: brightness_move_down
    id: dim_down
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: brightness_move_up
    id: dim_up
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: brightness_stop
    id: dim_stop
action:
  - choose:
      - conditions:
          - condition: trigger
            id: light_on
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_entity
      - conditions:
          - condition: trigger
            id: light_off
        sequence:
          - service: light.turn_off
            target:
              entity_id: !input light_entity
      - conditions:
          - condition: trigger
            id: switch_scene
        sequence:
          - service: input_select.select_next
            target:
              entity_id: !input scene_entity
          - service: scene.turn_on
            target:
              entity_id: "{{ states('input_select.sceneswitch') }}"
      - conditions:
          - condition: trigger
            id: change_color_right
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_entity
            data:
              kelvin: 2000
      - conditions:
          - condition: trigger
            id: dim_down
        sequence:
          - repeat:
              sequence:
                - service: light.turn_on
                  target:
                    entity_id: !input light_entity
                  data:
                    brightness_step_pct: -{{ states('input.brightness_step') | int(5) }}
                    transition: !input transition_seconds
                - delay:
                    milliseconds: !input delay_ms
              until:
                - condition: trigger
                  id: dim_stop
      - conditions:
          - condition: trigger
            id: dim_up
        sequence:
          - repeat:
              sequence:
                - service: light.turn_on
                  target:
                    entity_id: !input light_entity
                  data:
                    brightness_step_pct: "{{ states('input.brightness_step') | int(5) }}"
                    transition: !input transition_seconds
                - delay:
                    milliseconds: !input delay_ms
              until:
                - condition: trigger
                  id: dim_stop
mode: restart

Hi everybody! Here is a small code enhancement that adds incremental colour temperature adjustment (single click as coarse adjustment as well as continuous press as a little bit more refined increments). Feel free to adopt it if you want - I just feel I have to give something back to the community :slight_smile:

blueprint:
  name: Styrbar Remote Control for Lights - adjusted
  description: >
    Provides integration and control for the IKEA E2001/E2002 Styrbar remote control.
    Allows for turning lights on/off, adjusting brightness, and changing color temperature.
    Designed for a Zigbee2MQTT group of light bulbs.
    Added incremental color temperature adjustment.
  domain: automation
  input:
    light_entity:
      name: Light Entity
      description: The light to control.
      selector:
        entity:
          domain: light
    mqtt_device:
      name: Styrbar Remote Control
      description: The IKEA E2001/E2002 remote control.
      selector:
        device: {}
    brightness_step:
      name: Brightness Step
      description: "Brightness adjustment step (slider percentage, 1-100%)."
      default: 5
      selector:
        number:
          min: 1
          max: 100
          step: 1
          unit_of_measurement: "%"
    delay_ms:
      name: Delay (ms) Between Steps
      description: "Delay in milliseconds between brightness adjustment steps."
      default: 300
      selector:
        number:
          min: 100
          max: 2000
          step: 100
          unit_of_measurement: "ms"
    transition_seconds:
      name: Transition Time (Seconds)
      description: "The duration in seconds for the light transition effect."
      default: 1
      selector:
        number:
          min: 0.1
          max: 9999
          step: 0.1
          unit_of_measurement: "s"

trigger:
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: "on"
    id: light_on
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: "off"
    id: light_off
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_left_click
    id: change_color_left
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_left_hold
    id: change_color_left_hold
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_left_release
    id: change_color_left_release
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_right_click
    id: change_color_right
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_right_hold
    id: change_color_right_hold
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: arrow_right_release
    id: change_color_right_release
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: brightness_move_down
    id: dim_down
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: brightness_move_up
    id: dim_up
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: brightness_stop
    id: dim_stop

variables:
  light_entity: !input light_entity

action:
  - choose:
      - conditions:
          - condition: trigger
            id: light_on
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_entity
      - conditions:
          - condition: trigger
            id: light_off
        sequence:
          - service: light.turn_off
            target:
              entity_id: !input light_entity
      - conditions:
          - condition: trigger
            id: change_color_left
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_entity
            data:
              color_temp_kelvin: "{{ state_attr(light_entity, 'color_temp_kelvin') - 200 }}"
      - conditions:
          - condition: trigger
            id: change_color_left_hold
        sequence:
          - repeat:
              sequence:
                - service: light.turn_on
                  target:
                    entity_id: !input light_entity
                  data:
                    color_temp_kelvin: "{{ state_attr(light_entity, 'color_temp_kelvin') - 100 }}"
                - delay:
                    milliseconds: !input delay_ms
              until:
                - condition: trigger
                  id: change_color_left_release
      - conditions:
          - condition: trigger
            id: change_color_right
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_entity
            data:
              color_temp_kelvin: "{{ state_attr(light_entity, 'color_temp_kelvin') + 200 }}"
      - conditions:
          - condition: trigger
            id: change_color_right_hold
        sequence:
          - repeat:
              sequence:
                - service: light.turn_on
                  target:
                    entity_id: !input light_entity
                  data:
                    color_temp_kelvin: "{{ state_attr(light_entity, 'color_temp_kelvin') + 100 }}"
                - delay:
                    milliseconds: !input delay_ms
              until:
                - condition: trigger
                  id: change_color_right_release
      - conditions:
          - condition: trigger
            id: dim_down
        sequence:
          - repeat:
              sequence:
                - service: light.turn_on
                  target:
                    entity_id: !input light_entity
                  data:
                    brightness_step_pct: "-{{ states('input.brightness_step') | int(5) }}"
                    transition: !input transition_seconds
                - delay:
                    milliseconds: !input delay_ms
              until:
                - condition: trigger
                  id: dim_stop
      - conditions:
          - condition: trigger
            id: dim_up
        sequence:
          - repeat:
              sequence:
                - service: light.turn_on
                  target:
                    entity_id: !input light_entity
                  data:
                    brightness_step_pct: "{{ states('input.brightness_step') | int(5) }}"
                    transition: !input transition_seconds
                - delay:
                    milliseconds: !input delay_ms
              until:
                - condition: trigger
                  id: dim_stop
mode: restart
1 Like

Just implementet Your code (when I found out how to😉) seems to work perfectly - will report back if any issues - ideas
Thanks

Hi,
one question:
How did you implement the code?
I’m actually struggling to do so…

Here You go
I guess You have the ‘Terminal’ option in Your side menu ?
Anyway in here or in any editor do: cd config/blueprints/automation/ouhlar

You can also do the changes in ‘File editor’ just click Your way to /blueprints/automation/ouhlar

Here You find the ‘styrbar_light_remote_control.yaml’

Make a copy: cp styrbar_light_remote_control.yaml styrbar_light_remote_control.yaml.save just for safety
(I’m not sure how to do that in File editor)

You can then replace the current code with the one from above - and remember to restart

Hope this get You further

1 Like

Thanks for this plan.

Good job.

Thanks for your quick reply.
That worked just fine… :+1: