Skip to content

Devices and venues

The Devices and Venue screens from TellyboardAdmin, packaged in @playtelly/capability-apps so that any host app can show them. Playout Admin is the first host. The screens cover the device list, the full device detail page, TV pairing, and the venue tree (venue > building > floor > space, with the endpoints that devices sit on).

  • Package: @playtelly/capability-apps, folder src/devices/
  • Backend: the authenticated, workspace-scoped CoreAPI routes /api/v1/displays/{ws}/… and /api/v1/venues/{ws}/… (listed below). Older domain reference: provisioning, spatial.

Status

  • Published: @playtelly/capability-apps 0.11.0 added the full devices feature set (device reply stream, relink, playlists and media tabs, venue tags, establishments, zone and mount type, workspace links). The current release, 0.11.5, has the same devices screens (0.11.1 to 0.11.5 changed only media upload).
  • On staging: the CoreAPI /displays/{ws} and /venues/{ws} routes, and Playout Admin with its Devices and Venues pages (dependency ^0.11.5).
  • TellyboardAdmin has its own copy of these screens and still calls the older flat Tellyboard routes. It does not use this module yet.

How the port was made

TellyboardAdmin's own components were copied over. Their JSX, inline styles and state logic are unchanged. Only these things were changed:

Changed Why
api calls go through a shim (tellyboard/tbApi.js) The shim keeps Tellyboard's method names but calls the authenticated /displays/{ws} and /venues/{ws} routes. No org or workspace header is sent.
react-router and localStorage reads were removed Navigation uses callbacks and props, and the workspace comes from the host's scope.
The browser no longer talks to the device broker Commands go through a server route with an allow-list (POST …/command), and device replies come back over an authenticated per-device WebSocket (GET …/stream).
Permission gating was added Controls the user may not use are disabled. The UI checks with can(permission) and isOrgAdmin(), and the server checks every call again.
Fonts The screens load Tellyboard's web fonts (Inter, Hanken Grotesk, IBM Plex Mono, JetBrains Mono) once at runtime, so they look the same in a host that does not ship those fonts.

The style tokens (--c-* CSS variables) have the same values in both hosts, so the screens look the same in Playout Admin and in Tellyboard.


What the package exports

Export What it is
DevicesPage The device list (DisplaysPage). It switches to the full device detail page when a device is opened. Inside it: fleet cards, filter chips, a column picker, bulk actions (reboot, power on/off, relink, delete), the device info sheet, the Register Device wizard (AddDeviceWizard, which pairs a TV by its 6-digit code), the relink dialog and the endpoint sheet.
VenuePage VenueManagement: the venue list, the venue detail page (Overview, Hierarchy, endpoint detail) and the create sheets (venue wizard, building, floor, space, endpoint, establishment).
createDevicesAdapter Builds the adapter that both pages take.
DEVICE_PERMISSIONS The four permission names: workspace:devices:view, workspace:devices:create, workspace:devices:edit, workspace:devices:delete.
devicesNav() The shared "Devices" sidebar section. Devices and Venues are real links. Device Groups, Device Profiles, Power Schedule, Applications, Firmware, Monitoring and Logs & Diagnostics are greyed-out placeholders because no backend exists for them.
getDeviceTelemetry, summariseFleet Helpers that turn a device row into health values and fleet counts.

The wizard, sheets and dialogs are internal. A host gets them through the two pages and cannot import them on its own. (Some code comments still name AddDeviceSheet and DeviceInfoSheet from 0.9.0, but only the exports above are public.)

Page props

<DevicesPage
  adapter={adapter}          // required, from createDevicesAdapter
  onOpenDevice={(id) => {}}  // optional: the host handles navigation to a device itself
  deviceId={id}              // optional: controlled selection (for example, keep the open device in the URL)
  onDeviceChange={(id) => {}}
/>

<VenuePage
  adapter={adapter}          // required
  initialLocationId={id}     // optional: the top-level venue to open once the tree has loaded
  onSelectLocation={(id) => {}}  // optional: called when a venue opens, or null when the list shows again
  workspaces={[{ id, name }]}    // optional: the org's workspaces, for the org-admin "Share with" picker
/>

If you pass neither onOpenDevice nor deviceId, DevicesPage keeps track of the open device itself. No router is needed.


The adapter

import { createDevicesAdapter } from "@playtelly/capability-apps";
import "@playtelly/capability-apps/css";

