šŸŽ® ZHA, deCONZ, Zigbee2MQTT - IKEA E2001/E2002 STYRBAR Remote control Universal blueprint - all actions + double click events - control lights, media players and more with Hooks

Hi,
No problem :slight_smile:

Iā€™m not fully sure about this either.
HSL White is 0%,0%,100%

Maybe it has something to do with the ā€œ% 360ā€ but Iā€™m not entirely sure how it works.

Hi,

That has also been a great mystery to me, I had never seen it.
In the end, doing tests I discovered that it is a limiter of the previous calculation. Adding +15 comes a time when 375 comes out, but with ā€œ%360ā€ the resulting value is 360.

My current idea is to add a new mode, to be able to select the colors I want to add.

    light_color_mode:
      name: (Optional) Light color mode
      description: Specify how the controller will set the light color. Choose "Color Temperature" and "Hue - Saturation" depending on the features supported by your light. If you are not sure you can select "Auto". "None" will disable color control features.
      default: Auto
      selector:
        select:
          options:
            - Auto
            - Color Temperature
            - Hue - Saturation
            - Color list
            - None

Right now Iā€™m creating the scripts to see how I do it, and when I have it working, Iā€™ll comment on it in case you want to add it to the hook

1 Like

Hi all,

Iā€™m having trouble calling the light.turn_on service from this template, it is a simple turn_on light service. Iā€™ve tried the same code via the developer tools and it works fine but when executing this automation I get the error below.

Iā€™m using Z2M and the latest version of the blueprint posted by @LewisSpring

image

Im a new user so I can post only one embedded image but in Traces ā†’ Step Details the entity_id doesnt seem like it is getting passed down?

Hi,

In the end I see that it is easier to modify the control of raising and lowering the colors.
About the list maybe in the future.

I have solved it by modifying the up and down lines, putting these:
lines 550 and 592:
hs_color: '{%- if state_attr(light,"hs_color")[0] >= 345 -%} [5,5] {%- else -%} {{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }} {%- endif -%}'

lines 567 and 620:
hs_color: '{%- if state_attr(light,"hs_color")[0] =< 15 -%} [355,5] {%- else -%} {{ [((state_attr(light,"hs_color")[0] or 0) - 15) % 360, 100] }} {%- endif -%}'

If you want, you have complete freedom to add this modification to the code.
In my case it was important, since the LED strip illuminates my daughterā€™s room, and the white color was essential.

Ok I got there at the endā€¦I did see all the requirements but I completely disregarded creation of an input text helper. Once itā€™s been added it all started working.

I do have a question about brightness increase/decrease, is it suppose to go all the way down or up while holding the button? For me it only goes two steps and then button needs to be released and held again. Is this intended?

HI,

I have a new version so I can use the color [0,0].
It works for me in the template, but when I pass it to the yaml, it gives an error.

hs_color: >
  '{%- if state_attr(light,"hs_color")[0] <= 345 or state_attr(light,"hs_color") == (0,0) -%}
    {{ [((state_attr(light,'hs_color')[0] or 0) + 15) % 360, 100] }}
  {%- else -%}
    [0,0]
  {%- endif -%}'
hs_color: >
  '{%- if state_attr(light,"hs_color")[0] >= 15 or state_attr(light,"hs_color") == (0,0) -%}
    {{ [((state_attr(light,'hs_color')[0] or 0) - 15) % 360, 100] }}
  {%- else -%}
    [0,0]
  {%- endif -%}'

And finally, the first version with the write color on the cicle:

