Suddenly the code stops working

I have a code that has been working for a long time. I haven’t changed anything, and yet it suddenly stops working.

These are the two issues:

- data:
  entity_id: media_player.bureau_sonos
  media:
      media_content_id: /local/Geluiden/Biepen/Biep 022.mp3
      media_content_type: music
      metadata: {}
  enabled: true
  action: media_player.play_media

and

- data_template:
   entity_id: media_player.keuken_sonos
   message: Goede morgen op deze Vrijdag
 enabled: true
 action: tts.voicerss_say

I don’t get an error message, but it still doesn’t work!

Can anyone help me? I don’t know where to look anymore.

Thanks in advance

There’s several parts

  • The Sonos players themselves… I take it you’ve checked there? Firmware updates?
  • The network between them and HA - no recent changes there?
  • HA:
  • Go to Setting / System / Logs - any related error entries?
  • Go to Settings / Automations & Scenes:
    Search for the related automation(s),
    When did they run last?
    Click the 3 dots and traces - any errors?

Did the Copy/Paste messed up the " indents " of those (code snippets) ?
Where do you have these “code snippets”, could you paste the whole relevant code-structure ?

Thanks for your reply.

There seems to have been a Sonos update. I’ve performed it. It’s not resolved yet. I don’t see any errors anywhere. But what I do notice is that when I

- data:
  entity_id: media_player.bureau_sonos
  media:
      media_content_id: /local/Geluiden/Biepen/Biep 022.mp3
      media_content_type: music
      metadata: {}
  enabled: true
  action: media_player.play_media

test, the music cuts out and I get the following message in the Sonos app (see image).

Are you sure this have ever worked ? , for this particular “content” ?

Seeing the word Auth in there makes me think that the Sonos requires authentication, and didn’t care for HA’s request. Since this is coincidental with a FW upgrade, there is correlation.

I’d look at Sonos’s release notes and see if they’ve updated their access api and related requirements to see what that says. This is a common problem with integrated iot devices; the manufacturer updates security and integrations break.

1 Like

Yes i noticed that to, but not familiar with the Sonos integration, and in particular not when playing a local media ( and with an _ID with Capital and “space” in it’s name )
Sonos - Home Assistant .

1 Like

And with the indentation strangeness

Yep… I figured I was “language challenged” there (which is otherwise true :crazy_face:)
Wasn’t sure if Beip was a label or message for the file, or part of the file name

Yes, it has always worked

1 Like