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

Automatic sleep timer to stop music playing after a set time #2139

Open
acjohnson opened this issue Aug 23, 2021 · 4 comments
Open

Automatic sleep timer to stop music playing after a set time #2139

acjohnson opened this issue Aug 23, 2021 · 4 comments

Comments

@acjohnson
Copy link

acjohnson commented Aug 23, 2021

Looks like someone thought of this idea quite awhile ago but it never received attention.
https://community.volumio.org/t/collected-sleep-timer/2651

Sometimes I'll hit play on an internet radio station on my Volumio Pi and it will just keep playing endlessly. If I forget about it I'll wake up in the morning and find that my covered deck ceiling speakers are still playing the same internet radio station from the day previous.

It would be nice if in the Playback options I could select a duration to automatically stop playback regardless of the audio source. A dropdown with 1, 2, 4, 8, 12, 24 hours for example would be nice. Perhaps even add a check box that would turn off (power down) the volumio device for those who prefer that functionality.

@ashthespy
Copy link
Collaborator

Hmm does Settings>Sleep not work for you?

@acjohnson
Copy link
Author

Not sure how I missed that; yes that works. Is there a way to save it as a persistent setting without requiring you to manually enable sleep each time?

@ashthespy
Copy link
Collaborator

ashthespy commented Aug 25, 2021

Is there a way to save it as a persistent setting without requiring you to manually enable sleep each time?

I do not believe so. But you should be able to patch something together as a startup script (if you want to see/cancel stuff from the WebUI) or a systemd timer service if you want something easy.

Something like this should get you up and running.

[Unit]
Description=Poweroff after xx hours from boot
# Call necessary service
Unit=systemd-poweroff.service

[Timer]
# Power off 
OnBootSec=5h 30min

[Install]
WantedBy=timers.target

@acjohnson
Copy link
Author

Thanks for the response @ashthespy that systemd job wouldn't do anything remotely like what I am asking for but that's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants