node-red-contrib-sonos-plus icon indicating copy to clipboard operation
node-red-contrib-sonos-plus copied to clipboard

group.play.notification plays notification sound multiple times

Open Alex-joomla opened this issue 2 years ago • 5 comments

Description

Got the folowing function node in-line with an universal node:

msg.topic = "group.play.notification";
msg.volume = "60";
msg.payload =  "http://192.168.0.15:8123/local/media/conf.mp3";
return msg;

It should play the mp3 file, and does it too. But it plays it multiple times, mostly, the "echoes" are quiter than the first one. If the doorbell sound was played before, activated by another flow it sometimes plays the doorbell sound as "echoes"... Very strage...

In case of a bug: Are you able to reproduce the error

yes

Versions and Infrastructure

**what system: Node Red with HASSIO **node-red-contrib-sonos-plus version: 6.3.0 **Node-RED version: 11.1.1

Alex-joomla avatar Mar 22 '22 20:03 Alex-joomla

Hi Alex.

The notification command is "handmade" - means not a SONOS build in function. The command needs time (several seconds) to capture the current state of the group, playing the notification and finally restoring the original state. During this time, any additional command (change the stream, stop, pause, etc) arriving at the player "interfere" with the notification - usally problems restoring the original state and playing multiple times.

Are you sure that there are no additional messages arriving at the player during that time? How does your flow look (export)?

At my home I did solve it by putting a "queue function" in front of the sonos node - see tts example block serialize msgs and play notifications.

hklages avatar Mar 23 '22 10:03 hklages

My flow is as simple as that. You see the code in the function node above. There are no additional messages. Bildschirmfoto 2022-03-23 um 17 18 46

Alex-joomla avatar Mar 23 '22 16:03 Alex-joomla

Functions are always "critical". Could you please post the content of the function or just export it? You can put a debug node after "confirmed sound" and check, when messages are send.

hklages avatar Mar 23 '22 16:03 hklages

You can see the content of the node in my initial post

Alex-joomla avatar Apr 10 '22 08:04 Alex-joomla

Please replace the function node with a change node - function nodes are for real functions not just assignements. Put a debug node behind it and verfiy that per call only one message is send to the SONOS node. You can also put a simple queue node between the change node and the SONOS node to ensure that only one message is send.

hklages avatar Apr 11 '22 06:04 hklages