Schemas

Each spec version's files are in their own folder; v1/ is the current one.

kinds.json and buttons.json are data tables the spec refers to, not schemas; the *.schema.json files describe their shape. In kinds.json, ids are unique, other exists, and each Harmony device type maps to one kind. In buttons.json, buttons are unique, and no button lists a candidate twice.

profile.schema.json

The JSON Schema (2020-12) for a profile. The specification adds the rules a schema can't express.

View Download

Show file
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/maddox/hubbo-profiles/main/docs/schema/v1/profile.schema.json",
  "title": "Hubbo device profile",
  "description": "The shape of a device profile: one device on one platform.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "id", "revision", "source", "manufacturer", "model", "kind", "platform", "commands"],
  "properties": {
    "schema_version": { "const": 1 },
    "id": {
      "type": "string",
      "pattern": "^(harmony:[0-9]{1,48}|(hubbo|user):[a-z0-9][a-z0-9.-]{0,47})$"
    },
    "revision": { "type": "integer", "minimum": 1 },
    "source": { "enum": ["hubbo", "harmony", "user"] },
    "manufacturer": { "$ref": "#/$defs/displayName" },
    "model": { "$ref": "#/$defs/displayName" },
    "kind": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$", "description": "A kind from kinds.json." },
    "platform": { "enum": ["ble_hid", "ir"] },
    "commands": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 512,
      "propertyNames": { "$ref": "#/$defs/commandName" }
    },
    "buttons": {
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-z0-9_]{1,32}$": {
          "oneOf": [{ "$ref": "#/$defs/commandName" }, { "type": "null" }]
        }
      }
    },
    "power": { "$ref": "#/$defs/power" },
    "timing": { "$ref": "#/$defs/timing" },
    "inputs": {
      "type": "array",
      "maxItems": 64,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "steps"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 64 },
          "steps": { "$ref": "#/$defs/steps" }
        }
      }
    },
    "channels": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "digits": { "type": "integer", "minimum": 1, "maximum": 4 },
        "start": { "$ref": "#/$defs/commandName" },
        "finish": { "$ref": "#/$defs/commandName" }
      }
    },
    "meta": { "$ref": "#/$defs/meta" }
  },
  "allOf": [
    {
      "if": { "properties": { "platform": { "const": "ble_hid" } } },
      "then": {
        "properties": {
          "commands": { "additionalProperties": { "$ref": "#/$defs/bleHidCommand" } },
          "timing": { "not": { "required": ["ir_repeats"] } }
        }
      }
    },
    {
      "if": { "properties": { "platform": { "const": "ir" } } },
      "then": {
        "properties": { "commands": { "additionalProperties": { "$ref": "#/$defs/irCommand" } } }
      }
    }
  ],
  "$defs": {
    "displayName": { "type": "string", "minLength": 1, "maxLength": 64 },
    "commandName": { "type": "string", "pattern": "^[A-Za-z0-9]{1,32}$" },
    "hold_ms": { "type": "integer", "minimum": 1, "maximum": 10000 },
    "label": { "type": "string", "minLength": 1, "maxLength": 32 },
    "bleHidCommand": {
      "type": "object",
      "additionalProperties": false,
      "required": ["page", "usage"],
      "properties": {
        "page": { "enum": ["keyboard", "consumer"] },
        "usage": { "type": "string" },
        "hold_ms": { "$ref": "#/$defs/hold_ms" },
        "label": { "$ref": "#/$defs/label" }
      },
      "allOf": [
        {
          "if": { "properties": { "page": { "const": "keyboard" } } },
          "then": { "properties": { "usage": { "pattern": "^0x(0[4-9A-F]|[1-5][0-9A-F]|6[0-5])$" } } }
        },
        {
          "if": { "properties": { "page": { "const": "consumer" } } },
          "then": { "properties": { "usage": { "pattern": "^0x0([1-3][0-9A-F]{2}|0[1-9A-F][0-9A-F]|00[1-9A-F])$" } } }
        }
      ]
    },
    "irCommand": {
      "type": "object",
      "additionalProperties": false,
      "required": ["pronto"],
      "properties": {
        "pronto": { "$ref": "#/$defs/pronto" },
        "pronto_toggle": { "$ref": "#/$defs/pronto" },
        "hold_ms": { "$ref": "#/$defs/hold_ms" },
        "label": { "$ref": "#/$defs/label" }
      }
    },
    "pronto": { "type": "string", "pattern": "^0000 [0-9A-F]{4} [0-9A-F]{4} [0-9A-F]{4}( [0-9A-F]{4} [0-9A-F]{4})+$" },
    "steps": {
      "type": "array",
      "minItems": 1,
      "maxItems": 16,
      "items": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": ["command"],
            "properties": {
              "command": { "$ref": "#/$defs/commandName" },
              "hold_ms": { "$ref": "#/$defs/hold_ms" }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": ["delay_ms"],
            "properties": { "delay_ms": { "type": "integer", "minimum": 1, "maximum": 60000 } }
          }
        ]
      }
    },
    "power": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type"],
      "properties": {
        "type": { "enum": ["discrete", "toggle", "none"] },
        "on": { "$ref": "#/$defs/steps" },
        "off": { "$ref": "#/$defs/steps" },
        "toggle": { "$ref": "#/$defs/steps" },
        "on_delay_ms": { "type": "integer", "minimum": 0, "maximum": 60000 }
      },
      "allOf": [
        {
          "if": { "properties": { "type": { "const": "discrete" } } },
          "then": { "required": ["on", "off"], "not": { "required": ["toggle"] } }
        },
        {
          "if": { "properties": { "type": { "const": "toggle" } } },
          "then": { "required": ["toggle"], "not": { "anyOf": [{ "required": ["on"] }, { "required": ["off"] }] } }
        },
        {
          "if": { "properties": { "type": { "const": "none" } } },
          "then": { "properties": { "on": false, "off": false, "toggle": false, "on_delay_ms": false } }
        }
      ]
    },
    "timing": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "key_delay_ms": { "type": "integer", "minimum": 0, "maximum": 5000 },
        "input_delay_ms": { "type": "integer", "minimum": 0, "maximum": 60000 },
        "ir_repeats": { "type": "integer", "minimum": 0, "maximum": 20 }
      }
    },
    "meta": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "confidence": { "enum": ["high", "medium", "low"] },
        "sources": { "type": "array", "items": { "type": "string", "maxLength": 300 } },
        "notes": { "type": "array", "items": { "type": "string", "maxLength": 500 } },
        "verify": { "type": "array", "items": { "type": "string", "maxLength": 300 } },
        "harmony": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "global_device_id": { "type": "integer" },
            "device_type": { "type": "integer" },
            "codeset": { "type": "string" }
          }
        }
      }
    }
  }
}