blueprint:
  name: Hook - Light
  description: "# Hook - Light\n\nHook automation which allows to control a light.
    Supports brightness and color control both for white temperature and rgb lights.
    Features may vary depending on the selected Controller.\n\nAn automation created
    with this blueprint must be linked to a [Controller](https://epmatt.github.io/awesome-ha-blueprints/blueprints/controllers)
    automation.\nControllers are blueprints which allow to easily integrate a wide
    range of controllers (wall switches, remotes, dimmers, etc.) and use them to run
    a set of actions when interacting with them.\nThey expose an abstract interface
    used by Hooks to create controller-based automations.\n\nA list of controllers
    supported by this hook is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks/light#supported-controllers).\n\n\U0001F4D5
    Full documentation regarding this blueprint is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks/light).\n\n\U0001F680
    This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints)
    project**.\n\nā„¹ļø Version 2022.07.30\n"
  source_url: https://github.com/lsismeiro/awesome-ha-blueprints/blob/8eea61897a42930390ac2f92582db1bd3665adda/blueprints/hooks/light/light.yaml
  domain: automation
  input:
    controller_device:
      name: (Required) Controller Device
      description: The controller device which will control the Light. Choose a value
        only if the integration used to connect the controller to Home Assistant exposes
        it as a Device. This value should match the one specified in the corresponding
        Controller automation.
      default: ''
      selector:
        device: {}
    controller_entity:
      name: (Required) Controller Entity
      description: The controller entity which will control the Light. Choose a value
        only if the integration used to connect the controller to Home Assistant exposes
        it as an Entity. This value should match the one specified in the corresponding
        Controller automation.
      default: ''
      selector:
        entity:
          domain:
          - sensor
          multiple: false
    controller_model:
      name: (Required) Controller model
      description: The model for the controller used in this automation. Choose a
        value from the list of supported controllers.
      selector:
        select:
          options:
          - IKEA E1524/E1810 TRƅDFRI Wireless 5-Button Remote
          - IKEA E1743 TRƅDFRI On/Off Switch & Dimmer
          - IKEA E1743 TRƅDFRI On/Off Switch & Dimmer (#2)
          - IKEA E1744 SYMFONISK Rotary Remote
          - IKEA E1766 TRƅDFRI Open/Close Remote
          - IKEA E1766 TRƅDFRI Open/Close Remote (#2)
          - IKEA E1812 TRƅDFRI Shortcut button
          - IKEA E2001/E2002 STYRBAR Remote control
          - IKEA E2001/E2002 STYRBAR Remote control (#2)
          - IKEA ICTC-G-1 TRƅDFRI wireless dimmer
          - OSRAM AC025XX00NJ SMART+ Switch Mini
          - Philips 324131092621 Hue Dimmer switch
          - Philips 8718699693985 Hue Smart Button
          - Philips 929002398602 Hue Dimmer switch v2
          - SONOFF SNZB-01 Wireless Switch
          - Xiaomi WXCJKG11LM Aqara Opple 2 button remote
          - Xiaomi WXCJKG12LM Aqara Opple 4 button remote
          - Xiaomi WXCJKG12LM Aqara Opple 4 button remote (#2)
          - Xiaomi WXCJKG13LM Aqara Opple 6 button remote
          - Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#2)
          - Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#3)
          - Xiaomi WXKG11LM Aqara Wireless Switch Mini
          custom_value: false
          sort: false
          multiple: false
    light:
      name: (Required) Light
      description: Light which will be controlled with this automation.
      selector:
        entity:
          domain:
          - light
          multiple: false
    light_color_mode:
      name: (Optional) Light color mode
      description: Specify how the controller will set the light color. Choose "Color
        Temperature" and "Hue - Saturation" depending on the features supported by
        your light. If you are not sure you can select "Auto". "None" will disable
        color control features.
      default: Auto
      selector:
        select:
          options:
          - Auto
          - Color Temperature
          - Hue - Saturation
          - None
          custom_value: false
          sort: false
          multiple: false
    light_transition:
      name: (Optional) Light Transition
      description: Number that represents the time (in milliseconds) the light should
        take turn on or off, if the light supports it.
      default: 250
      selector:
        number:
          min: 0.0
          max: 60000.0
          step: 1.0
          unit_of_measurement: milliseconds
          mode: box
    min_brightness:
      name: (Optional) Light minimum brightness
      description: The minimum brightness the light can be set with this automation.
      default: 1
      selector:
        number:
          min: 1.0
          max: 255.0
          step: 1.0
          unit_of_measurement: brightness
          mode: slider
    max_brightness:
      name: (Optional) Light maximum brightness
      description: The maximum brightness the light can be set with this automation.
      default: 255
      selector:
        number:
          min: 0.0
          max: 255.0
          step: 1.0
          unit_of_measurement: brightness
          mode: slider
    brightness_steps_short:
      name: (Optional) Light brightness steps - short actions
      description: Number of steps from min to max brightness when controlling brightness
        with short actions (eg. button press).
      default: 10
      selector:
        number:
          min: 1.0
          max: 255.0
          step: 1.0
          unit_of_measurement: steps
          mode: box
    brightness_steps_long:
      name: (Optional) Light brightness steps - long actions
      description: Number of steps from min to max brightness when controlling brightness
        with long actions (eg. button hold or controller rotation).
      default: 10
      selector:
        number:
          min: 1.0
          max: 255.0
          step: 1.0
          unit_of_measurement: steps
          mode: box
    force_brightness:
      name: (Optional) Force brightness value at turn on
      description: Force brightness to the "On brightness" input value, when the light
        is being turned on.
      default: false
      selector:
        boolean: {}
    on_brightness:
      name: (Optional) On brightness
      description: Brightness value to force when turning on the light
      default: 1
      selector:
        number:
          min: 0.0
          max: 255.0
          step: 1.0
          unit_of_measurement: brightness
          mode: slider
    smooth_power_on:
      name: (Optional) Smooth power on
      description: Force the light to turn on at minimum brightness when a brightness
        up command (single or continuous) is triggered and light is off.
      default: true
      selector:
        boolean: {}
    smooth_power_off:
      name: (Optional) Smooth power off
      description: Allow a brightness down command (single or continuous) to turn
        off the light when at minimum brightness. Disabling this will prevent the
        light from being turned off by brightness down commands.
      default: true
      selector:
        boolean: {}
variables:
  controller_model: !input controller_model
  controller_mapping:
    IKEA E1524/E1810 TRƅDFRI Wireless 5-Button Remote:
      brightness_up: button_up_short
      brightness_up_repeat: button_up_long
      brightness_down: button_down_short
      brightness_down_repeat: button_down_long
      color_down: button_left_short
      color_down_repeat: button_left_long
      color_up: button_right_short
      color_up_repeat: button_right_long
      toggle: button_center_short
    IKEA E1743 TRƅDFRI On/Off Switch & Dimmer:
      turn_on: button_up_short
      brightness_up_repeat: button_up_long
      color_up: button_up_double
      turn_off: button_down_short
      brightness_down_repeat: button_down_long
      color_down: button_down_double
    IKEA E1743 TRƅDFRI On/Off Switch & Dimmer (#2):
      brightness_up: button_up_short
      brightness_up_repeat: button_up_long
      turn_on: button_up_double
      brightness_down: button_down_short
      brightness_down_repeat: button_down_long
      turn_off: button_down_double
    IKEA E1744 SYMFONISK Rotary Remote:
      brightness_down_repeat: rotate_left
      brightness_up_repeat: rotate_right
      toggle: click_short
      color_up: click_double
      color_down: click_triple
    IKEA E1766 TRƅDFRI Open/Close Remote:
      brightness_up: button_up_short
      turn_on: button_up_double
      brightness_down: button_down_short
      turn_off: button_down_double
    IKEA E1766 TRƅDFRI Open/Close Remote (#2):
      brightness_up: button_up_short
      color_up: button_up_double
      brightness_down: button_down_short
      color_down: button_down_double
    IKEA E1812 TRƅDFRI Shortcut button:
      toggle: button_short
      color_up: button_double
    IKEA E2001/E2002 STYRBAR Remote control:
      turn_on: button_up_short
      brightness_up_repeat: button_up_long
      turn_off: button_down_short
      brightness_down_repeat: button_down_long
      color_down: button_left_short
      color_down_repeat: button_left_long
      color_up: button_right_short
      color_up_repeat: button_right_long
    IKEA E2001/E2002 STYRBAR Remote control (#2):
      brightness_up: button_up_short
      brightness_up_repeat: button_up_long
      turn_on: button_up_double
      brightness_down: button_down_short
      brightness_down_repeat: button_down_long
      turn_off: button_down_double
      color_down: button_left_short
      color_down_repeat: button_left_long
      color_up: button_right_short
      color_up_repeat: button_right_long
    IKEA ICTC-G-1 TRƅDFRI wireless dimmer:
      brightness_down_repeat: rotate_left
      brightness_up_repeat: rotate_right
    OSRAM AC025XX00NJ SMART+ Switch Mini:
      brightness_up: button_up_short
      brightness_up_repeat: button_up_long
      color_up: button_up_double
      brightness_down: button_down_short
      brightness_down_repeat: button_down_long
      color_down: button_down_double
      toggle: button_center_short
    Philips 324131092621 Hue Dimmer switch:
      turn_on: button_on_short
      color_up_repeat: button_on_long
      turn_off: button_off_short
      color_down_repeat: button_off_long
      brightness_up: button_up_short
      brightness_up_repeat: button_up_long
      brightness_down: button_down_short
      brightness_down_repeat: button_down_long
    Philips 8718699693985 Hue Smart Button:
      toggle: button_short
    Philips 929002398602 Hue Dimmer switch v2:
      turn_on: button_on_short
      color_up_repeat: button_on_long
      turn_off: button_off_short
      color_down_repeat: button_off_long
      brightness_up: button_up_short
      brightness_up_repeat: button_up_long
      brightness_down: button_down_short
      brightness_down_repeat: button_down_long
    SONOFF SNZB-01 Wireless Switch:
      toggle: button_short
      color_up: button_double
    Xiaomi WXCJKG11LM Aqara Opple 2 button remote:
      turn_on: button_1_short
      brightness_up_repeat: button_1_long
      color_up: button_1_double
      turn_off: button_2_short
      brightness_down_repeat: button_2_long
      color_down: button_2_double
    Xiaomi WXCJKG12LM Aqara Opple 4 button remote:
      turn_on: button_1_short
      brightness_up_repeat: button_1_long
      color_up: button_1_double
      turn_off: button_2_short
      brightness_down_repeat: button_2_long
      color_down: button_2_double
    Xiaomi WXCJKG12LM Aqara Opple 4 button remote (#2):
      turn_on: button_3_short
      brightness_up_repeat: button_3_long
      color_up: button_3_double
      turn_off: button_4_short
      brightness_down_repeat: button_4_long
      color_down: button_4_double
    Xiaomi WXCJKG13LM Aqara Opple 6 button remote:
      turn_on: button_1_short
      brightness_up_repeat: button_1_long
      color_up: button_1_double
      turn_off: button_2_short
      brightness_down_repeat: button_2_long
      color_down: button_2_double
    Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#2):
      turn_on: button_3_short
      brightness_up_repeat: button_3_long
      color_up: button_3_double
      turn_off: button_4_short
      brightness_down_repeat: button_4_long
      color_down: button_4_double
    Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#3):
      turn_on: button_5_short
      brightness_up_repeat: button_5_long
      color_up: button_5_double
      turn_off: button_6_short
      brightness_down_repeat: button_6_long
      color_down: button_6_double
    Xiaomi WXKG11LM Aqara Wireless Switch Mini:
      toggle: button_short
      color_up: button_double
  brightness_up: '{{ controller_mapping[controller_model]["brightness_up"] | default(None)
    }}'
  brightness_up_repeat: '{{ controller_mapping[controller_model]["brightness_up_repeat"]
    | default(None) }}'
  brightness_down: '{{ controller_mapping[controller_model]["brightness_down"] | default(None)
    }}'
  brightness_down_repeat: '{{ controller_mapping[controller_model]["brightness_down_repeat"]
    | default(None) }}'
  color_up: '{{ controller_mapping[controller_model]["color_up"] | default(None) }}'
  color_up_repeat: '{{ controller_mapping[controller_model]["color_up_repeat"] | default(None)
    }}'
  color_down: '{{ controller_mapping[controller_model]["color_down"] | default(None)
    }}'
  color_down_repeat: '{{ controller_mapping[controller_model]["color_down_repeat"]
    | default(None) }}'
  toggle: '{{ controller_mapping[controller_model]["toggle"] | default(None) }}'
  turn_on: '{{ controller_mapping[controller_model]["turn_on"] | default(None) }}'
  turn_off: '{{ controller_mapping[controller_model]["turn_off"] | default(None) }}'
  light_color_mode: !input light_color_mode
  light: !input light
  light_transition: !input light_transition
  min_brightness: !input min_brightness
  max_brightness: !input max_brightness
  brightness_steps_short: !input brightness_steps_short
  brightness_steps_long: !input brightness_steps_long
  force_brightness: !input force_brightness
  on_brightness: !input on_brightness
  smooth_power_on: !input smooth_power_on
  smooth_power_off: !input smooth_power_off
  color_modes:
    Auto: auto
    Color Temperature: color_temp
    Hue - Saturation: hs_color
    None: none
  light_color_mode_id: '{%- if light_color_mode == "Auto" -%} {% set supported_color_modes
    = state_attr(light, "supported_color_modes") -%} {%- if "hs" in supported_color_modes
    or "xy" in supported_color_modes or "rgbw" in supported_color_modes or "rgbww"
    in supported_color_modes -%} {{ color_modes["Hue - Saturation"] }} {%- elif "color_temp"
    in supported_color_modes -%} {{ color_modes["Color Temperature"] }} {%- else -%}
    {{ color_modes["None"] }} {%- endif -%} {%- else -%} {{ color_modes[light_color_mode]
    }} {%- endif -%}'
  step_short: '{{ (max_brightness-min_brightness)/brightness_steps_short }}'
  step_long: '{{ (max_brightness-min_brightness)/brightness_steps_long }}'
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: ahb_controller_event
  event_data:
    controller: !input controller_device
