Mqtt trigger, select last characters

Hi All,
Thanks for your help.

I have sonoff rf bridge that re-send all rf commands to my mqtt broker.
Rf commands have 18 characters, but I only need to trigger the last 6 character of the RF Command as the previous ones change every time…
Fro example:
2CCE017204422BA7E4
2CBA045601682BA7E4

Do you know how can I setup a trigger using the las 6 characters of the string (2BA7E4).

  • alias: Test
    trigger:
    platform: mqtt
    topic: “RF_Bridge/rfin”
    condition:
    condition: template
    value_template: ‘{{ trigger.payload.endswith(“2BA7E4”) }}’
    action:
    • service: notify.mensajes
      data:
      message: test ok
      title: test ok

Try:
{{ trigger.payload[-6:] == '2BA7E4' }}

Many thanks, I spent several hours working on this. Thanks again.