kinds.json

The device kinds.

View Download

idlabel
tvTV
tv_vcrTV/VCR combo
tv_dvdTV/DVD combo
tv_dvd_vcrTV/DVD/VCR combo
tv_dvrTV with recorder
projectorProjector
streamerStreaming player
set_top_boxSet-top box
cable_boxCable box
cable_dvrCable DVR
satellite_boxSatellite box
consoleGame console
computerComputer
disc_playerDVD or Blu-ray player
dvd_recorderDVD recorder
dvd_vcrDVD/VCR combo
dvd_recorder_vcrDVD recorder/VCR combo
vcrVCR
laserdiscLaserDisc player
home_theaterHome theater system
home_theater_vcrHome theater with VCR
receiverAV receiver
amplifierAmplifier or soundbar
speakerSpeaker
mini_systemStereo system
tunerRadio tuner
cd_playerCD player
cd_changerCD changer
tape_deckTape deck
dat_deckDAT deck
minidiscMiniDisc
portable_audioMusic player or dock
hdmi_switchHDMI switch
climateClimate
fanFan
coverCover
lightLight
switchSwitch
smart_home_hubSmart home hub
sceneScene
scriptScript
accessoryAccessory
otherOther
Show file
{
  "schema_version": 1,
  "kinds": [
    { "id": "tv", "label": "TV", "harmony": [1, 13] },
    { "id": "tv_vcr", "label": "TV/VCR combo", "harmony": [15] },
    { "id": "tv_dvd", "label": "TV/DVD combo", "harmony": [37] },
    { "id": "tv_dvd_vcr", "label": "TV/DVD/VCR combo", "harmony": [38] },
    { "id": "tv_dvr", "label": "TV with recorder", "harmony": [48] },
    { "id": "projector", "label": "Projector", "harmony": [7] },
    { "id": "streamer", "label": "Streaming player", "harmony": [35, 51, 52, 63] },
    { "id": "set_top_box", "label": "Set-top box", "harmony": [18] },
    { "id": "cable_box", "label": "Cable box", "harmony": [12] },
    { "id": "cable_dvr", "label": "Cable DVR", "harmony": [14] },
    { "id": "satellite_box", "label": "Satellite box", "harmony": [16] },
    { "id": "console", "label": "Game console", "harmony": [9, 23] },
    { "id": "computer", "label": "Computer", "harmony": [8, 10] },
    { "id": "disc_player", "label": "DVD or Blu-ray player", "harmony": [4] },
    { "id": "dvd_recorder", "label": "DVD recorder", "harmony": [34] },
    { "id": "dvd_vcr", "label": "DVD/VCR combo", "harmony": [25] },
    { "id": "dvd_recorder_vcr", "label": "DVD recorder/VCR combo", "harmony": [47] },
    { "id": "vcr", "label": "VCR", "harmony": [2] },
    { "id": "laserdisc", "label": "LaserDisc player", "harmony": [28] },
    { "id": "home_theater", "label": "Home theater system", "harmony": [22] },
    { "id": "home_theater_vcr", "label": "Home theater with VCR", "harmony": [32] },
    { "id": "receiver", "label": "AV receiver", "harmony": [5] },
    { "id": "amplifier", "label": "Amplifier or soundbar", "harmony": [19] },
    { "id": "speaker", "label": "Speaker", "harmony": [] },
    { "id": "mini_system", "label": "Stereo system", "harmony": [21] },
    { "id": "tuner", "label": "Radio tuner", "harmony": [36] },
    { "id": "cd_player", "label": "CD player", "harmony": [3] },
    { "id": "cd_changer", "label": "CD changer", "harmony": [11] },
    { "id": "tape_deck", "label": "Tape deck", "harmony": [6] },
    { "id": "dat_deck", "label": "DAT deck", "harmony": [20] },
    { "id": "minidisc", "label": "MiniDisc", "harmony": [29] },
    { "id": "portable_audio", "label": "Music player or dock", "harmony": [33] },
    { "id": "hdmi_switch", "label": "HDMI switch", "harmony": [30] },
    { "id": "climate", "label": "Climate", "harmony": [45, 59] },
    { "id": "fan", "label": "Fan", "harmony": [] },
    { "id": "cover", "label": "Cover", "harmony": [] },
    { "id": "light", "label": "Light", "harmony": [24] },
    { "id": "switch", "label": "Switch", "harmony": [999] },
    { "id": "smart_home_hub", "label": "Smart home hub", "harmony": [53] },
    { "id": "scene", "label": "Scene", "harmony": [] },
    { "id": "script", "label": "Script", "harmony": [] },
    { "id": "accessory", "label": "Accessory", "harmony": [44] },
    { "id": "other", "label": "Other", "harmony": [] }
  ]
}

