Physical Channel Numbers?

Is there some way to get the Channels app to display the physical channel number, and not just the virtual number? (Using an HDHomeRun.) I was hoping it would be in the detailed info under Options (alongside codec, bitrate etc.).

Or, failing that, any way to get the info out of the HDHR even without Channels?

You can get the RF Frequency for each channel from the HDHR.
XML output
http://x.x.x.x/lineup.xml?show=all&tuning
JSON output
http://x.x.x.x/lineup.json?show=all&tuning

Where x.x.x.x is the IP address of the tuner.

2 Likes

Thanks. I wrote a little script to convert the frequencies to channel numbers, and list the results (change ADDR as needed) -- physical number, virtual number, callsign, encoding, other flags:

#!/usr/bin/env python

""" List virtual and physical channel numbers found by HDHomeRun """

import json
try:
    from urllib import request as r  # Python 3
except:
    import urllib as r               # Python 2

ADDR = '192.168.1.80'                # HDHomeRun IP
TEMP = 'http://%s/lineup.json?show=all&tuning'

# MHz to channel numbers 2-51

FREQS = {
    # low VHF
     57:  2,  63:  3,  69:  4,  79:  5,  85:  6,

    # high VHF
    177:  7, 183:  8, 189:  9, 195: 10, 201: 11, 207: 12, 213: 13,

    # core UHF
    473: 14, 479: 15, 485: 16, 491: 17, 503: 19, 509: 20, 515: 21,
    521: 22, 527: 23, 533: 24, 539: 25, 545: 26, 551: 27, 557: 28,
    563: 29, 569: 30, 575: 31, 581: 32, 587: 33, 593: 34, 599: 35,
    605: 36,

    # reserved
    611: 37,

    # shared with cell
    617: 38, 623: 39, 629: 40, 635: 41, 641: 42, 647: 43, 653: 44, 
    659: 45, 665: 46, 671: 47, 677: 48, 683: 49, 689: 50, 695: 51
}

