core: Stopped because of unknown reason "null" when running Spotify services in script based on automation

The problem

I have a script that turns on Spotify in my living room. When I execute it manually or using Siri it works fine. When I execute it from my Philips Hue Dimmer Switch I am getting Stopped because of unknown reason "null" at 19 August 2023 at 16:37:48 (runtime: 0.80 seconds).

I am getting this error on all Spotify-related actions such as Set source, Set volume, and Play media.

Also the continue_on_error: true option does not help. The script it still crashing and stopping. See screenshots below.

Screenshot 2023-08-19 at 4 46 24 PM Screenshot 2023-08-19 at 4 46 43 PM

What version of Home Assistant Core has the issue?

core-2023.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Not sure, it could be Spotify?

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

See screenshots above.

Additional information

Separate issue requested by @joostlek in https://github.com/home-assistant/core/issues/97828

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@jeroen85 Thank you so much! Changing mode: restart to mode: queued solved my problem. I thought only scripts would have modes. I didn’t know that automations also do. The exact cause of the issue was that when pressing long many events are emitted e.g. off_long_press, off_hold, off_long_release, … The reason why the script was always canceled was because off_long_release was always emitted directly after off_hold and I think that led the script to restart.