Sonos playing in bathroom when motion

Hi there! I am wondering if anyone could help pointing me in the correct direction for this script (is is in Norwegian).
It translates from the top: If bathroom zone is becoming active, the time is between 06:30 and 23:00 and if Sonos is not playing anything then it should play a playlist. This works of course, but everytime the zone is becoming inactive (if sitting on the toilet for a long time for instance and the motion sensor has not detected any movement) the flow runs again and the Sonos stop playing for a while and then playing again. Any suggestion on how this could be fixed

Add a flow WHEN bathroomzone becomes active, THEN start bathroom timer. Add @ your own flow @ the AND part AND timer is running. You can add an extra flow WHEN timer is empty, THEN ……

Normally about 2 minutes for the timer will do the job, but this depends if your motionsensor will sense activity if you are on the toilet. In that case r minutes will not be enough

Don’t know if it’s a misunderstanding, but your mentioned flow can’t stop playing Sonos. So there must be another flow that stops Sonos. Maybe something like this:
If zone Bathroom becomes inactive, then stop Sonos.

To prevent Sonos stopping to early, you can use a timer app as already suggested, or you can use the flow card If zone Bathroom becomes inactive for more than x minutes

Btw, a PIR Motion Sensor can’t detect movement behind a glass door like a shower door.

Hi there, thanks for answering.

I have been a bit unclear I think. The thing is that every time the motion sensor goes from inactive to active the music pauses and then resumes. I have added “and Sonos isn’t playing anything” but it did not do anything different.

So it is like this:
Once you come into the bathroom the lights are turned on and Sonos start playing. Then you to the toilet and sits there for a while, long enough for the motion sensor to turn inactive. Then you start moving again and the motion sensor turn active again. When this happens, music pauses\stops and resumes as the Homey flow is “firing” again.

Your description was not unclear.
If your Sonos pauses for a moment with each new motion detection and then starts playing again, then something is wrong with the “Sonos is not playing” condition resp. with the Sonos app. This wrong behavior has already been discussed several times in the forum. If you restart the app 1 x per day in the Morning (via flow), then your flow should work.
However, I would recommend to contact Athom and report the bug.

As far as i know Sonos not playing does not work and Sonos pause also does not work. I use mute and unmute which works fine for me

This is for example a flow I use every day. I start Sonos with an Aqara Opple Switch 6. And I use also the Sonos condition card Wird abgespielt (Is playing / Speelt) and that works 99 % of the time, because I restart the Sonos App everyday in the morning.

But as you can see, I use another key combination in case it doesn’t work… :wink: