Alexa_media event not triggering in HA

Hi everyone,

I’m new to this forum and still learning the ropes with Home Assistant and home automation in general. I’ve set up Alexa Media Player using HACS on my Home Assistant instance, which is running on a Raspberry Pi 5. I also have Node-RED installed and working.

I’m trying to create an automation in Node-RED that listens for Alexa commands using the alexa_media events (through the “all events” node), but it doesn’t seem to trigger when I talk to Alexa. I even tried lowering the polling frequency to 2 seconds in the Alexa Media Player config, but it still takes around 25 seconds to update when I check using the sensor.last_alexa.

Here’s the YAML I’m using for that sensor:

template:
  - sensor:
      - name: last_alexa
        unique_id: last_alexa_sensor
        state: >
          {% for entity in states.media_player %}
            {% if state_attr(entity.entity_id, 'last_called') %}
              {{ entity.entity_id }}
            {% endif %}
          {% endfor %}

My first preference is to get the alexa_media event to trigger directly in Node-RED. But if that’s not possible due to regional limitations (I’m in India), is there a way to at least reduce the delay with last_alexa?

Would really appreciate any advice or tips from those who’ve dealt with something similar. Thanks!