Trigger data not making it to MQTT payload (trigger.event.data.option)

Considering the following event data (confirmed both by “listen events” and event trigger trace )

trigger:
  id: '0'
  idx: '0'
  alias: null
  platform: event
  event:
    event_type: call_service
    data:
      domain: select
      service: select_option
      service_data:
        option: Chill
        entity_id:
          - select.winamp_radio

I am expecting the following automation to send the payload “Chill” to the “homeassistant/button/SS/winamp_radio/state” topic.

But the payload is empty. (MQTT explorer confirms by deleting the topic)

replacing “{{ trigger.event.data.option }}” with anything else like “test” for instance will go through.

alias: WINAMP radio select - reset option
description: ""
trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: select
      service: select_option
      service_data:
        entity_id:
          - select.winamp_radio
condition: []
action:
  - service: mqtt.publish
    data:
      topic: homeassistant/button/SS/winamp_radio/state
      payload: "{{ trigger.event.data.option }}"
      retain: false
    enabled: true
mode: single

Any idea where the problem is? I’ve tried checking my syntax numerous times and searched the forum for clues but couldn’t come up with a solution.

Thank you!

      payload: "{{ trigger.event.data.service_data.option }}"
1 Like

As usual, got it just after posting…

"{{ trigger.event.data.service_data.option }}"

Thanks

Thanks! just found it from one of your previous posts 2 seconds after posting…

1 Like