kinds.schema.json

The shape of kinds.json.

View Download

Show file
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/maddox/hubbo-profiles/main/docs/schema/v1/kinds.schema.json",
  "title": "Hubbo device kinds",
  "description": "The shape of kinds.json: each device kind's id, display label and the Harmony device types that map to it.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "kinds"],
  "properties": {
    "schema_version": { "const": 1 },
    "kinds": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "label", "harmony"],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$" },
          "label": { "type": "string", "minLength": 1, "maxLength": 32 },
          "harmony": { "type": "array", "uniqueItems": true, "items": { "type": "integer" } }
        }
      }
    }
  }
}

buttons.json

The default command for each remote button.

View Download

buttonrolecandidates
upwatchDirectionUp
downwatchDirectionDown
leftwatchDirectionLeft
rightwatchDirectionRight
selectwatchSelect, OK, Enter
menuwatchMenu, Home, Setup, Settings, Options
backwatchBack, Exit, Return
exitwatchExit, Back, Return
infowatchInfo, Display, OSD
guidewatchGuide, EPG, TvGuide
dvrwatchDVR, RecordList, Recordings
playwatchPlay, PlayPause
pausewatchPause, PlayPause
stopwatchStop
recordwatchRecord
skip_forwardwatchFastForward, SkipForward, NextTrack, ChapterNext
skip_backwardwatchRewind, SkipBack, PreviousTrack, ChapterPrev
redwatchRed
greenwatchGreen
yellowwatchYellow
bluewatchBlue
number_1watch1
number_2watch2
number_3watch3
number_4watch4
number_5watch5
number_6watch6
number_7watch7
number_8watch8
number_9watch9
number_0watch0
number_dot_dashwatchDash, Dot
number_enterwatchNumberEnter, Enter, OK, Select
channel_upwatchChannelUp
channel_downwatchChannelDown
volume_upvolumeVolumeUp
volume_downvolumeVolumeDown
mutevolumeMute, MuteToggle
Show file
{
  "schema_version": 1,
  "buttons": [
    { "button": "up", "role": "watch", "candidates": ["DirectionUp"] },
    { "button": "down", "role": "watch", "candidates": ["DirectionDown"] },
    { "button": "left", "role": "watch", "candidates": ["DirectionLeft"] },
    { "button": "right", "role": "watch", "candidates": ["DirectionRight"] },
    { "button": "select", "role": "watch", "candidates": ["Select", "OK", "Enter"] },
    { "button": "menu", "role": "watch", "candidates": ["Menu", "Home", "Setup", "Settings", "Options"] },
    { "button": "back", "role": "watch", "candidates": ["Back", "Exit", "Return"] },
    { "button": "exit", "role": "watch", "candidates": ["Exit", "Back", "Return"] },
    { "button": "info", "role": "watch", "candidates": ["Info", "Display", "OSD"] },
    { "button": "guide", "role": "watch", "candidates": ["Guide", "EPG", "TvGuide"] },
    { "button": "dvr", "role": "watch", "candidates": ["DVR", "RecordList", "Recordings"] },
    { "button": "play", "role": "watch", "candidates": ["Play", "PlayPause"] },
    { "button": "pause", "role": "watch", "candidates": ["Pause", "PlayPause"] },
    { "button": "stop", "role": "watch", "candidates": ["Stop"] },
    { "button": "record", "role": "watch", "candidates": ["Record"] },
    { "button": "skip_forward", "role": "watch", "candidates": ["FastForward", "SkipForward", "NextTrack", "ChapterNext"] },
    { "button": "skip_backward", "role": "watch", "candidates": ["Rewind", "SkipBack", "PreviousTrack", "ChapterPrev"] },
    { "button": "red", "role": "watch", "candidates": ["Red"] },
    { "button": "green", "role": "watch", "candidates": ["Green"] },
    { "button": "yellow", "role": "watch", "candidates": ["Yellow"] },
    { "button": "blue", "role": "watch", "candidates": ["Blue"] },
    { "button": "number_1", "role": "watch", "candidates": ["1"] },
    { "button": "number_2", "role": "watch", "candidates": ["2"] },
    { "button": "number_3", "role": "watch", "candidates": ["3"] },
    { "button": "number_4", "role": "watch", "candidates": ["4"] },
    { "button": "number_5", "role": "watch", "candidates": ["5"] },
    { "button": "number_6", "role": "watch", "candidates": ["6"] },
    { "button": "number_7", "role": "watch", "candidates": ["7"] },
    { "button": "number_8", "role": "watch", "candidates": ["8"] },
    { "button": "number_9", "role": "watch", "candidates": ["9"] },
    { "button": "number_0", "role": "watch", "candidates": ["0"] },
    { "button": "number_dot_dash", "role": "watch", "candidates": ["Dash", "Dot"] },
    { "button": "number_enter", "role": "watch", "candidates": ["NumberEnter", "Enter", "OK", "Select"] },
    { "button": "channel_up", "role": "watch", "candidates": ["ChannelUp"] },
    { "button": "channel_down", "role": "watch", "candidates": ["ChannelDown"] },
    { "button": "volume_up", "role": "volume", "candidates": ["VolumeUp"] },
    { "button": "volume_down", "role": "volume", "candidates": ["VolumeDown"] },
    { "button": "mute", "role": "volume", "candidates": ["Mute", "MuteToggle"] }
  ]
}

buttons.schema.json

The shape of buttons.json.

View Download

Show file
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/maddox/hubbo-profiles/main/docs/schema/v1/buttons.schema.json",
  "title": "Hubbo remote button table",
  "description": "The shape of buttons.json: each remote button, its role and the commands that can fill it.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "buttons"],
  "properties": {
    "schema_version": { "const": 1 },
    "buttons": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["button", "role", "candidates"],
        "properties": {
          "button": {
            "enum": ["up", "down", "left", "right", "select", "menu", "back", "exit", "info", "guide",
                     "dvr", "play", "pause", "stop", "record", "skip_forward", "skip_backward",
                     "red", "green", "yellow", "blue", "number_0", "number_1", "number_2", "number_3",
                     "number_4", "number_5", "number_6", "number_7", "number_8", "number_9",
                     "number_dot_dash", "number_enter", "channel_up", "channel_down",
                     "volume_up", "volume_down", "mute"]
          },
          "role": { "enum": ["watch", "volume"] },
          "candidates": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": { "type": "string", "pattern": "^[A-Za-z0-9]{1,32}$" }
          }
        }
      }
    }
  }
}

This page comes from docs/schema/README.md in Hubbo Device Profiles. The spec and its schemas are CC0.