Introducing Smart Playlists
ask Dave Grohl how to write a hit song and he might tell you: 4 chords and a dream.
inspired by music, art, and a bias for simplicity, TRMNL devices are controlled by a single interface: Playlists. connect a plugin, drag it around, and decide how often it "plays."
but a few months have passed and we've heard compelling reasons to offer more granularity.
use cases
- only show the weather if it's raining
- hide football scores if the season is over (or: my team is losing)
- don't show recipes on the kitchen TRMNL unless i'm home
- remind me of upcoming movies if it's the weekend
today, all of this is possible with a suite of utilities we refer to as Smart Playlists.
Tool - Plugin "skip render" variable
for private plugins, you may now control if a screen is even rendered at all.
inside your markup, do this:
{% if condition %}
<script>
window.TRMNL_SKIP_SCREEN_GENERATION = true;
</script>
{% endif %}
when your plugin is evaluated by the screen generation engine, we'll check for this variable. if it's "true", TRMNL won't generate a new screen.
helpful for seasonal plugins or giving older content a chance to linger a bit longer before losing statefulness.
Tool - Playlist "skip display" variable
for private plugins, determine if a given instance should be skipped when your device wakes up and requests that item in your playlist.
inside your markup, do this:
{% if condition %}
<script>
window.TRMNL_SKIP_DISPLAY = true;
</script>
{% endif %}
Tool - Playlist "skip if stale" mode
complimenting the skip variable is a new toggle in your Playlists editor:

this is also helpful for webhook-driven plugins whose content updates on unpredictable schedules, versus fetch based plugins that refresh on a regular interval.
Tool - API "hide playlist item" endpoint
last month we added the ability to hide a Playlist Item by simply toggling the eyeball icon.

now, it's also available via the API.
GET /api/playlist_items
PATCH /api/playlist_items/{id}
authenticate with your Account-level API Key. more details in the [beta] docs.
putting it all together
the tools above can help you build programmatic playlists that don't require babysitting the TRMNL interface.
if you're looking for more no-code options, we hear you. as TRMNL community developers test out these features, we'll extract them into buttons and switches.
in addition to the features above, you may configure playlist items by time of day or day of week. because you're not the only one who wants to ignore calendar appointments on a beautiful Saturday afternoon.
smarter playlists, fewer distractions.