Demo DB Tables

These documents below are the documents automatically added to your Couch DB by using the python script.

Each section below will have all of the DB Documents you need for that table. Explanations of each of these tables and the meaning of the fields in these documents can be found in the Complete Database Guide.

Using the script is the much faster and seamless way of doing this demo. It is much more time intensive to create each of the tables by hand and then manually copy and paste the documents below.

devices

Below are the documents required for the devices table.

Raspberry Pi Document:

{
  "_id": "DEMO-123-CP1",
  "_rev": "[Keep this from the new document you create]",
  "name": "CP1",
  "address": "DEMO-123-CP1.youruniversity.edu", (1)
  "description": "DEMO-123",
  "display_name": "DEMO-123",
  "type": {
    "_id": "Pi3"
  },
  "roles": [
    {
      "_id": "ControlProcessor",
      "description": "ControlProcessor"
    },
    {
      "_id": "EventRouter",
      "description": "EventRouter"
    },
    {
      "_id": "Touchpanel",
      "description": "Touchpanel"
    }
  ],
  "ports": []
}
  1. Replace this with your IP address.

Sony XBR device document:

{
  "_id": "DEMO-123-D1",
  "_rev": "[Keep this from the new document you create]",
  "name": "D1",
  "address": "255.255.255.255", (1)
  "description": "Display 1",
  "display_name": "Display 1",
  "type": {
    "_id": "SonyXBR"
  },
  "roles": [
    {
      "_id": "AudioOut",
      "description": "AudioOut"
    },
    {
      "_id": "VideoOut",
      "description": "VideoOut"
    }
  ],
  "ports": [
    {
      "_id": "hdmi!2",
      "friendly_name": "SonyTv HDMI input 2",
      "source_device": "DEMO-123-HDMI1",
      "destination_device": "DEMO-123-D1",
      "description": "SonyTv HDMI input 2"
    },
    {
      "_id": "hdmi!3",
      "friendly_name": "SonyTv HDMI input 3",
      "source_device": "DEMO-123-HDMI2",
      "destination_device": "DEMO-123-D1",
      "description": "SonyTv HDMI input 3"
    },
    {
      "_id": "hdmi!4",
      "friendly_name": "SonyTv HDMI input 4",
      "source_device": "DEMO-123-HDMI3",
      "destination_device": "DEMO-123-D1",
      "description": "SonyTv HDMI input 4"
    }
  ]
}
  1. Replace this with your IP address.

HDMI1 device document:

{
  "_id": "DEMO-123-HDMI1",
  "_rev": "[Keep this from the new document you create]",
  "name": "HDMI1",
  "address": "0.0.0.0",
  "description": "HDMI",
  "display_name": "HDMI",
  "type": {
    "_id": "non-controllable"
  },
  "roles": [
    {
      "_id": "AudioIn",
      "description": "AudioIn"
    },
    {
      "_id": "VideoIn",
      "description": "VideoIn"
    }
  ],
  "ports": []
}

Create two more of these documents and change the ID of one to DEMO-123-HDMI2 and its name to HDMI2, and the other document’s ID to DEMO-123-HDMI3 and its name to HDMI3. Note: if you used the script to automatically import the documents into your DB, all three have already been created for you

device_types

Raspberry Pi device_type document:

{
  "_id": "Pi3",
  "_rev": "[Keep this from the new document you create]",
  "description": "A Raspberry Pi 3",
  "display_name": "Pi",
  "roles": [
    {
      "_id": "ControlProcessor",
      "description": "Acts as a device to control the AV-API in a room"
    },
    {
      "_id": "Touchpanel",
      "description": "A device with a touchscreen interface"
    },
    {
      "_id": "EventRouter",
      "description": "Acts as a device that routes events through the room to other devices"
    }
  ],
  "commands": [
    {
      "_id": "GenericPassthroughADCP",
      "description": "GenericPassthroughADCP",
      "microservice": {
        "_id": "generic-gateway-Adcp",
        "description": "used to serialize requests to and ADCP device",
        "address": "http://:gateway:8012"
      },
      "endpoint": {
        "_id": "Generic Gateway",
        "description": "A generic Gateway for use in base case where microservice exists outside of the pi issuing the requests.",
        "path": "/:path"
      },
      "priority": 1
    }
  ]
}

SONY XBR device_type document:

