Volumio2
Volumio2 copied to clipboard
Automatic sleep timer to stop music playing after a set time
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.
Hmm does Settings>Sleep
not work for you?
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?
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
Thanks for the response @ashthespy that systemd job wouldn't do anything remotely like what I am asking for but that's ok.