Sonos restore not working

I am having some difficulty getting sonos snapshot and sonos restore service calls to work through node red.

Here is my set up:
Function going into subflow that sets the sonos entity and message I want.

In subflow:

  • Input node into change node. Sets flow variable from the input
  • Service call node to set sonos snapshot
  • Change node to set payload to previous sonos flow variable
  • Service call to send message to sonos
  • Change node to set payload to null (otherwise the previous payload was overridden)
  • Service call to sonos to restore.

The message properly gets sent, but either the restore or snapshot doesn’t work because if I’m playing music and the message sends the sonos plays the message then is silent and the music does not restart.

Is there somewhere I need to store the snapshot?
Do I need a delay between the snapshot and message call?
Do I need a delay between the message call and restore?

Were you able to figure this out? I’m having a similar problem.

@nicxvan Can you post your flow? I use snapshot/restore without issue in my flow to make house announcements on my Sonos.

There have been a lot of improvements to the sonos subsystem since I posted this. I’ve not attempted it in a while, let me try it again.

YESSSS after a couple of days stumbling around I did find the solution:
I do store he snapshot msg.payload into a variable. After TTS I do write the variable back into msg.payload and do restore.

1 Like

Thanks. I try to do the same thing right now.
What do you use as timer. I can’t find it.

I get an error message “Call-service error. required key not provided @ data[‘media_content_type’]”

I’m new to Node Red so it could be that i do it wrong.


image
image

WOuld be greate if you can help me with that.

The first node after the timestamp is wrong. You need to use call service node:


I’m using the stoptimer. But you can use any timer.
If you want to use the stoptimer you need to add the node at manage pallet->install:

Thanks for the stoptimer. I used the “delay” i thought it would be dynamic with the stop timer. So that it resume when the tts is finished. I tried it with “wait until” but i didn’t get it to work.
But thats ok i’m happy that it work so far.