const adapter = createDevicesAdapter({
  apiBaseUrl: "/playout/api",   // same-origin path that the host's proxy forwards to CoreAPI /api/v1
  scope: getScope,              // { workspaceId, permissions?, orgRole? }, or a function that returns it
  onUnauthorized: refreshToken, // async () => boolean: refresh the session, then the call is retried once
  overrides: {},                // optional: replace any adapter function
});
  • scope.workspaceId is required. Every route puts it in the path. The org is never sent by the client: CoreAPI reads it from the login token.
  • scope.permissions is the list of the user's permissions in that workspace, from /identity/users/me. If you leave it out, the UI offers every action and the server answers 403 where needed.
  • scope.orgRole: if it is ORG_OWNER or ORG_ADMIN, the screens offer the org-level actions (top-level venues, sharing a venue with another workspace, the unassigned-device list). If you leave it out, the screens offer them and the server decides.
  • scopeFromMe(me, workspaceId) (also exported) builds this object from the /me response.
  • Make a new adapter when the workspace changes, so the screens fetch their data again (for example, useMemo keyed on the workspace).

Optional properties on the adapter object:

Property Effect
tellyboardFeatures Turns a control off, for example { relink: false }. The control stays visible but is greyed out with the tooltip "Not available yet". All flags default to on.
tellyboardApiOverrides Replaces methods of the Tellyboard-style api shim.
tellyboardMediaBaseUrl Base URL for "Play now" items that have no url of their own.

Greyed-out controls

Since 0.11.0 every feature flag is on by default, because the CoreAPI on staging serves all of them. A control is greyed out with "Not available yet" only when a host turns its flag off. Use this when the host talks to an older CoreAPI that lacks the route:

Flag Controls Needs on the server
relink Bulk-bar Relink POST /displays/{ws}/relink
pausePlay Live Control PLAY / STOP PAUSE / RESUME on the command allow-list
appModeSwitch App mode toggle (Playout / Tellyboard) SWITCH_TO_PLAYOUT / SWITCH_TO_TELLYBOARD on the allow-list
screenshot Screenshot / Capture (3 places) the per-device reply stream
playlists Playlists and Media tabs scoped playlist reads and the workspace media list
establishments "Add Establishment" in the venue hierarchy POST …/locations/{id}/establishments
spaceType Space Type chip space_type in the group tree

Some controls are disabled or empty for other reasons:

  • Permissions. A control the user's role does not allow is disabled with the tooltip "You do not have permission to do this".
  • Platform limits. On Tizen, Wake-on-LAN, DPM wake-up and the boot logo are disabled, the same as in Tellyboard.
  • Placeholders in Tellyboard itself. Proof of Play, Policy Sync, the venue Relationship / DOOH / Activities tabs, the map card and the sidebar placeholders listed above are placeholders in Tellyboard too.

CoreAPI routes

All routes are under /api/v1. They all need a login (an RS256 access token, sent as a cookie or bearer) and a workspace permission. The workspace comes from the {ws} path segment, and the org comes from the token. The workspace must belong to the token's org. The server checks roles live in the database, so a demoted user loses access without needing a new token.

Every route with an id checks that the item is inside the workspace. A device, location, endpoint or playlist from another workspace or org returns 404, so ids cannot be probed across workspaces. When a request body names a device (for example, seating a device on an endpoint), that device must belong to the workspace too.

Default role grants: WORKSPACE_ADMIN has all four device permissions, WORKSPACE_MEMBER has view, create and edit, and VIEWER has view only. "Org admin" means ORG_OWNER or ORG_ADMIN of the token's org.

Devices: /displays/{ws}

