One request we’ve gotten a lot is for a sleep timer. Well, we still haven’t gotten around to it The good news is, with the Channels API, you can do it yourself!
With a simple cronjob, you can tell your Channels app to stop playing every day at the same time of night. With this approach, you don’t even have to set a sleep timer. You just get it free every night.
Caveat: cronjobs are specific to macOS and Linux, but I’m sure there’s an equivalent on Windows.
If you need to learn about setting up cronjobs, here’s a great post about them.
Here’s a great cheat sheet on the format:
* * * * * * | | | | | | | | | | | +-- Year (range: 1900-3000) | | | | +---- Day of the Week (range: 1-7, 1 standing for Monday) | | | +------ Month of the Year (range: 1-12) | | +-------- Day of the Month (range: 1-31) | +---------- Hour (range: 0-23) +------------ Minute (range: 0-59)
So lets say we want to stop Channels every night at 3am.
* 3 * * * * curl -X POST http://192.168.1.50:57000/api/stop
And that’s it! Replace the IP address with that of your device, and it will tell Channels to stop every night at 3am. No other tools needed.
Learn more about the Channels API on our site.