Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleep Timer #193

Open
SirVival71 opened this issue Jan 2, 2022 · 1 comment
Open

Sleep Timer #193

SirVival71 opened this issue Jan 2, 2022 · 1 comment

Comments

@SirVival71
Copy link

SirVival71 commented Jan 2, 2022

Issue

If I set a sleep timer by a scene e.g. to 900s and some minutes later (while the sleep timer is running) I set the sleep timer e.g. to 1200s by another scene, the sleep timer is not refreshed to the new value 1200s. The sleep timer still decrements further from the first run.

If I set a sleep timer to 900s and stop the music (the sleep timer is still running in the background) and then I set the sleep timer to 1200s, the sleep timer is refreshed to 1200s and starts its work as expected.
This is a workaround for automation sequences. But it does not work in scenes.

@ebaauw
Copy link
Owner

ebaauw commented Jan 2, 2022

Changing Default Duration in itself does nothing. The timer is only applied when setting On. This is how HomeKit works. Of course, Apple's Home app only supports Default Duration and Remaining Duration for Valve services, so it's a bit of a stretch to apply this to the Sonos service, see also #144. Home displays the remaining time on the tile for Valve services - I wanted to provide that for Sonos as well, that's why I expose the sleep timer using Default Duration and Remaining.

I suppose the issue you're facing is that Homebridge ZP wouldn't act on the On in the other scene, because the zone player is already playing.

Playing a bit with zp sleepTimer and the Sonos app: the zone player seems to handle the timer independently from whether it's playing or not. I can start the timer when the player is stopped, and the timer continues to run across mulitple Play and Stop/Pause commands. I think we need a separate Start Timer characteristic to reflect that logic.

@ebaauw ebaauw closed this as completed Jan 2, 2022
@ebaauw ebaauw reopened this Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants