Trigger from esphome

Hello there,

I need help with an automation, an esp32 (esphome) send a specific message to HA when an ir-button is pressed, now I’ve an automation to do something when a specific button is pressed but I don’t need a lot of automations but just one and choose based on the content of the message:

alias: IR_ON-OFF
description: ' '
trigger:
  - platform: event
    event_type: esphome.ir_button
    enabled: true
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ state_attr(trigger.esphome.ir_button, 'data') == 'message : IR-ON' }}"
        sequence:
          - service: light.toggle
            data:
              brightness_pct: 90
            target:
              entity_id: light.striscialed
    enabled: true
mode: single