With Update 2024.8 blueprint no longer works

After Update the Core to 2024.8, this blueprint no longer works:

blueprint:
  name: ZHA - Aqara Wireless Double Rocker WXKG02LM
  description: Automate your Xiaomi Aqara Wireless Double Rocker WXKG02LM using ZHA events.
  domain: automation
  input:
    aqara_switch:
      name: Select the switch
      description: Aqara Wireless Double Rocker WXKG02LM
      selector:
        device:
          integration: zha
          manufacturer: LUMI
          entity:
            domain: sensor
            device_class: battery
    button_single_press_left:
      name: Single Press Left
      description: Action to run on single press
      default: []
      selector:
        action:
    button_single_press_right:
      name: Single Press Right
      description: Action to run on single press
      default: []
      selector:
        action:
    button_single_press_both:
      name: Single Press Both Buttons
      description: Action to run on single presses
      default: []
      selector:
        action:

mode: restart
max_exceeded: silent

trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input aqara_switch

action:
  - variables:
      command: "{{ trigger.event.data.endpoint_id }}"
      command2: "{{ trigger.event.data.args.value }}"

  - choose:
      - conditions:
          - "{{ command == 1 }}"
          - '{{ command2 == "Bool.true" }}'
        sequence: !input button_single_press_left
      - conditions:
          - "{{ command == 2 }}"
          - '{{ command2 == "Bool.true" }}'
        sequence: !input button_single_press_right
      - conditions:
          - "{{ command == 3 }}"
          - '{{ command2 == "Bool.true" }}'
        sequence: !input button_single_press_both

Can anyone help me?

Just restart HA (system)

Has not changed anything

Hi klotzma,

Let’s see if we can figure this out together, friend.

You are telling me

However that is not much information to go on as what is happening. I need more information.

Can you work thru this (below) and get me some info from the automation trace where it decides to stop?
That is a good starting point.

Also read thru the site FAQ which will help you understand the kind of information we need to help you.
https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question.

Thats the Log:

2024-08-20 22:36:12.652 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'value' when rendering '{{ trigger.event.data.args.value }}'
2024-08-20 22:36:13.424 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'value' when rendering '{{ trigger.event.data.args.value }}'
2024-08-20 22:36:13.427 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'value' when rendering '{{ trigger.event.data.args.value }}'
Logger: homeassistant.components.automation.taster_nachttisch_marcus_licht_umschalten
Quelle: helpers/script.py:2030
Integration: Automatisierung (Dokumentation, Probleme)
Erstmals aufgetreten: 12:49:00 (1 Vorkommnisse)
Zuletzt protokolliert: 12:49:00

Taster Nachttisch Marcus: Error executing script. Error rendering template for variables at pos 1: UndefinedError: 'dict object' has no attribute 'event
Logger: homeassistant.components.automation.taster_nachttisch_marcus_licht_umschalten
Quelle: components/automation/__init__.py:776
Integration: Automatisierung (Dokumentation, Probleme)
Erstmals aufgetreten: 12:49:00 (1 Vorkommnisse)
Zuletzt protokolliert: 12:49:00

Error while executing automation automation.taster_nachttisch_marcus_licht_umschalten: UndefinedError: 'dict object' has no attribute 'event'
Logger: homeassistant.helpers.template
Quelle: helpers/template.py:2651
Erstmals aufgetreten: 12:49:00 (17 Vorkommnisse)
Zuletzt protokolliert: 22:36:13

Template variable error: 'dict object' has no attribute 'event' when rendering '{{ trigger.event.data.endpoint_id }}'
Template variable warning: 'dict object' has no attribute 'value' when rendering '{{ trigger.event.data.args.value }}'

Help this?

It appears those variabkles are not populated, meaning there was no trigger, further meaning you probably clicked the run instead of actually triggering this with the button to get a real trigger.

Sound like something that may have happened?

Oh Sorry, this is the false time.
Yes i only trigger this Automaten on this time.

I post the right log tomorrow

It looks that i have a similar problem with 86sw2 and sw1

Looking at the blueprint, and previous version, this is the “pressed” part that is not working anymore. If i used the old blueprint without pressed detection, it works but triggers the event two times (pressed and release).

pressed: “{{ trigger.event.data.args.value }}”

Update : I fallback to 2024.7.4 and it works again. Initially, i was still in May release as i didn t do any upgrade during summer.


blueprint:
  name: ZHA - Aqara Wireless Remote Switch (Double Rocker 86sw2)
  description: Automate your Xiaomi Aqara Wireless Remote Switch (Double Rocker) (lumi.sensor_86sw2 Version) using ZHA events.
  domain: automation
  input:
    aqara_mini_switch:
      name: Select the Aqara Wireless Remote Switch (Double Rocker)
      description: Aqara Wireless Remote Switch (Double Rocker)
      selector:
        device:
          integration: zha
          manufacturer: LUMI
          entity:
            domain: sensor
            device_class: battery
    button_press_left:
      name: Single Press Left
      description: Action to run on single press
      default: []
      selector:
        action:
    button_press_right:
      name: Single Press Right
      description: Action to run on single press
      default: []
      selector:
        action:
    button_press_both:
      name: Single Press Both Buttons
      description: Action to run on single presses
      default: []
      selector:
        action:

mode: restart
max_exceeded: silent

trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input aqara_mini_switch

action:
  - variables:
      command: "{{ trigger.event.data.endpoint_id }}"
      pressed: "{{ trigger.event.data.args.value }}"

  - choose:
      - conditions:
          - "{{ command == 1 }}"
          - "{{ pressed == 'Bool.true' }}"
        sequence: !input button_press_left
      - conditions:
          - "{{ command == 2 }}"
          - "{{ pressed == 'Bool.true' }}"
        sequence: !input button_press_right
      - conditions:
          - "{{ command == 3 }}"
          - "{{ pressed == 'Bool.true' }}"
        sequence: !input button_press_both

OK, so I think I finally found the blueprint we are discussing here It was written 4 years ago so it probably has problems. I would look thru the thread and see if someone has updated it and bring your concerns there. I don’t know if the author is still supporting it or if someone else is, but that is your best bet a this time. I don’t have any desire to work on is because I don’t have the hardware to test anything, sadly.

ZHA - Aqara Wireless Remote Switch (Double Rocker).

Yes this the one for me. What do not work is the pressed part and specifically this variable trigger.event.data.args.value.

There is one version which do not use the variable however for this switch, it can t work as it trigger the action two times (press and release). Then it is far above my skills in HA. I just tried to determine the problem.

Ok, so nobody currently has a solution for this?

Not for me. Just tried the 2024.8.3. This is still broken. Any help will be welcome.

Change trigger.event.data.args.value to trigger.event.data.args.attribute_value.
This did the trick for me

Thank you it works perfectly again.

Thank you!!!