Introduction

Getting Started

The Relay SDK lets you create powerful voice driven interactions on your Relay devices. Dash is accessed through https://api-dash.relaygo.com, our SDK is available in Node and you can use the Relay CLI to load configuration and other commands in the Relay environment.

Relay Platform

The Relay Platform includes SDKs and HTTP APIs designed to let you write applications run on one or more Relays. The application you write is called a workflow. Once created workflows are registered on Relay devices. Part of the configuration step is to associate your workflow with a trigger. A trigger causes a Relay to enter a workflow channel where events get sent back and forth to your application. When your application is finished it terminates the workflow and the Relay will switch away from the workflow channel. Once terminated events are no longer sent in either direction and your workflow will sit idle until it's triggered again. Get started with the example below or jump directly to the docs.

Relay Workflows

All interactions with your Relay devices happen through over a websocket. You can both receive events and send events to Relays. For example:

import { relay, Event } from '@relaypro/sdk'

const app = relay()
    
app.workflow(`helloworld`, relay => {
  relay.on(Event.START, async () => {
    await relay.sayAndWait(`Hello World`)
    await relay.terminate()
  })
})
import relay.workflow

wf = relay.workflow.Workflow('helloworld')

@wf.on_start
async def start_handler(relay):
    await relay.say(f'Hello {from}!')
    await relay.terminate()

Registering a workflow with Relay servers, is done by sending a workflow configuration file to Relay (using the Relay CLI or manually with a JSON file). You can target as many or as few Relay devices as you want, using their unique 16 digit ID (available via Dash under 'Fleet Management').

$ relay workflow:create:http -n slack-question -u wss://slack.server.com/message --trigger=POST 990007560020628

Once your workflow is triggered on a Relay device, the user is placed in a channel with the workflow name as the name of the channel. On exiting the channel or calling the terminate() command the workflow ends.

In the Event.START event callback the first thing we do is make the Relay speak to the user. To do this we are using the sayAndWait method. The string we provide will be spoken by the Relay and the command will return when playback stops on the Relay.

After the speech is sent we are done with our workflow so we terminate the workflow with the appropriately named terminate method. With the workflow finished your application will sit idle until it's triggered again.

Here's a short demo showing a keyword 'Lightning' returning live Lightning data with Text to Speech and LED Ring flashing.

Use Cases

Instant Help Button
Ever struggled to provide real-time help to remote sites? Program a Relay Button to quickly connect users to real-time help: A single tap of the button alerts your support staff that a user needs help at a specified location via in-app notification or SMS. Support can then send a message back via text-to-speech or jump into a live two way call to resolve the issue.

Real-time inventory updates
Want to give your workers real-time data access in a warehouse environment?
Program a Relay Button to map voice commands to live warehouse database queries on inventory levels and item locations. Send text-to-speech voice alerts when inventory levels fall below pre-set thresholds.

Automatic Time Logging
Do your workers need to allocate time to specific job sites?
Use a Relay Button tap to log work done at a particular site. On button press, capture location and time stamp to automatically associate it with a particular location and start a tracking session. Send a voice notification if they exit the job-site without ending their session.

FAQs

  • Do I have to bring my own cellular connectivity?
    No, we manage connectivity with leading cellular providers and include it on your devices.

  • Are Relay devices rugged?
    Our devices are rated IPX8, waterproof to more than 3 feet of water and dust resistant. With no screen, our devices are built for the harshest environments.

  • How is GPS data transmitted?
    We provide Lat/Long coordinates updated as frequently as every 30 seconds (frequency is configurable)

  • Do you support Speech-to-Text and Text-to-Speech?
    Yes, we use our own proprietary algorithm to provide cloud based two way voice to text transformation.