{
  "_id": "SonyXBR",
  "_rev": "[Keep this from the new document you create]",
  "description": "Sony XBR TV.",
  "display_name": "Sony XBR TV",
  "output": true,
  "destination": true,
  "roles": [
    {
      "_id": "AudioOut",
      "description": "Acts as an audio output device"
    },
    {
      "_id": "VideoOut",
      "description": "Acts as a video output device"
    }
  ],
  "power_states": [
    {
      "_id": "On",
      "description": "On",
      "tags": []
    },
    {
      "_id": "Standby",
      "description": "Standby",
      "tags": []
    }
  ],
  "ports": [
    {
      "_id": "hdmi!1",
      "friendly_name": "HDMI 1",
      "description": "SonyTV HDMI input 1",
      "tags": [
        "port-in",
        "video"
      ]
    },
    {
      "_id": "hdmi!2",
      "friendly_name": "HDMI 2",
      "description": "SonyTV HDMI input 2",
      "tags": [
        "port-in",
        "video"
      ]
    },
    {
      "_id": "hdmi!3",
      "friendly_name": "HDMI 3",
      "description": "SonyTV HDMI input 3",
      "tags": [
        "port-in",
        "video"
      ]
    },
    {
      "_id": "hdmi!4",
      "friendly_name": "HDMI 4",
      "description": "SonyTV HDMI input 4",
      "tags": [
        "port-in",
        "video"
      ]
    }
  ],
  "commands": [
    {
      "_id": "Standby",
      "description": "Standby",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "Standby",
        "description": "Standard standby endpoint.",
        "path": "/:address/power/standby"
      },
      "priority": 100
    },
    {
      "_id": "PowerOn",
      "description": "PowerOn",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "PowerOn",
        "description": "Standard PowerOn endpoint.",
        "path": "/:address/power/on"
      },
      "priority": 1
    },
    {
      "_id": "STATUS_Power",
      "description": "STATUS_Power",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "StatusPower",
        "description": "Standard power state endpoint",
        "path": "/:address/power/status"
      },
      "priority": 20
    },
    {
      "_id": "STATUS_Volume",
      "description": "STATUS_Volume",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "StatusVolume",
        "description": "Standard volume state endpoint",
        "path": "/:address/volume/level"
      },
      "priority": 20
    },
    {
      "_id": "STATUS_Muted",
      "description": "STATUS_Muted",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "StatusMute",
        "description": "Standard mute state endpoint",
        "path": "/:address/volume/mute/status"
      },
      "priority": 20
    },
    {
      "_id": "STATUS_Blanked",
      "description": "STATUS_Blanked",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "StatusBlank",
        "description": "Standard display status endpoint",
        "path": "/:address/display/status"
      },
      "priority": 20
    },
    {
      "_id": "ChangeInput",
      "description": "ChangeInput",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "ChangeInput",
        "description": "Standard ChangeInput endpoint.",
        "path": "/:address/input/:port"
      },
      "priority": 10
    },
    {
      "_id": "SetVolume",
      "description": "SetVolume",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "SetVolume",
        "description": "Standart SetVolume endpoint",
        "path": "/:address/volume/set/:level"
      },
      "priority": 10
    },
    {
      "_id": "BlankDisplay",
      "description": "BlankDisplay",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "BlankScreen",
        "description": "Standard BlankScreen endpoint.",
        "path": "/:address/display/blank"
      },
      "priority": 10
    },
    {
      "_id": "UnBlankDisplay",
      "description": "UnBlankDisplay",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "UnBlankScreen",
        "description": "Standard UnBlankScreen endpoint.",
        "path": "/:address/display/unblank"
      },
      "priority": 7
    },
    {
      "_id": "Mute",
      "description": "Mute",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "Mute",
        "description": "Standard Mute endpoint",
        "path": "/:address/volume/mute"
      },
      "priority": 10
    },
    {
      "_id": "UnMute",
      "description": "UnMute",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "UnMute",
        "description": "Standard UnMute endpoint",
        "path": "/:address/volume/unmute"
      },
      "priority": 10
    },
    {
      "_id": "STATUS_Input",
      "description": "STATUS_Input",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "StatusInput",
        "description": "returns current input state for devices with a single input",
        "path": "/:address/input/current"
      },
      "priority": 20
    },
    {
      "_id": "HardwareInfo",
      "description": "HardwareInfo",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "HardwareInfo",
        "description": "Hardware information endpoint",
        "path": "/:address/hardware"
      },
      "priority": 20
    },
    {
      "_id": "ActiveSignal",
      "description": "ActiveSignal",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "ActiveSignal",
        "description": "Active signal endpoint",
        "path": "/:address/active/:port"
      },
      "priority": 20
    },
    {
      "_id": "HealthCheck",
      "description": "HealthCheck",
      "microservice": {
        "_id": "sony-control-microservice",
        "description": "Used to control the Sony things",
        "address": "http://localhost:8007"
      },
      "endpoint": {
        "_id": "HealthCheck",
        "description": "Hits the get input endpoint because if we can, we *should* be able to talk with it..",
        "path": "/:address/power/status"
      },
      "priority": 20
    }
  ]
}

