How to send data to singular.live?
There are several ways how to send data from Scoreboard OCR to singular.live:
- Using Data Streams. It is recommended to use this method, because it will provide the smallest latency and can update several times per second
- Using 'old' method
1. Using Data Streams
- Add new Data Stream in singular.live Data Stream Manager and copy the private token
- Choose “singular.live” output option in Scoreboard OCR
- Use the following URL and add the private access token:
https://datastream.singular.live/datastreams/<data_streams_private_token>
- Create fields in Scoreboard OCR and add some digits
- Open singular.live Data Stream Manager and click on Status of the Data Stream. You should see incoming data
- Take a look at this very useful video for steps to be taken in singular.live
- Use the following syntax to access data sent by Scoreboard OCR to singular.live:
data.payload[0].controlNode.payload.data-field-name
data.payload[0].controlNode.payload["data-field-name"]
data.payload[0].controlNode.payload.Time
data.payload[0].controlNode.payload["Time"]
Scoreboard OCR will send the following HTTP PUT request to singular.live Data Streams according to developer documentation
[{ "compositionName": "", "controlNode": { "payload": { "Time": "3:27", "Score_a": "8", "Score_b": "12" } } }]
2. Using 'old' method
- Add external access API token to your singular.live graphics template
- Choose “singular.live” output option in Scoreboard OCR
- Enter singular.live access token:
https://app.singular.live/apiv1/control/<TOKEN>/<compositionName>
https://app.singular.live/apiv1/control/2gzVUSk2pFmDI7dK53KX5g/Composition1
- Use the same field names in Scoreboard OCR that are defined in singular.live
Scoreboard OCR will send the following HTTP PUT request to singular.live according to developer documentation
[ { "compositionName":"Composition1", "controlNode":{ "payload":{ "Time":"09:00" } } } ]
How to test ?
- in Singular.live
- from Market add Corner Cap composition and create control app for that composition
- in Control App upper right corner click on the three dashes and generate a token, copy it to your clipbaord
- in Control App activate only 'Score Bug - Basketball' overlay, make sure you see the scorebug on the screen
- in Scoreboard OCR
- in '2. Choose Output' choose the output type 'Singular.live' and add this line
https://app.singular.live/apiv1/control/<TOKEN_FROM_CLIPBOARD>/Score Bug - Basketball
- in '3. Add Digits' add field named 'team1Score' and add some digits
You should see the Team1 score updating in Singular.live
How to solve the issue that Time field is not updating?
Since Singular.live 'Time' field is not a standard text field but rather a 'timer' type of field and it is not possible to send a value to update this field. Instead it can be started and stoped by sending a command. Workaround is to replace Timer widget with Text widget.