- platform: event
  event_type: ahb_controller_event
  event_data:
    controller: !input controller_entity
condition: []
action:
- variables:
    action: '{{ trigger.event.data.action }}'
- choose:
  - conditions: '{{ action == toggle }}'
    sequence:
    - choose:
      - conditions: '{{ force_brightness }}'
        sequence:
        - service: light.toggle
          entity_id: !input light
          data:
            brightness: !input on_brightness
            transition: '{{ light_transition / 1000 }}'
      default:
      - service: light.toggle
        entity_id: !input light
        data:
          transition: '{{ light_transition / 1000 }}'
  - conditions: '{{ action == turn_on }}'
    sequence:
    - choose:
      - conditions: '{{ force_brightness }}'
        sequence:
        - service: light.turn_on
          entity_id: !input light
          data:
            brightness: !input on_brightness
            transition: '{{ light_transition / 1000 }}'
      default:
      - service: light.turn_on
        entity_id: !input light
        data:
          transition: '{{ light_transition / 1000 }}'
  - conditions: '{{ action == turn_off }}'
    sequence:
    - service: light.turn_off
      entity_id: !input light
      data:
        transition: '{{ light_transition / 1000 }}'
  - conditions: '{{ action == brightness_up }}'
    sequence:
    - choose:
      - conditions: '{{ states(light) == "off" and not smooth_power_on}}'
        sequence:
        - service: light.turn_on
          data:
            transition: '{{ light_transition / 1000 }}'
            entity_id: !input light
      - conditions: '{{ states(light) == "off" and smooth_power_on}}'
        sequence:
        - service: light.turn_on
          data:
            brightness: '{{ min_brightness }}'
            transition: '{{ light_transition / 1000 }}'
            entity_id: !input light
      default:
      - service: light.turn_on
        data:
          brightness: '{{ [ [state_attr(light,"brightness")+step_short, min_brightness]
            | max, max_brightness] | min }}'
          transition: 0.25
          entity_id: !input light
  - conditions: '{{ action == brightness_down and states(light) == "on" }}'
    sequence:
    - choose:
      - conditions: '{{ smooth_power_off and state_attr(light,"brightness") == min_brightness
          }}'
        sequence:
        - service: light.turn_off
          data:
            transition: '{{ light_transition / 1000 }}'
            entity_id: !input light
      default:
      - service: light.turn_on
        data:
          brightness: '{{ [ [state_attr(light,"brightness")-step_short, min_brightness]
            | max, max_brightness] | min }}'
          transition: 0.25
          entity_id: !input light
  - conditions: '{{ action == brightness_up_repeat }}'
    sequence:
    - choose:
      - conditions: '{{ states(light) == "off" and not smooth_power_on}}'
        sequence:
        - service: light.turn_on
          data:
            transition: '{{ light_transition / 1000 }}'
            entity_id: !input light
        - delay:
            milliseconds: !input light_transition
      - conditions: '{{ states(light) == "off" and smooth_power_on}}'
        sequence:
        - service: light.turn_on
          data:
            brightness: '{{ min_brightness }}'
            transition: '{{ light_transition / 1000 }}'
            entity_id: !input light
        - delay:
            milliseconds: !input light_transition
    - repeat:
        while: '{{ true }}'
        sequence:
        - service: light.turn_on
          data:
            brightness: '{{ [ [state_attr(light,"brightness")+step_long, min_brightness]
              | max, max_brightness] | min }}'
            transition: 0.25
            entity_id: !input light
        - delay:
            milliseconds: 250
  - conditions: '{{ action == brightness_down_repeat and states(light) == "on"  }}'
    sequence:
    - choose:
      - conditions: '{{ smooth_power_off }}'
        sequence:
        - repeat:
            while: '{{ states(light) != "off" }}'
            sequence:
            - choose:
              - conditions: '{{ state_attr(light,"brightness") == min_brightness }}'
                sequence:
                - service: light.turn_off
                  data:
                    transition: '{{ light_transition / 1000 }}'
                    entity_id: !input light
                - delay:
                    milliseconds: !input light_transition
              default:
              - service: light.turn_on
                data:
                  brightness: '{{ [ [state_attr(light,"brightness")-step_long, min_brightness]
                    | max, max_brightness] | min }}'
                  transition: 0.25
                  entity_id: !input light
              - delay:
                  milliseconds: 250
      default:
      - repeat:
          while: '{{ states(light) != "off" }}'
          sequence:
          - service: light.turn_on
            data:
              brightness: '{{ [ [state_attr(light,"brightness")-step_long, min_brightness]
                | max, max_brightness] | min }}'
              transition: 0.25
              entity_id: !input light
          - delay:
              milliseconds: 250
  - conditions: '{{ action == color_up and light_color_mode_id != "none" }}'
    sequence:
      choose:
      - conditions: '{{ light_color_mode_id == "color_temp" }}'
        sequence:
        - service: light.turn_on
          data:
            color_temp: '{{ state_attr(light,"color_temp")|int + 50 }}'
            transition: 0.25
          entity_id: !input light
      - conditions: '{{ light_color_mode_id == "hs_color" }}'
        sequence:
        - service: light.turn_on
          data:
            hs_color: '{%- if state_attr(light,"hs_color")[0] < 345 or state_attr(light,"hs_color") == (0,0) -%} {{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }} {%- else -%} [0,0] {%- endif -%}'
            transition: 0.25
          entity_id: !input light
  - conditions: '{{ action == color_down and light_color_mode_id != "none" }}'
    sequence:
      choose:
      - conditions: '{{ light_color_mode_id == "color_temp" }}'
        sequence:
        - service: light.turn_on
          data:
            color_temp: '{{ [state_attr(light,"color_temp")|int - 50, 1]|max }}'
            transition: 0.25
          entity_id: !input light
      - conditions: '{{ light_color_mode_id == "hs_color" }}'
        sequence:
        - service: light.turn_on
          data:
            hs_color: '{%- if state_attr(light,"hs_color")[0] > 15 or state_attr(light,"hs_color") == (0,0) -%} {{ [((state_attr(light,"hs_color")[0] or 0) - 15) % 360, 100] }} {%- else -%} [0,0] {%- endif -%}'
            transition: 0.25
          entity_id: !input light
  - conditions: '{{ action == color_up_repeat and light_color_mode_id != "none" }}'
    sequence:
      choose:
      - conditions: '{{ light_color_mode_id == "color_temp" }}'
        sequence:
        - repeat:
            while: '{{ true }}'
            sequence:
            - service: light.turn_on
              data:
                color_temp: '{{ state_attr(light,"color_temp")|int + 50 }}'
                transition: 0.25
              entity_id: !input light
            - delay:
                milliseconds: 250
      - conditions: '{{ light_color_mode_id == "hs_color" }}'
        sequence:
        - repeat:
            while: '{{ true }}'
            sequence:
            - service: light.turn_on
              data:
                hs_color: '{%- if state_attr(light,"hs_color")[0] < 345 or state_attr(light,"hs_color") == (0,0) -%} {{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }} {%- else -%} [0,0] {%- endif -%}'
                transition: 0.25
              entity_id: !input light
            - delay:
                milliseconds: 250
  - conditions: '{{ action == color_down_repeat and light_color_mode_id != "none"
      }}'
    sequence:
      choose:
      - conditions: '{{ light_color_mode_id == "color_temp" }}'
        sequence:
        - repeat:
            while: '{{ true }}'
            sequence:
            - service: light.turn_on
              data:
                color_temp: '{{ [state_attr(light,"color_temp")|int - 50, 1]|max }}'
                transition: 0.25
              entity_id: !input light
            - delay:
                milliseconds: 250
      - conditions: '{{ light_color_mode_id == "hs_color" }}'
        sequence:
        - repeat:
            while: '{{ true }}'
            sequence:
            - service: light.turn_on
              data:
                hs_color: '{%- if state_attr(light,"hs_color")[0] > 15 or state_attr(light,"hs_color") == (0,0) -%} {{ [((state_attr(light,"hs_color")[0] or 0) - 15) % 360, 100] }} {%- else -%} [0,0] {%- endif -%}'
                transition: 0.25
              entity_id: !input light
            - delay:
                milliseconds: 250

