Automation will not trigger despite tracing

Hello all!

Noticed my automations have been acting strange, especially since upgrading to 2026.3. Now some of the issues were strangely resolved by duplicating the automation, removing the old one and it seemed to work again. But i’ve got an automation that seeminly will not execute the action, despite running the action manually seems to work and the tracing indicates it did run, but has not.

For context, here is my automation:

alias: Radio test
description: ""
triggers:
  - device_id: 94c27ee78f4ef3c37735a6e9f55d4304
    domain: media_player
    entity_id: 01ded6ee41b6076ec319d32ee4e1d4b9
    type: playing
    trigger: device
conditions: []
actions:
  - device_id: 155c5967e8d7169196feed75eb8e223b
    domain: button
    entity_id: 2d695727191bd446b346cb2703dbf92f
    type: press
mode: single

I have an optical switch running to our soundbar with a chromecast audio connected to it, so is our chromecast TV. This automation is for switching the optical switch to the right port using an IR blasting ESP.

When the automation runs, i can see it trigger, will not switch the port. If i run the action manually, it does switch. And this automation did work properly before.

I am quite a bit stumped, hope someone knows what is going on here.

Firstly what does the trace say?

Secondly try to use entities instead of devices for triggers.

1 Like

The trace just mentions that it successfully ran, looks the same as when i do it manually.

Full automation trace:

