Antenna TV: A Remote, Guide and DVR for Broadcast TV

Antenna TV is the app our house uses for free over-the-air TV. It started as a phone remote for the Roku TV in the living room. Since then it has grown a program guide, a DVR, picks for each person in the house, and an app of its own on the TVs. It runs on our home server, on the home network.

Two phone screens of the Antenna TV app. The For you screen shows a grid of picked shows, each with its art, time, channel and the reason it was picked. The Remote screen shows the TV in standby with a Turn on TV button, volume buttons and a row of favorite channels
For you and the Remote screen, on a phone.

What it's built on

  • Two TCL Roku TVs. A Roku TV takes commands over the network through Roku's External Control Protocol, which is how the app tunes channels, changes the volume and opens other apps.
  • An HDHomeRun tuner on the antenna. It puts the antenna's channels on the network. It also has a free guide feed with about two days of listings, and it reports how strong each station's signal is.
  • Jellyfin. It does the recording, and it converts broadcast video into something a browser can play.
  • A small Node server and a page in plain JavaScript. The page installs to a phone's home screen like an app.

The remote

The Remote screen has two sides. Channels is for the antenna: favorite channels and the full channel list, with station logos and what's on now. Tapping a channel turns the TV on if it's off and tunes it in one step.

Buttons is a whole Roku remote for everything else: the arrows, OK, Back, Home, play and pause, and a keyboard. Typing on the phone types into the TV's search box, which beats picking letters with arrow keys. The screen follows the TV. It shows Channels when the TV is on the antenna and Buttons when it's in a streaming app.

Everyone in the house has a profile with their own favorites. There are no logins. Each phone just remembers whose it is.

The guide and the DVR

Three phone screens. The Guide is a time grid of channels and shows with a line marking the current time. The DVR lists recordings coming up and ones already recorded. The Signal screen shows a bar for each station's signal and says 13 of 14 stations have a picture
The Guide, the DVR and the Signal screen.

The guide is a time grid of about two days of listings, from the HDHomeRun's feed. It has search, and each channel is marked HD or SD. That mark matters on a big TV, because many subchannels broadcast in standard definition at a fraction of the main channel's quality.

Jellyfin does the recording, and the app decides what to record. Any show can be recorded once. A series can be recorded for new episodes only or for every episode, and a game has "every game" for its team. There is also a "record anything named" box that works as a wishlist: it records a match as soon as one shows up in the guide.

A few details took more work than the buttons did:

  • It prefers HD. When an episode airs on both an HD and an SD channel, the HD airing is the one that records.
  • Each episode records once. Episodes are tracked by the guide's episode id, so a rerun of something already recorded is skipped.
  • It catches repeats by sound. Some listings have no episode id, title or description at all, so the guide can't say whether an airing is a repeat. When one of those recordings finishes, the server fingerprints its audio and compares it with earlier recordings of the same show. If it matches, the new recording is deleted.

Picks for each person

The For you screen is a grid of shows picked for whoever is holding the phone, and each card says why it was picked. The app learns from what gets watched, recorded and tuned, and from thumbs up and down on a show. A profile can also list interests in the person's own words, and it can be set for a grown-up, a teen or a kid, which limits picks by rating.

The For you screen in a desktop browser. A sidebar holds the TV's status, volume and the list of screens, and the main area is a grid of picked shows
The same screen on a computer, where the tabs become a sidebar.

Three different pickers can rank the shows, and the house chooses which one to use:

  • Rules. Plain scoring in code: shows and kinds of shows the person has watched, favorite channels, habits, new episodes and big live games.
  • Claude Haiku. It orders a shortlist from the rules and writes the reason on each card.
  • Jev. A scoring model from TypeSafe. It judges every show on its own and gives each a score, shown as the small percentage on a card's art.

A Picks lab screen shows all three side by side for one person, with how long each took and what it cost. We're using Jev at the moment.

Picks cover streaming too. The app can't see inside Netflix or Disney+, but it knows what each service carries, so a pick can be something on a service we have. Tapping it opens that title on the TV, or the service's app when the title can't be linked.

Watching on the phone

Any channel or recording can also play right in the page. Browsers can't play broadcast video directly, so Jellyfin converts it on the server as it plays. A data saver setting cuts the stream to about a third of the size for phones on mobile data. A recording picks up where that person left off, on the phone or on the TV.

The app on the TV

A Roku has no browser, so the TVs got their own app, written in Roku's BrightScript. It's a thin client. The picks, guide and recording logic all stay on the server, and the TV app uses the page's colors and fonts.

The For you screen on a TV. The focused pick fills the top of the screen with its art, description and where it streams, above a Ready to watch row of show cards
For you on the TV, from an early build of the app.

Live TV plays through the server, which keeps the last two hours of the channel. That gives broadcast TV the controls of a recording: pause, rewind, skip, and go back to live. Pressing OK while watching brings up a banner with what's on and what's next, plus a row of that person's picks that are on right now.

A channel playing on the TV with a banner over the lower part of the picture. The banner names the channel and show, and below it is a row of cards for other shows that are on now
A channel playing, with the banner and the On now row open.

Closed captions were the surprise. Roku's video player doesn't draw the captions that come with broadcast video, so the server reads them out of the broadcast and the app draws them itself.

The Guide on the TV: a time grid with favorite channels first, and the focused show's title, description and art above it
The Guide on the TV.

Aiming the antenna

The Signal screen is a live meter for aiming the antenna. While it's open, the server uses the tuner's spare tuners to read each station's signal in turn, a full pass about every ten seconds. Move the antenna a little, wait for the bars, and repeat. It only uses tuners that are idle, so it never interrupts a recording.

Things Roku taught me

  • A launch can succeed and do nothing. The TV answers OK to a command even when it ignores it, so the server checks what the TV is actually showing after every tune.
  • Live streams need care. Sending live TV to the Roku in the usual streaming format took almost eight seconds to change channel. Sending the broadcast's own video as one continuous stream brought that down to between three and six.
  • Times lose precision. BrightScript does division in single-precision floating point, so times in milliseconds came out up to a minute off until I handled them as text.

Where it stands

It's what we use to watch and record broadcast TV at home, on both TVs and on our phones. It's still growing: recordings don't have captions on the TV yet, for one.