Method Path Permission Notes
GET /displays/{ws}/ view Only the devices of this workspace.
GET /displays/{ws}/unassigned org admin Devices of the org that belong to no workspace.
POST /displays/{ws}/unassigned/{deviceId}/assign org admin Moves an unassigned device into {ws}. This is the only route that sets a device's workspace after it is created.
POST /displays/{ws}/claim-code create Pairs a TV by the code it shows. Body: {code, name, mode: "tellyboard" \| "playout", spaceId?}.
POST /displays/{ws}/relink edit {code, deviceId}: re-pairs a device of this workspace with a new TV.
GET /displays/{ws}/playlists view This workspace's playlists, for the "Play now" tab.
GET /displays/{ws}/playlists/{playlistId}/media view The playlist must be in the workspace.
GET /displays/{ws}/{deviceId} view Includes the joined placement: endpoint, location path, country, scheduled-off.
PUT /displays/{ws}/{deviceId} edit Replaces about 28 columns from the body. Always GET the device, change it, and PUT the whole object back.
DELETE /displays/{ws}/{deviceId} delete
POST /displays/{ws}/{deviceId}/command view at the route, then the command's tier See Commands.
GET /displays/{ws}/{deviceId}/stream view A WebSocket that relays this one device's replies. See Reply stream.
PATCH /displays/{ws}/{deviceId}/location edit {location_id, note}. The target location must be in the workspace. null unseats the device.
PATCH …/{deviceId}/lifecycle edit {warrantyEndDate, expectedRefreshDate}
PATCH …/{deviceId}/bandwidth-limit edit {limitMbps}
GET / PUT …/{deviceId}/power-schedule view / edit Weekly schedule.
GET …/{deviceId}/power-adherence view ?days=
GET …/{deviceId}/activity, …/placement-history, …/content-sources view ?limit= where it applies.
POST …/{deviceId}/play, /stop, /test-play, /test-play/stop, /refresh-info, /geo edit

The device list's live online/offline state comes from the authenticated WebSocket GET /devices/status/ws, which is scoped to the token's org. The list also refreshes every 15 seconds in case the socket is down.

Commands

POST /displays/{ws}/{deviceId}/command with {type, payload?}. The server publishes the command to the device and answers 202 {"status":"sent"}. Anything that is not on the allow-list is refused with 400. The route itself needs view, and then the handler checks the permission for the command's tier:

Tier Commands
view getDeviceInfo; player commands GET_SYSTEM_USAGE, GET_DPM_STATUS, GET_USAGE_DATA, GET_POWER_STATUS, GET_VERSION_INFO, GET_MD5, CAPTURE_SCREEN
edit reboot, power ("ON" / "OFF"), volume (whole number 0 to 100); player commands REBOOT, REBOOT_APP, SYNC_STORAGE, CLEAR_CACHE, SET_PORTRAIT, SET_CONTENT_ROTATION, TOGGLE_CLOCK, SET_WOL, SET_DPM_WAKEUP, SET_TIMEZONE_AND_TIME, CHANGE_LOGO, STOP, PAUSE, RESUME, SWITCH_TO_PLAYOUT, SWITCH_TO_TELLYBOARD
delete player commands DELETE_FILE, DELETE_BULK, DOWNLOAD_FIRMWARE, UPGRADE_FIRMWARE, UPGRADE_APP, UPDATE_COMPONENT, SET_SERVER

A player command is {type: "player_command", payload: "NAME"} or {type: "player_command", payload: {command: "NAME", …fields}}. A url field, if present, must be an http(s) address. Other rules:

  • The body may be at most 256 KB, which is room for a DELETE_BULK with more than a thousand files.
  • A device reset is not accepted on this route.
  • Errors: 503 if the message broker is not connected, and 504 if it does not accept the command within 5 seconds.
  • Every accepted command is logged with the user, org, workspace and device.

Reply stream

GET /displays/{ws}/{deviceId}/stream is a WebSocket. Each message has the same shape as Tellyboard's own messages: {type: "mqtt", deviceId, topic, payload}, where payload is a string. It carries the device's status reports (device info, usage, screenshot, power, MD5, logo and upgrade reports), player events, the file list on the device, the transfer queue, and live TV console lines. The screenshot, uptime, CPU and memory, file list, MD5 and live console on the detail page all depend on this stream.

Limits:

  • At most 25 open streams per device.
  • A heartbeat every 25 seconds.
  • A stream lasts at most 30 minutes and then the client reconnects, because the login is only checked when the stream opens.
  • The detail page gives up after 4 failed connects, so an older CoreAPI is not flooded with retries.

Venues: /venues/{ws}

A venue is owned by the org. A workspace sees the locations that are linked to it and everything below them. These routes only show or change that subtree.

