đź’ˇ (2025 Update: We are back!) Awesome HA Blueprints: A curated collection of blueprints for Home Assistant. Reliable, customizable, fully tested by the community

hey!
Thanks for these blueprints!
After a fresh setup the light (light.ganglicht) which I controll via a E1524 remote only turns off via a press of the middle button, but when I try to turn it on, it will fail and “crash” with an error.
Follwing error in the log:

Logger: homeassistant.components.automation.licht_ganglicht_hook_2
Source: components/hue/bridge.py:132
Integration: Automatisierung (documentation, issues)
First occurred: 09:08:58 (4 occurrences)
Last logged: 09:08:59

[Licht] Ganglicht - Hook: Choose at step 2: choice 1: Choose at step 1: default: Error executing script. Unexpected error for call_service at pos 1: 400, message='Bad Request', url=URL('https://192.168.XXX.XX/clip/v2/resource/light/7c4800a4-2e22-4777-bf92-1cbbef22aedf')
[Licht] Ganglicht - Hook: Choose at step 2: choice 1: Error executing script. Unexpected error for choose at pos 1: 400, message='Bad Request', url=URL('https://192.168.XXX.XX/clip/v2/resource/light/7c4800a4-2e22-4777-bf92-1cbbef22aedf')
[Licht] Ganglicht - Hook: Error executing script. Unexpected error for choose at pos 2: 400, message='Bad Request', url=URL('https://192.168.XXX.XX/clip/v2/resource/light/7c4800a4-2e22-4777-bf92-1cbbef22aedf')
While executing automation automation.licht_ganglicht_hook_2
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 584, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 510, in async_handle_toggle_service
    await async_handle_light_on_service(light, call)
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 494, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/hue/v2/group.py", line 175, in async_turn_on
    await self.bridge.async_request_call(
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 132, in async_request_call
    return await task(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/controllers/lights.py", line 85, in set_state
    await self._send_put(id, update_obj)
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/controllers/base.py", line 137, in _send_put
    await self._bridge.request("put", endpoint, json=data)
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/__init__.py", line 152, in request
    async with self.create_request(method, path, **kwargs) as resp:
  File "/usr/local/lib/python3.9/contextlib.py", line 181, in __aenter__
    return await self.gen.__anext__()
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/__init__.py", line 182, in create_request
    res.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://192.168.XXX.XX/clip/v2/resource/light/7c4800a4-2e22-4777-bf92-1cbbef22aedf')

The automation which was generated:

variables:
  controller_model: IKEA E1524/E1810 TRĂ…DFRI Wireless 5-Button Remote
  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
    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
  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: Auto
  light: light.ganglicht
  light_transition: 250
  min_brightness: 1
  max_brightness: 255
  brightness_steps_short: 10
  brightness_steps_long: 10
  force_brightness: false
  on_brightness: 1
  smooth_power_on: true
  smooth_power_off: true
  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: 911242cf1805689a846e026a2e32b577
  - platform: event
    event_type: ahb_controller_event
    event_data:
      controller: ''
condition: []
action:
  - variables:
      action: '{{ trigger.event.data.action }}'
  - choose:
      - conditions: '{{ action == toggle }}'
        sequence:
          - choose:
              - conditions: '{{ force_brightness }}'
                sequence:
                  - service: light.toggle
                    entity_id: light.ganglicht
                    data:
                      brightness: 1
                      transition: '{{ light_transition / 1000 }}'
            default:
              - service: light.toggle
                entity_id: light.ganglicht
                data:
                  transition: '{{ light_transition / 1000 }}'
      - conditions: '{{ action == turn_on }}'
        sequence:
          - choose:
              - conditions: '{{ force_brightness }}'
                sequence:
                  - service: light.turn_on
                    entity_id: light.ganglicht
                    data:
                      brightness: 1
                      transition: '{{ light_transition / 1000 }}'
            default:
              - service: light.turn_on
                entity_id: light.ganglicht
                data:
                  transition: '{{ light_transition / 1000 }}'
      - conditions: '{{ action == turn_off }}'
        sequence:
          - service: light.turn_off
            entity_id: light.ganglicht
            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: light.ganglicht
              - conditions: '{{ states(light) == "off" and smooth_power_on}}'
                sequence:
                  - service: light.turn_on
                    data:
                      brightness: '{{ min_brightness }}'
                      transition: '{{ light_transition / 1000 }}'
                      entity_id: light.ganglicht
            default:
              - service: light.turn_on
                data:
                  brightness: >-
                    {{ [ [state_attr(light,"brightness")+step_short,
                    min_brightness] | max, max_brightness] | min }}
                  transition: 0.25
                  entity_id: light.ganglicht
      - 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: light.ganglicht
            default:
              - service: light.turn_on
                data:
                  brightness: >-
                    {{ [ [state_attr(light,"brightness")-step_short,
                    min_brightness] | max, max_brightness] | min }}
                  transition: 0.25
                  entity_id: light.ganglicht
      - 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: light.ganglicht
                  - delay:
                      milliseconds: 250
              - conditions: '{{ states(light) == "off" and smooth_power_on}}'
                sequence:
                  - service: light.turn_on
                    data:
                      brightness: '{{ min_brightness }}'
                      transition: '{{ light_transition / 1000 }}'
                      entity_id: light.ganglicht
                  - delay:
                      milliseconds: 250
          - 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: light.ganglicht
                - 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: light.ganglicht
                                - delay:
                                    milliseconds: 250
                          default:
                            - service: light.turn_on
                              data:
                                brightness: >-
                                  {{ [
                                  [state_attr(light,"brightness")-step_long,
                                  min_brightness] | max, max_brightness] | min
                                  }}
                                transition: 0.25
                                entity_id: light.ganglicht
                            - 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: light.ganglicht
                    - 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: light.ganglicht
            - conditions: '{{ light_color_mode_id == "hs_color" }}'
              sequence:
                - service: light.turn_on
                  data:
                    hs_color: >-
                      {{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360,
                      100] }}
                    transition: 0.25
                  entity_id: light.ganglicht
      - 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: light.ganglicht
            - conditions: '{{ light_color_mode_id == "hs_color" }}'
              sequence:
                - service: light.turn_on
                  data:
                    hs_color: >-
                      {{ [((state_attr(light,"hs_color")[0] or 0) - 15) % 360,
                      100] }}
                    transition: 0.25
                  entity_id: light.ganglicht
      - 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: light.ganglicht
                      - delay:
                          milliseconds: 250
            - conditions: '{{ light_color_mode_id == "hs_color" }}'
              sequence:
                - repeat:
                    while: '{{ true }}'
                    sequence:
                      - service: light.turn_on
                        data:
                          hs_color: >-
                            {{ [((state_attr(light,"hs_color")[0] or 0) + 15) %
                            360, 100] }}
                          transition: 0.25
                        entity_id: light.ganglicht
                      - 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: light.ganglicht
                      - delay:
                          milliseconds: 250
            - conditions: '{{ light_color_mode_id == "hs_color" }}'
              sequence:
                - repeat:
                    while: '{{ true }}'
                    sequence:
                      - service: light.turn_on
                        data:
                          hs_color: >-
                            {{ [((state_attr(light,"hs_color")[0] or 0) - 15) %
                            360, 100] }}
                          transition: 0.25
                        entity_id: light.ganglicht
                      - delay:
                          milliseconds: 250
id: '1641283697116'
alias: '[Licht] Ganglicht - Hook'
description: ''

Any idea where the issue is located?
Thanks for the help!