def getf(num):
    return FREQS.get(num // 1000000, num)

def getn(item, name):
    return ['', name][item.get(name, 0)]

raw = r.urlopen(TEMP % ADDR).read()
data = json.loads(raw)

# Physical number, virtual number, name, codecs, flags

output = ['%2d.%04d %5s %-7.7s %-5.5s %-3.3s %-2.2s %s' % (
          getf(item.get('Frequency', 0)), item.get('ProgramNumber', 0),
          item.get('GuideNumber', ''), item.get('GuideName', ''),
          item.get('VideoCodec', ''), item.get('AudioCodec', ''),
          getn(item, 'HD'), getn(item, 'ATSC3')
          ) for item in data]

# HDHR reports in virtual channel order, but I want physical order

output.sort()

for item in output:
    print(item)

(meant to post this before now, sorry)

Example output:

 7.0001  32.1 WHUT    MPEG2 AC3 HD 
 7.0002  32.2 PBSKids MPEG2 AC3    
 7.0003   7.1 WJLA    MPEG2 AC3 HD 
 7.0004   7.2 Charge! MPEG2 AC3    
 7.0005   7.3 Comet   MPEG2 AC3    
 7.0006   7.4 TBD     MPEG2 AC3    
 9.0001   9.1 WUSA-HD MPEG2 AC3 HD 
 9.0002   9.2 Crime   MPEG2 AC3    
 9.0003   9.3 Quest   MPEG2 AC3    
 9.0004   9.4 Twist   MPEG2 AC3    
 9.0005  68.1 Entra   MPEG2 AC3 HD 
11.0001  13.1 WJZ-TV  MPEG2 AC3 HD 
11.0002  13.2 StartTV MPEG2 AC3    
11.0003  13.3 Dabl    MPEG2 AC3    
11.0004  13.4 FaveTV  MPEG2 AC3    
12.0003  11.1 WBAL-DT MPEG2 AC3 HD 
12.0004  11.2 MeTV    MPEG2 AC3    
12.0005  54.3 Comet   MPEG2 AC3    
12.0006  54.4 Stadium MPEG2 AC3    
12.0007  11.4 TheGrio MPEG2 AC3    
12.0008  5000 Unknown MPEG2 AC3    
15.0001  14.1 WFDC-DT MPEG2 AC3 HD 
15.0002  14.2 getTV   MPEG2 AC3    
15.0003  14.3 GRIT    MPEG2 AC3    
15.0004  14.4 UniMas  MPEG2 AC3    
15.0005  50.1 WDCW-DT MPEG2 AC3 HD 
15.0006  50.2 Antenna MPEG2 AC3    
15.0007  25.1 WDVM-SD MPEG2 AC3    
20.1001  69.1 WQAW-LD MPEG2 AC3 HD 
20.1002  69.2 WQAW-LD MPEG2 AC3    
20.1003  69.3 WQAW-LD MPEG2 AC3    
20.1004  69.4 WQAW-LD MPEG2 AC3    
20.1005  69.5 WQAW-LD MPEG2 AC3    
20.1006  69.6 WQAW-LD MPEG2 AC3    
20.1007  69.7 WQAW-LD MPEG2 AC3 HD 
20.1008  69.8 WQAW-LD MPEG2 AC3    
21.0001  22.1 MPT-HD  MPEG2 AC3 HD 
21.0002  22.2 MPT-2   MPEG2 AC3    
21.0003  22.3 MPTKIDS MPEG2 AC3    
21.0004  22.4 NHK-WLD MPEG2 AC3    
21.0005  54.1 CWWNUV  MPEG2 AC3 HD 
22.0001  67.1 MPT-HD  MPEG2 AC3 HD 
22.0002  67.2 MPT-2   MPEG2 AC3    
22.0003  67.3 MPTKIDS MPEG2 AC3    
22.0004  67.4 NHK-WLD MPEG2 AC3    
22.0005 54.11 CWWNUV  MPEG2 AC3 HD 
25.5002 145.1 WBFF    HEVC         ATSC3
25.5003 111.1 WBAL    HEVC         ATSC3
25.5004 102.1 WMAR    HEVC         ATSC3
25.5006 122.1 WMPT    HEVC         ATSC3
25.5007 154.1 WNUV    HEVC         ATSC3
26.0002  5001 Unknown MPEG2 AC3 HD 
26.0003  45.1 WBFF45  MPEG2 AC3 HD 
26.0004  45.2 MyTV    MPEG2 AC3 HD 
26.0005  24.1 WUTB    MPEG2 AC3    
26.0007  45.4 Charge! MPEG2 AC3    
27.0003   2.1 WMAR-HD MPEG2 AC3 HD 
27.0004   2.2 GRIT    MPEG2 AC3    
27.0005   2.3 BOUNCE  MPEG2 AC3    
27.0006   2.4 MYSTERY MPEG2 AC3    
27.0007   2.5 CourtTV MPEG2 AC3    
27.0008   2.6 Newsy   MPEG2 AC3    
27.0009  54.2 Antenna MPEG2 AC3    
30.5001 158.1 WIAV    HEVC         ATSC3
30.5005 158.4 WJLA247 HEVC         ATSC3
30.5006 158.5 24/7MMT HEVC         ATSC3
31.0001  26.1 WETA-HD MPEG2 AC3 HD 
31.0002  26.2 WETA UK MPEG2 AC3 HD 
31.0003  26.3 KIDS    MPEG2 AC3    
31.0004  26.4 WORLD   MPEG2 AC3    
31.0005  26.5 METRO   MPEG2 AC3 HD 
33.0001 132.1 WHUT    HEVC         ATSC3
33.0002 107.1 WJLA    HEVC         ATSC3
33.0003 105.1 WTTG    HEVC         ATSC3
33.0004 104.1 WRC     HEVC         ATSC3
33.0005 109.1 WUSA    HEVC         ATSC3
34.0003   4.1 WRC-HD  MPEG2 AC3 HD 
34.0004   4.2 COZI    MPEG2 AC3    
34.0005  44.1 WZDC    MPEG2 AC3 HD 
34.0006  44.2 XITOS   MPEG2 AC3    
34.0007   4.3 LX      MPEG2 AC3    
35.0003  66.1 ION     MPEG2 AC3 HD 
35.0004  66.2 Bounce  MPEG2 AC3 HD 
35.0005  66.3 CourtTV MPEG2 AC3    
35.0006  66.4 Laff    MPEG2 AC3    
35.0007  66.5 Mystery MPEG2 AC3    
35.0008  66.6 Defy TV MPEG2 AC3    
35.0009  66.7 NEWSY   MPEG2 AC3    
36.0003   5.1 WTTG-DT MPEG2 AC3 HD 
36.0004  20.1 WDCA    MPEG2 AC3 HD 
36.0005   5.2 BUZZR   MPEG2 AC3    
36.0006   5.3 ME TV   MPEG2 AC3    
36.0007  20.2 MOVIES  MPEG2 AC3    
36.0008  20.3 HEROES  MPEG2 AC3    
1 Like

Here's one you might want to consider adding:

497000000.0003 51.1