ZHA - IKEA Styrbar (N2) - Light, Dimming & Color Temp (No Helpers needed!)

I created this blueprint because I wanted a clean, robust, and simple way to control my lights with the IKEA Styrbar (Remote Control N2) using ZHA.

Many existing blueprints are either outdated, broken, or require creating external “Helpers” just to change colors. This version works out-of-the-box and focuses on the essentials: Toggling, Dimming, and switching between Warm/Cold light.

Features:

🚀 Native ZHA: Works directly with Zigbee Home Automation.

💡 On/Off: Short press Up to turn on, Down to turn off.

🔅 Smooth Dimming: Hold Up/Down to dim brightness.

🌡️ Color Temperature:

    Left Arrow: Sets light to Warm White (e.g., 2200K).

    Right Arrow: Sets light to Cold White (e.g., 4000K).

⚙️ Configurable: You can choose your preferred Kelvin values for the Left/Right buttons directly in the automation settings. No code changes needed!

Requirements:

IKEA Styrbar Remote (Remote Control N2)

ZHA Integration

A light that supports dimming (and color temp for the arrows)

How to use:

Import this blueprint.

Create a new automation.

Select your Remote and your Light.

(Optional) Adjust the "Warm" and "Cold" Kelvin sliders to your taste.

Save and enjoy!

blueprint:
name: ZHA - IKEA Styrbar (Dimmer & Color/Färg)
description: >
English:
Simple and stable control for IKEA Styrbar (N2) in ZHA.
- Up (Short): Turn On
- Up (Hold): Dim Up
- Down (Short): Turn Off
- Down (Hold): Dim Down
- Left: Warm White (Configurable)
- Right: Cold White (Configurable)

**Svenska:**
Enkel och stabil styrning för IKEA Styrbar (N2) i ZHA.
- Upp (Kort): Tänd
- Upp (Håll): Dimra upp
- Ner (Kort): Släck
- Ner (Håll): Dimra ner
- Vänster: Varmvitt (Inställbart)
- Höger: Kallvitt (Inställbart)

domain: automation
input:
remote:
name: Remote Control / Fjärrkontroll
description: Select your IKEA Styrbar (Remote Control N2). / Välj din IKEA Styrbar.
selector:
device:
integration: zha
model: Remote Control N2
light:
name: Light / Lampa
description: The light(s) to control. / Lampan som ska styras.
selector:
entity:
domain: light
warm_temp:
name: Warm Color (Left) / Varm Färg (Vänster)
description: Kelvin value for Left arrow. / Kelvin-värde för vänsterpil. (Default/Standard: 2200K)
default: 2200
selector:
number:
min: 2000
max: 4000
step: 100
unit_of_measurement: “K”
mode: slider
cold_temp:
name: Cold Color (Right) / Kall Färg (Höger)
description: Kelvin value for Right arrow. / Kelvin-värde för högerpil. (Default/Standard: 4000K)
default: 4000
selector:
number:
min: 3000
max: 6500
step: 100
unit_of_measurement: “K”
mode: slider

mode: restart
max_exceeded: silent

trigger:

  • platform: event
    event_type: zha_event
    event_data:
    device_id: !input remote

action:

  • variables:
    command: ‘{{ trigger.event.data.command }}’
    args: ‘{{ trigger.event.data.args }}’
    warm_k: !input warm_temp
    cold_k: !input cold_temp

  • choose:

    — ENGLISH: SHORT PRESS UP → TURN ON —

    — SVENSKA: KORT TRYCK UPP → TÄND —

    • conditions: ‘{{ command == “on” }}’
      sequence:
      • service: light.turn_on
        target:
        entity_id: !input light

    — ENGLISH: SHORT PRESS DOWN → TURN OFF —

    — SVENSKA: KORT TRYCK NER → SLÄCK —

    • conditions: ‘{{ command == “off” }}’
      sequence:
      • service: light.turn_off
        target:
        entity_id: !input light

    — ENGLISH: HOLD UP → DIM UP —

    — SVENSKA: HÅLL IN UPP → DIMRA UPP —

    • conditions: ‘{{ command == “move_with_on_off” }}’
      sequence:
      • repeat:
        count: 20
        sequence:
        - service: light.turn_on
        target:
        entity_id: !input light
        data:
        brightness_step_pct: 15
        transition: 0.5
        - delay: 0.5

    — ENGLISH: HOLD DOWN → DIM DOWN —

    — SVENSKA: HÅLL IN NER → DIMRA NER —

    • conditions: ‘{{ command == “move” }}’
      sequence:
      • repeat:
        count: 20
        sequence:
        - service: light.turn_on
        target:
        entity_id: !input light
        data:
        brightness_step_pct: -15
        transition: 0.5
        - delay: 0.5

    — ENGLISH: LEFT ARROW → WARM WHITE —

    — SVENSKA: VÄNSTER PIL → VARMVITT —

    • conditions:
      • ‘{{ command == “press” }}’
      • ‘{{ args[0] == 257 }}’
        sequence:
      • service: light.turn_on
        target:
        entity_id: !input light
        data:
        color_temp_kelvin: ‘{{ warm_k }}’
        transition: 1

    — ENGLISH: RIGHT ARROW → COLD WHITE —

    — SVENSKA: HÖGER PIL → KALLVITT —

    • conditions:
      • ‘{{ command == “press” }}’
      • ‘{{ args[0] == 256 }}’
        sequence:
      • service: light.turn_on
        target:
        entity_id: !input light
        data:
        color_temp_kelvin: ‘{{ cold_k }}’
        transition: 1

    — ENGLISH: RELEASE BUTTON → STOP —

    — SVENSKA: SLÄPP KNAPP → STOPP —

    • conditions:
      • ‘{{ command in [“stop”, “stop_with_on_off”] }}’
        sequence:
      • delay: 0.1

Exactly what I was looking for! Could you please upload the formatted yaml, or a link to it?
Thanks!

Hello Cako,
Welcome to the Home Assistant Forum!

Thanks for contributing to the community with a new Blueprint.

Two problems here.
First, you need to format your code so that it can be understood. How to format code or use the</> key in the post editor.

Second, I have a suggestion for you. Many people who are not familiar with directory structures will have problems installing this without the Home Assistant MY tools.

Adding a MY link for this Blueprint to your top post would help them a lot.

Here is the link to make that.
Create a link – My Home Assistant

You need to be a trust level ‘member’ to edit a post. Understanding Discourse Trust Levels

1 Like