Monday, March 17, 2025

Control Overlays.UNO from command line

Control Overlays.UNO alternatively to the GUI?  

  • To interact with Overlays.UNO without needing to rely on the GUI.
  • Control from OBS or vMIX if possible.
  • Avoid needing 3rd party applications or hardware and use basic keyboard hotkeys.

IN A NUT SHELL

Overlays.UNO uses PUT statements using JSON for control.

To make it work with as many systems as possible, the 
CURL command is used which isn't OS dependent outside of minor syntax formatting tweaks for your flavor of OS.  These examples in this document are for Windows CMD prompt, and required to have slashes in front of any quotation inside a curly brace

"{\"JSON CODE\"}"

Overlays.UNO need the URL API and in some cases a specific JSON ID associated to the overlay.

The CURL syntax below is an example of how to send direct commands to Overlays.uno. 

curl -i -H "Content-Type:application/json" -d "{"JSON CODE"}" -X PUT https://app.overlays.uno/apiv2/controlapps/xxxAPI_VALUExxx/api

The above command is reformatted below for Windows CMD with a slash marks as mentioned above:

curl -i -H "Content-Type:application/json" -d "{\"JSON CODE\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/xxxAPI_VALUExxx/api


It appears that Overlays.UNO may have retired the original "Hockey Scorebug | Standard" That I demoed originally, so here's the one they have now.  I'm building a new explanation, hopefully it will be more clear.  The original was mostly for my own notes until i had time to clarify everything.


First thing you need is your API url.


Now lets turn the Overlay OFF and ON.

Use the commands below, substitute your UNO API URL for your overlay.

HideOverlay 

Modify the command below with your API URL data.
Paste into a CMD prompt and press enter.

curl -i -H "Content-Type:application/json" -d "{\"command\": \"HideOverlay\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/YOURoverlayURL/api
And if you look at overlays.UNO, the overlay should be gone.

ShowOverlay

curl -i -H "Content-Type:application/json" -d "{\"command\": \"ShowOverlay\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/YOURoverlayURL/api


The majority of hiding/showing elements will follow that CURL syntax



DEMO (OLD)



For this demo the overlay "Hockey Scorebug | Standard" is being used.  Load this from overlays.uno and you should be able to apply the information in this doc with your own deployment.


Launch it and the default looks basically like this below:


Click on the question mark and click on API description


Your going to see this:


The API endpoint URL is displayed here at the top, so copy and save that for easy retrieval



For this Overlay example we are using here, the 
JSON ID is required.
Run the following command, substitute your API endpoint value that is in RED

curl -i -H "Content-Type:application/json" -d "{\"command\": \"GetOverlays\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api

Copy the ID that yours returns with as you will need it (yellow)



For demonstration, we'll start by turning the overlay ON and OFF. 

When we got the API endpoint URL above, it also contained some of the possible commands that could be issued, the first two being "ShowOverlay" and "HideOverlay"



HideOverlay 

Modify the command below with your JSON and API data.
Paste into a CMD prompt and press enter.

curl -i -H "Content-Type:application/json" -d "{\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"command\": \"HideOverlay\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
And if you look at overlays.UNO, the overlay should be gone.


ShowOverlay

By following the substitution steps above with the command will allow you to display the Overlay.

curl -i -H "Content-Type:application/json" -d "{\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"command\": \"ShowOverlay\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api



TEAM GOALS

You can "Increment" or "Decrement" the score by a specific value 
OR you can set the goal directly to any value.

Increase Team 2 Goals by 3
curl -i -H "Content-Type:application/json" -d "{\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"command\": \"IncrementOverlayContentField\",\"fieldId\": \"Team 2 Goals\",\"value\": \"3\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
Set Team 1 Goals to 13
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Team 1 Goals\",\"value\": \"13\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
CLOCK (Change the time)

Increment the clock by 1 minute
curl -i -H "Content-Type:application/json" -d "{\"command\": \"IncrementOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Game Clock Minutes\",\"value\": \"1\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
Decrement the seconds by 15
curl -i -H "Content-Type:application/json" -d "{\"command\": \"DecrementOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Game Clock Seconds\",\"value\": \"15\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
Change the minutes to a specific time "11"    
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Game Clock Minutes\",\"value\": \"11\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
Change seconds to a specific time "12"
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Game Clock Seconds\",\"value\": \"12\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api

START CLOCK  (Valid commands play, pause, reset and start)

curl -i -H "Content-Type:application/json" -d "{\"command\": \"ExecuteOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"GameClockControl\",\"value\": \"start\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/apicurl -i -H "Content-Type:application/json" -d "{\"command\": \"ExecuteOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"GameClockControl\",\"value\": \"True\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api

STOP CLOCK

curl -i -H "Content-Type:application/json" -d "{\"command\": \"ExecuteOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"GameClockControl\",\"value\": \"pause\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/apicurl -i -H "Content-Type:application/json" -d "{\"command\": \"ExecuteOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"GameClockControl\",\"value\": \"True\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api



Period
(You can put any txt you want) (1,1st,ShootOut, OT etc, different language versions)
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Period\",\"value\": \"2ND\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
ALERT ON/OFF  (replace TRUE with FALSE)
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"alert\",\"value\": \"true\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
ALERT Text - Custom (Penalty, Timeout, GAME 3)
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Alert Text\",\"value\": \"REDS\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
TEAM NAMES

Change Team 1 to "BLUES"
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Team 1\",\"value\": \"BLUES\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
Change Team 2 to "REDS"
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"Team 2\",\"value\": \"REDS\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
LOGOS ACTIVE  (on/off)
curl -i -H "Content-Type:application/json" -d "{\"command\": \"SetOverlayContentField\",\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"fieldId\": \"logosActive\",\"value\": \"false\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api

JSON commands in detail:

Another way to determine some of the JSON values, and syntax that can be helpful is to use "Postman" 
Download Postman | Get Started for Free which is a system to allow you to review JSON code and do interaction to sites like Overlays.  Might help you.  It helped me quite a bit



COMMANDS IN DETAIL

Now the API document that you can find in the help menu will show the command syntax you'll need.  This is helpful...it is very generalized and not super helpful.

Along with the above syntax sequence, you also will need the values in the names.  So how do you increase the 

The names of the fields somewhat match the names they are given in the above picture, but to get a full list, well at least one that you can search through, use this command: "GetOverlayContent"

curl -i -H "Content-Type:application/json" -d "{\"id\": \"45eac98d-cc99-4a8a-b430-872391c30aca\",\"command\": \"GetOverlayContent\"}" -X PUT https://app.overlays.uno/apiv2/controlapps/0mNA1zjHa8jiElWzdWJb0Y/api
You'll get a return like this:


You'll see things that you can adjust, and most names match the gui description, but not all the names are the same.  In the GUI its called "Game Clock Control", but in JSON its "GameClockControl". The above helps to sort out some of the differences.   

No comments:

Post a Comment

Feel free to leave a comment! If you have any information that you think should be included, please do so here and I'll get it added in.