devices

The devices table contains all of the necessary information for the device you are using, this includes the device name, device type, IP address of the device, and the roles or capabilities the device has. These fields will be described in greater detail down below.

Sample CouchDB Entry for Raspberry Pi device:

{
  "_id": "BLDG-RM-CP1", (1)
  "_rev": "1-1d3b5f66d895b3bb1e9c7e5671488ea1", (2)
  "name": "CP1", (3)
  "address": "BLDG-RM-CP1.youruniversity.edu", (4)
  "description": "BLDG-RM", (5)
  "display_name": "BLDG-RM", (6)
  "type": { (7)
    "_id": "Pi3"
  },
  "roles": [ (8)
    {
      "_id": "ControlProcessor",
      "description": "ControlProcessor"
    },
    {
      "_id": "EventRouter",
      "description": "EventRouter"
    },
    {
      "_id": "Touchpanel",
      "description": "Touchpanel"
    }
  ],
  "ports": [] (9)
}
  1. "_id": Unique identifier of JSON Document in CouchDB. An ID is automatically generated when making a new document but can be changed to something more readable like "BLDG-RM-CP1" (CP - Control Processor) or any ID of your choice.

  2. "_rev": Revision token that is automatically generated by CouchDB. Do not worry about changing this, Couch simply uses this token for optimistic-concurrency detection. For more information about this field refer to CouchDB’s documentation

  3. "name": Name of the device.

  4. "address": This is the IP address of the device. if you have DNS resolution set up in your organization you can assign a name to the IP address abnd use the name as shown in the above example, or you can simply put in the IP address (i.e. 10.254.254.254).

  5. "description": Description of the device, this field is for your benefit to include any descriptive information you want stored.

  6. "display_name": The name that you want displayed for the device.

  7. "type": Type refers to the device type. The "_id" maps back to a document in the device_types database. This will be explained in greater detail in the device_types section.

  8. "roles": A list of roles that the device has. A complete list of roles and how they relate to each device can be found here.

  9. "ports": A list of the ports on the device. A Pi does not have any ports so the array is empty. This will make more sense in the next device example.

Sample CouchDB Entry for Sony XBR device:

{
  "_id": "BLDG-RM-D1", (1)
  "_rev": "1-de858339580876573735386f7a4a218e", (1)
  "name": "D1", (1)
  "address": "255.255.255.255", (1)
  "description": "Display 1", (1)
  "display_name": "Display 1",(1)
  "type": { (1)
    "_id": "SonyXBR"
  },
  "roles": [ (1)
    {
      "_id": "AudioOut",
      "description": "AudioOut"
    },
    {
      "_id": "VideoOut",
      "description": "VideoOut"
    }
  ],
  "ports": [ (2)
    {
      "_id": "hdmi!2", (3)
      "friendly_name": "SonyTv HDMI input 2", (4)
      "source_device": "BLDG-RM-SW1", (5)
      "destination_device": "BLDG-RM-D2", (6)
      "description": "SonyTv HDMI input 2" (7)
    }
  ]
}
  1. All of these fields have been explained in the above example

  2. "ports": A list of the ports on the device. Each input for the Sony Display that is used will be listed in this array.

  3. "_id": ID of the port, "hdmi!2" is the format used in communicating with the Sony XBR display.

  4. "friendly_name": What you want the input to be named on the UI

  5. "source_device": The source device of the input coming into the TV (i.e. video switcher, computer, HDMI Pass through etc.). This is the ID of the document for the source device.

  6. "destination_device": The destination device of the incoming input. The source and destination device combined indicate the directionality of the video input.

  7. "description": A description of the port, this field is for your benefit to include any descriptive information you want stored.