I think it could be an interesting modification, since pure white is very interesting

I have issues with this blueprint:

## Knappsats kontor uses an unknown service

The automation ā€œKnappsats kontorā€ (automation.test_modified) has an action that calls an unknown service: input_text.set_value.

This error prevents the automation from running correctly. Maybe this service is no longer available, or perhaps a typo caused it.

To fix this error, edit the automation and remove the action that calls this service.

Click on SUBMIT below to confirm you have fixed this automation.

Hi there, welcome.

That is a valid service call. Are you using the latest Home Assistant version?

Make sure you have the latest version of the blueprint šŸŽ® ZHA, deCONZ, Zigbee2MQTT - IKEA E2001/E2002 STYRBAR Remote control Universal blueprint - all actions + double click events - control lights, media players and more with Hooks - #136 by LewisSpring

I will have a look at this when I find some time :slight_smile:
Feel free to add a pull request to the repository https://github.com/lsismeiro/awesome-ha-blueprints/blob/c8dd0357cd970a7eca11756fedf806712ad42127/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml

Hi thank you for your reply.
Info:
Home Assistant 2023.10.5
Supervisor 2023.10.1
Operating System 11.1
Frontend 20231005.0 - latest

This is the blueprint version i have used: https://github.com/lsismeiro/awesome-ha-blueprints/blob/c8dd0357cd970a7eca11756fedf806712ad42127/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml

I just saw that on one of my HA instance have lost the service ā€œinput_text.set_valueā€. I have no idea why, do you have any idea?

I have not heard of this before. Might be worth creating a new post about this, I donā€™t use supervised HA - maybe thereā€™s a repair feature?

I think it would be good to add the code version or release date.
Otherwise it is difficult to know what you have and if there is something more recent.

This was something I had been doing but has been lost since the merge.

Will make a pull request to add this.

1 Like

Just to confirm, the only changes you made was to the Hook blueprint?
Am making a pull for you.

Also - Is the copy you sent here šŸŽ® ZHA, deCONZ, Zigbee2MQTT - IKEA E2001/E2002 STYRBAR Remote control Universal blueprint - all actions + double click events - control lights, media players and more with Hooks - #152 by LeidenSpain copied from Home Assistant?

The formatting has been a bit messed up and normally thatā€™s the result of Home Assistant mangling it a bit.

If you have a clean copy that would be great, if not your changes will need to be copied manually from the clean copy :slight_smile:

Cheers

Yes, I have only added those lines that modify the color cycle.

I copied it as is from the blueprint using VSC, I think it looks good.
If you want, Iā€™ll try to upload the code to github so you can copy it

I have put aside the part of making the list of colors, I have other more urgent and important things to do.

Well, I guess I am a bit late to the party. I tinkered a bit with my original (EPmatt) version on ZHA and got it to work, with some of the modifications also mentioned in this thread, which I somehow missed.
Quick remark: I found I needed to remove the ā€˜last controller eventā€™ check on the long releases (eg for button up: '{{ not integration_id in integrations_with_prev_event_storage or last_controller_event | string in button_up_long }}'. This check evaluated to false, causing the long press action to be looped until max or min values.
Iā€™ve been too lazy to check everything in my version against the one that @LewisSpring has made, or investigate the details of why this check evaluates to false (it shouldnā€™t, based on the text helper and ZHA integration) but Iā€™m not quite sure if the line is necessary at all. If I understand it correctly, the blueprint is set up such that the long press repeat actions are halted as soon as any other event is detected, simply by the ā€˜repeatā€™ action of the automation, so does it matter what the last event was?
I can imagine it is necessary with other remotes, e.g. the Philips Hue RWL021 sends ā€˜button releasedā€™ commands on short presses too, but my STYRBAR doesnā€™t do that.

Many thanks. Looks a lot better
Will work on the pull for you

1 Like