non-controllable document (used for hdmi inputs)

{
  "_id": "non-controllable",
  "_rev": "[Keep this from the new document you created]",
  "description": "A Non-controllable Device",
  "display_name": "HDMI",
  "input": true,
  "source": true,
  "default-name": "HDMI",
  "default-icon": "settings_input_hdmi",
  "roles": [
    {
      "_id": "AudioIn",
      "description": "Acts as an audio input device"
    },
    {
      "_id": "VideoIn",
      "description": "Acts as a video input device"
    }
  ]
}

rooms

Here is the description for rooms database Sample CouchDB Entry for rooms database:

{
  "_id": "DEMO-123",
  "_rev": "[Keep this from the new document you create]",
  "name": "DEMO-123",
  "description": "DEMO-123",
  "configuration": {
    "_id": "Default"
  },
  "designation": "stage",
  "attributes": {
    "Ceiling Box": true
  }
}

buildings

Sample CouchDB Entry for buildings database:

{
  "_id": "DEMO",
  "_rev": "[Keep this from the new document you create]",
  "name": "This is the Demo building",
  "description": "This building is made up for Demo purposes"
}
  1. Whatever you put here as your BLDG abbreviation (the demo building is "DEMO") must be used in all of documents that contain "DEMO-123". If you change DEMO to your actual building abbreviation you must update the other documents to reflect that change.

room_configurations

default room_configuration document:

{
  "_id": "Default",
  "_rev": "[Keep this from the new document you created]",
  "evaluators": [
    {
      "_id": "PowerOnDefault",
      "codekey": "PowerOnDefault",
      "description": "PowerOnDefault",
      "priority": 1
    },
    {
      "_id": "StandbyDefault",
      "codekey": "StandbyDefault",
      "description": "StandbyDefault",
      "priority": 9999
    },
    {
      "_id": "ChangeAudioInputDefault",
      "codekey": "ChangeAudioInputDefault",
      "description": "ChangeAudioInputDefault",
      "priority": 1337
    },
    {
      "_id": "MuteDefault",
      "codekey": "MuteDefault",
      "description": "MuteDefault",
      "priority": 5
    },
    {
      "_id": "UnMuteDefault",
      "codekey": "UnMuteDefault",
      "description": "UnMuteDefault",
      "priority": 6
    },
    {
      "_id": "BlankDisplayDefault",
      "codekey": "BlankDisplayDefault",
      "description": "BlankDisplayDefault",
      "priority": 7
    },
    {
      "_id": "UnBlankDisplayDefault",
      "codekey": "UnBlankDisplayDefault",
      "description": "UnBlankDisplayDefault",
      "priority": 8
    },
    {
      "_id": "SetVolumeDefault",
      "codekey": "SetVolumeDefault",
      "description": "SetVolumeDefault",
      "priority": 9
    },
    {
      "_id": "ChangeVideoInputDefault",
      "codekey": "ChangeVideoInputDefault",
      "description": "ChangeVideoInputDefault",
      "priority": 1338
    },
    {
      "_id": "STATUS_PowerDefault",
      "codekey": "STATUS_PowerDefault",
      "description": "STATUS_PowerDefault",
      "priority": 9999
    },
    {
      "_id": "STATUS_BlankedDefault",
      "codekey": "STATUS_BlankedDefault",
      "description": "STATUS_BlankedDefault",
      "priority": 9999
    },
    {
      "_id": "STATUS_MutedDefault",
      "codekey": "STATUS_MutedDefault",
      "description": "STATUS_MutedDefault",
      "priority": 9999
    },
    {
      "_id": "STATUS_InputDefault",
      "codekey": "STATUS_InputDefault",
      "description": "STATUS_InputDefault",
      "priority": 9999
    },
    {
      "_id": "STATUS_VolumeDefault",
      "codekey": "STATUS_VolumeDefault",
      "description": "STATUS_VolumeDefault",
      "priority": 9999
    }
  ],
  "description": "Default"
}