{
  "trace": {
    "last_step": "action/0",
    "run_id": "1d4872a783dc9eb66168b39660de8f92",
    "state": "stopped",
    "script_execution": "finished",
    "timestamp": {
      "start": "2026-03-21T08:35:51.970472+00:00",
      "finish": "2026-03-21T08:35:51.978554+00:00"
    },
    "domain": "automation",
    "item_id": "1774080940655",
    "trigger": "state of media_player.radio",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2026-03-21T08:35:51.970583+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.radio_test",
              "state": "on",
              "attributes": {
                "id": "1774080940655",
                "last_triggered": "2026-03-21T08:19:04.230820+00:00",
                "mode": "single",
                "current": 0,
                "friendly_name": "Radio test"
              },
              "last_changed": "2026-03-21T08:26:06.294430+00:00",
              "last_reported": "2026-03-21T08:26:06.294430+00:00",
              "last_updated": "2026-03-21T08:26:06.294430+00:00",
              "context": {
                "id": "01KM7R0SJPAZWQ14MN4GHQJGVJ",
                "parent_id": null,
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "device",
              "entity_id": "media_player.radio",
              "from_state": {
                "entity_id": "media_player.radio",
                "state": "buffering",
                "attributes": {
                  "volume_level": 0.28999999165534973,
                  "is_volume_muted": false,
                  "media_content_id": "http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO10.mp3",
                  "media_content_type": "music",
                  "media_position": 0,
                  "media_position_updated_at": "2026-03-21T08:35:51.875704+00:00",
                  "app_id": "CC1AD845",
                  "app_name": "Default Media Receiver",
                  "entity_picture_local": null,
                  "device_class": "speaker",
                  "friendly_name": "Radio",
                  "supported_features": 152463
                },
                "last_changed": "2026-03-21T08:35:51.876760+00:00",
                "last_reported": "2026-03-21T08:35:51.876760+00:00",
                "last_updated": "2026-03-21T08:35:51.876760+00:00",
                "context": {
                  "id": "01KM7RJK2G221PAXFJ4KVVTT25",
                  "parent_id": null,
                  "user_id": "1960b194ceaf498cb742e3af5b168e46"
                }
              },
              "to_state": {
                "entity_id": "media_player.radio",
                "state": "playing",
                "attributes": {
                  "volume_level": 0.28999999165534973,
                  "is_volume_muted": false,
                  "media_content_id": "http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO10.mp3",
                  "media_content_type": "music",
                  "media_position": 0,
                  "media_position_updated_at": "2026-03-21T08:35:51.954834+00:00",
                  "app_id": "CC1AD845",
                  "app_name": "Default Media Receiver",
                  "entity_picture_local": null,
                  "device_class": "speaker",
                  "friendly_name": "Radio",
                  "supported_features": 152463
                },
                "last_changed": "2026-03-21T08:35:51.955929+00:00",
                "last_reported": "2026-03-21T08:35:51.955929+00:00",
                "last_updated": "2026-03-21T08:35:51.955929+00:00",
                "context": {
                  "id": "01KM7RJK2G221PAXFJ4KVVTT25",
                  "parent_id": null,
                  "user_id": "1960b194ceaf498cb742e3af5b168e46"
                }
              },
              "for": null,
              "attribute": null,
              "description": "state of media_player.radio"
            }
          }
        }
      ],
      "action/0": [
        {
          "path": "action/0",
          "timestamp": "2026-03-21T08:35:51.971689+00:00",
          "changed_variables": {
            "context": {
              "id": "01KM7RJNH2RRS3HRDHC0Q9ZGNW",
              "parent_id": "01KM7RJK2G221PAXFJ4KVVTT25",
              "user_id": null
            }
          }
        }
      ]
    },
    "config": {
      "id": "1774080940655",
      "alias": "Radio test",
      "description": "",
      "triggers": [
        {
          "device_id": "94c27ee78f4ef3c37735a6e9f55d4304",
          "domain": "media_player",
          "entity_id": "01ded6ee41b6076ec319d32ee4e1d4b9",
          "type": "playing",
          "trigger": "device"
        }
      ],
      "conditions": [],
      "actions": [
        {
          "device_id": "155c5967e8d7169196feed75eb8e223b",
          "domain": "button",
          "entity_id": "2d695727191bd446b346cb2703dbf92f",
          "type": "press"
        }
      ],
      "mode": "single"
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01KM7RJNH2RRS3HRDHC0Q9ZGNW",
      "parent_id": "01KM7RJK2G221PAXFJ4KVVTT25",
      "user_id": null
    }
  },
  "logbookEntries": [
    {
      "name": "Radio test",
      "message": "triggered by state of media_player.radio",
      "source": "state of media_player.radio",
      "entity_id": "automation.radio_test",
      "context_id": "01KM7RJNH2RRS3HRDHC0Q9ZGNW",
      "domain": "automation",
      "when": 1774082151.9708033
    },
    {
      "state": "2026-03-21T08:35:51.972591+00:00",
      "entity_id": "button.ir_blaster_woonkamer_optical_switch_port_1",
      "when": 1774082151.9726965,
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": "Radio test",
      "context_message": "triggered by state of media_player.radio",
      "context_source": "state of media_player.radio",
      "context_entity_id": "automation.radio_test"
    }
  ]
}

Switching to an entity instead of a device did not seem to make a difference.

Hi, just an idea out of experience: try by adding small time delays between the actions.
Sometimes the next action is fired while the current is not finished which can make an automation to fail overall.

You need to trigger it with this sort of thing.

trigger: state
entity_id:
  - media_player.your-player
to:
  - playing

I think i found the issue. Very stupid of me :sweat:
I had another automation that basically had the same trigger to turn on the soundbar, this was in case the soundbar was off when wanting to play music. I did not think throughly when making that automation, so the 2 IR sending actions (one for soundbar, one for optical switch) clashed.

Thank you both a lot for helping out, solution was just a PEBCAK :sweat_smile:

1 Like

Hi, good that it got solved!

Also: please take the time to mark the post that holds the solution.
You do that by selecting the three dots under the post:

image

Then select the check box:

image
By doing so:

  • this thread can be useful to other users as well (this thread comes up as solution when starting a thread which is similar to yours).
  • this prevents that someone else steps in trying to help

Thanks for giving back to the community! :+1:

Sorry for the late reply. Have done so, thanks!

1 Like