Automation to stop playing at the end of an episode?

Hi dear HA community,

Scenario: I cast podcasts to a Google Nest speaker at night, and it disregards my requests to stop at the end of an episode, instead always continuing with the next one available. I was hoping to catch it using homeassistant, and tried sending media_player.media_stop on state change from playing. That doesn’t trigger anything at the end of an episode though, so now I’m wondering two things:

  1. What do I do to trigger an action at the end of an episode?
  2. Is there a simple way to see all the state changes, to figure things like this out?

Thank you and pardon my ignorance, I have Googled this extensively to no avail.

Take a look at the entity in states (dev tools) and observe what the state and attributes do at the end of the episode.

1 Like

Solved it, thank you for the tip about looking at states under dev tools @nickrout.

Calling media_player.media_stop immediately on state change to idle did not work, however, if I set HA to wait for 1 second and then call it, it works as intended.

1 Like