Method Path Permission Notes
GET /venues/{ws}/venue-types view
GET /venues/{ws}/tags view The tag list, for the Add Space picker.
GET /venues/{ws}/locations/, /tree, /group-tree, /spaces view group-tree also returns space_type, placement, zone, mount_type, engagement_role, and, on venue nodes, establishments.
POST /venues/{ws}/locations create With a parentId, the parent must be in the workspace. Without one (a top-level venue), only an org admin may create it. Stores zone / mountType.
PUT /venues/{ws}/locations/{id} edit Replaces about 20 columns from the body: send the whole node. If the body leaves out zone / mountType, they are kept.
PATCH /venues/{ws}/locations/{id} edit Rename: {name?, code?} only. Use this instead of PUT when you only want to rename.
DELETE /venues/{ws}/locations/{id} delete
GET /venues/{ws}/locations/{id}/devices, /endpoints, /tags view
POST /venues/{ws}/locations/{id}/tags edit {tagIds}. Tags of another org are refused.
POST /venues/{ws}/locations/{id}/establishments create Venue nodes only. Creates an establishment (for example, a hotel or a tenant) under the venue.
POST /venues/{ws}/locations/{id}/endpoints create If the body has a deviceId, that device must be in the workspace. New endpoints store the org.
GET /venues/{ws}/locations/{id}/workspaces org admin The workspaces this location is shared with.
POST / DELETE /venues/{ws}/locations/{id}/assign/{workspaceId} org admin Shares the location (and everything below it) with another workspace of the org, or stops sharing it.
PUT /venues/{ws}/endpoints/{endpointId} edit Edits an endpoint. Unseat a device with {deviceId: ""}.
PUT /venues/{ws}/endpoints/{endpointId}/assign-device edit {deviceId}. The device must be in the workspace.
DELETE /venues/{ws}/endpoints/{endpointId} delete

The Playlists / Media tabs also call the workspace's media list (GET /media/{ws}), which needs the workspace's media permission.

What stays elsewhere

  • TV routes. The TV calls its own routes without a staff login, and its device identity decides what it gets: generate-code and check-claim during pairing, its heartbeat, and its channel-group reads. Pairing works like this:
    1. The TV asks for a code and shows it on screen.
    2. A staff member enters the code in Register Device, which calls claim-code on this API.
    3. The TV's next check-claim poll returns its device token.
  • Older Tellyboard routes. The older flat /devices/* and /locations/* routes remain for Tellyboard and are not used by this module.

How Playout Admin hosts it

Playout Admin has two pages that each take up the whole screen, plus one adapter file:

File What it does
src/pages/devices/lib/devicesAdapter.js createDevicesAdapter({ apiBaseUrl: "/playout/api", scope: getScope, onUnauthorized: refreshAccessToken })
src/pages/devices/pages/DevicesPage.jsx Sets the page title "Devices" and renders <DevicesPage adapter={adapter} />
src/pages/devices/pages/VenuesPage.jsx Sets the page title "Venues" and renders <VenuePage adapter={adapter} />
src/components/sideBar/playoutNav.js The sidebar's "Devices" section is devicesNav({ devices: "/devices", venues: "/venues" })
  • getScope returns the workspace picked in the sidebar's workspace switcher, with its permissions and the user's org role (scopeFromMe in src/lib/workspaceScope.js).
  • When the workspace changes, the layout remounts the page, which then builds a new adapter and fetches again.
  • Playout Admin passes no tellyboardFeatures, so every control is enabled.
  • /playout/api/ is proxied to CoreAPI /api/v1. The nginx config passes the WebSocket Upgrade / Connection headers on it, so the status socket and the reply stream both work.

Behaviour that differs from Tellyboard:

  • No workspace picker in the wizard. Register Device always pairs the TV into the current workspace.
  • Unassigned devices (org admins only). If the org has devices with no workspace, a banner and a "No workspace" pill appear. Under that pill each row has an Assign button that moves the device into the current workspace.
  • Sharing (org admins only). The venue Overview tab has a "Workspaces" section to share a venue with another workspace or stop sharing it.
  • Detail page refresh. The page re-reads the device every 10 seconds and the joined list row every 60 seconds. Placement changes made elsewhere can therefore take up to a minute to show.

Known gaps

  • No backend yet. Device Groups, Device Profiles, Power Schedule as a fleet page, Applications, Firmware as a fleet page, Monitoring and Logs are sidebar placeholders only.
  • Inherited quirks. In the venue screens, getDevices({ unassigned: true }) ignores its argument and lists every device of the workspace, seated or not. Editing Max Capacity in the venue Overview sends a string and is rejected. Both behave the same way in Tellyboard.
  • Endpoint fields. Only an endpoint's name and code are stored. Kind, orientation, composition, panels, tiles and guest interaction from the endpoint sheet are not saved by the backend.
  • Not tested on hardware yet. Real TV hardware has not been tested against these routes. Browser tests cover pairing, commands and simulated device replies.