OREI HDMI Matrix - API Documentation
Overview
The OREI HDMI Matrix exposes a JSON-based HTTP API for controlling the device.Connection Details
- Protocol: HTTP
- Endpoint:
/cgi-bin/instr - Method: POST
- Headers:
Accept: application/json
- Content-Type: application/json
- Default Behavior: When a POST request is sent without a body, the device returns
get video statusby default.
Base URL
http://{device_ip}/cgi-bin/instr
Example: http://192.168.1.168/cgi-bin/instr
Important Notes for Windows Users
When using curl on Windows Command Prompt (CMD), you must:
- Remove the space after the
-dflag - Use double quotes and escape them with backslash (
\") - Do NOT use single quotes (they don't work in CMD)
-d"{\"comhead\":\"get system status\",\"language\":0}"
Unix/Linux/PowerShell Format:
-d '{"comhead":"get system status","language":0}'
Request Format
All requests must be POST requests with a JSON body containing at minimum:{
"comhead": "<command>",
"language": 0
}
Note: Sending a POST with no body will return get video status by default.
API Commands
1. Get System Status
Request:{
"comhead": "get system status",
"language": 0
}
Response:
{
"comhead": "get system status",
"power": <0 or 1>,
"baudrate": <1-6>,
"beep": <0 or 1>,
"lock": <0 or 1>,
"mode": <mode_value>,
"version": "<firmware_version>"
}
2. Get Video Status
Request:{
"comhead": "get video status",
"language": 0
}
Note: This is the default command when no body is provided.
Response:
{
"comhead": "get video status",
"power": <0 or 1>,
"allsource": [<array of source mappings>],
"allinputname": [<array of input names>],
"alloutputname": [<array of output names>],
"allname": [<array of preset names>]
}
Response Fields:
power: 1 = on, 0 = standbyallsource: Array showing which input is routed to each output (9 elements, last appears to be padding)allinputname: Custom names for inputs (8 elements)alloutputname: Custom names for outputs (8 elements)allname: Preset names (8 presets available)
3. Get Output Status
Request:{
"comhead": "get output status",
"language": 0
}
Response:
{
"comhead": "get output status",
"allsource": [<array of source assignments>],
"allscaler": [<array of scaler modes>],
"allhdcp": [<array of hdcp status>],
"allout": [<array of output states>],
"allconnect": [<array of connection status>],
"allarc": [<array of arc status>],
"name": [<array of names>]
}
4. Get Input Status
Request:{
"comhead": "get input status",
"language": 0
}
Response:
{
"comhead": "get input status",
"edid": [<array of edid modes>],
"inactive": [<array of inactive status>],
"inname": [<array of input names>],
"power": [<array of power status>]
}
5. Video Switch
Routes an input to an output.
Request:{
"comhead": "video switch",
"language": 0,
"source": [<input_number>, <output_number>]
}
Parameters:
input_number: Input port (1-8)output_number: Output port (1-8)
{
"comhead": "video switch",
"language": 0,
"source": [3, 1]
}
Routes input 3 to output 1
6. TX Stream
Controls the transmit stream state for an output.
Request:{
"comhead": "tx stream",
"language": 0,
"out": [<output_number>, <state>]
}
Parameters:
output_number: Output port (1-8)state: 0 = off, 1 = on
{
"comhead": "tx stream",
"language": 0,
"out": [1, 1]
}
7. Set ARC
Enables or disables Audio Return Channel on an output.
Request:{
"comhead": "set arc",
"language": 0,
"arc": [<output_number>, <state>]
}
Parameters:
output_number: Output port (1-8)state: 0 = disabled, 1 = enabled
{
"comhead": "set arc",
"language": 0,
"arc": [1, 1]
}
8. Video Scaler
Sets the scaler mode for an output.
Request:{
"comhead": "video scaler",
"language": 0,
"scaler": [<output_number>, <scaler_mode>]
}
Scaler Modes:
0= BYPASS1= SCALE_4K_1080P3= AUTO
{
"comhead": "video scaler",
"language": 0,
"scaler": [1, 3]
}
9. Set EDID
Configures the EDID mode for an input.
Request:{
"comhead": "set edid",
"language": 0,
"edid": [<input_number>, <edid_mode>]
}
Parameters:
input_number: Input port (1-8)edid_mode: EDID mode value (see table below)
| Value | EDID Mode |
|---|---|
| 1 | 1080P, Stereo Audio 2.0 |
| 2 | 1080P, Dolby/DTS 5.1 |
| 3 | 1080P, HD Audio 7.1 |
| 4 | 1080I, Stereo Audio 2.0 |
| 5 | 1080I, Dolby/DTS 5.1 |
| 6 | 1080I, HD Audio 7.1 |
| 7 | 3D, Stereo Audio 2.0 |
| 8 | 3D, Dolby/DTS 5.1 |
| 9 | 3D, HD Audio 7.1 |
| 10 | 4K2K30_444, Stereo Audio 2.0 |
| 11 | 4K2K30_444, Dolby/DTS 5.1 |
| 12 | 4K2K30_444, HD Audio 7.1 |
| 13 | 4K2K60_420, Stereo Audio 2.0 |
| 14 | 4K2K60_420, Dolby/DTS 5.1 |
| 15 | 4K2K60_420, HD Audio 7.1 |
| 16 | 4K2K60_444, Stereo Audio 2.0 |
| 17 | 4K2K60_444, Dolby/DTS 5.1 |
| 18 | 4K2K60_444, HD Audio 7.1 |
| 19 | 4K2K60_444, Stereo Audio 2.0 HDR |
| 20 | 4K2K60_444, Dolby/DTS 5.1 HDR |
| 21 | 4K2K60_444, HD Audio 7.1 HDR |
| 22 | User Define 1 |
| 23 | User Define 2 |
| 24 | COPY_FROM_OUT_1 |
| 25 | COPY_FROM_OUT_2 |
| 26 | COPY_FROM_OUT_3 |
| 27 | COPY_FROM_OUT_4 |
| 28 | COPY_FROM_OUT_5 |
| 29 | COPY_FROM_OUT_6 |
| 30 | COPY_FROM_OUT_7 |
| 31 | COPY_FROM_OUT_8 |
| 32 | COPY_FROM_HDBT_OUT_1 (HDP-MXB88H150 only) |
| 33 | COPY_FROM_HDBT_OUT_2 (HDP-MXB88H150 only) |
| 34 | COPY_FROM_HDBT_OUT_3 (HDP-MXB88H150 only) |
| 35 | COPY_FROM_HDBT_OUT_4 (HDP-MXB88H150 only) |
| 36 | COPY_FROM_HDBT_OUT_5 (HDP-MXB88H150 only) |
| 37 | COPY_FROM_HDBT_OUT_6 (HDP-MXB88H150 only) |
| 38 | COPY_FROM_HDBT_OUT_7 (HDP-MXB88H150 only) |
| 39 | COPY_FROM_HDBT_OUT_8 (HDP-MXB88H150 only) |
{
"comhead": "set edid",
"language": 0,
"edid": [1, 21]
}
Sets input 1 to 4K2K60_444, HD Audio 7.1 HDR
10. CEC Command (Output)
Sends CEC commands to output devices.
Request:{
"comhead": "cec command",
"language": 0,
"object": 1,
"port": [<p1>, <p2>, <p3>, <p4>, <p5>, <p6>, <p7>, <p8>],
"index": <command_index>
}
Parameters:
object: Must be1for outputport: Array of 8 integers (1 = selected, 0 = not selected)index: CEC command index (see table below)
| Index | Command |
|---|---|
| 0 | POWER_ON |
| 1 | POWER_OFF |
| 2 | VOLUME_MUTE |
| 3 | VOLUME_DOWN |
| 4 | VOLUME_UP |
| 5 | SOURCE |
{
"comhead": "cec command",
"language": 0,
"object": 1,
"port": [1, 0, 0, 0, 0, 0, 0, 0],
"index": 0
}
Sends POWER_ON to output 1
11. CEC Command (Input)
Sends CEC commands to input devices.
Request:{
"comhead": "cec command",
"language": 0,
"object": 0,
"port": [<p1>, <p2>, <p3>, <p4>, <p5>, <p6>, <p7>, <p8>],
"index": <command_index>
}
Parameters:
object: Must be0for inputport: Array of 8 integers (1 = selected, 0 = not selected)index: CEC command index (see table below)
| Index | Command |
|---|---|
| 1 | POWER_ON |
| 2 | POWER_OFF |
| 3 | UP |
| 4 | LEFT |
| 5 | ENTER |
| 6 | RIGHT |
| 7 | MENU |
| 8 | DOWN |
| 9 | BACK |
| 10 | PREV |
| 11 | PLAY |
| 12 | NEXT |
| 13 | REWIND |
| 14 | PAUSE |
| 15 | FAST_FORWARD |
| 16 | STOP |
| 17 | VOLUME_MUTE |
| 18 | VOLUME_DOWN |
| 19 | VOLUME_UP |
{
"comhead": "cec command",
"language": 0,
"object": 0,
"port": [0, 0, 1, 0, 0, 0, 0, 0],
"index": 11
}
Sends PLAY to input 3
12. Set Power
Powers the device on or off (standby).
Request:{
"comhead": "set poweronoff",
"language": 0,
"power": <state>
}
Parameters:
state: 0 = standby, 1 = power on
{
"comhead": "set poweronoff",
"language": 0,
"power": 1
}
13. Set Panel Lock
Locks or unlocks the front panel buttons.
Request:{
"comhead": "set panel lock",
"language": 0,
"lock": <state>
}
Parameters:
state: 0 = unlocked, 1 = locked
{
"comhead": "set panel lock",
"language": 0,
"lock": 1
}
14. Set Beep
Enables or disables button beep sounds.
Request:{
"comhead": "set beep",
"language": 0,
"beep": <state>
}
Parameters:
state: 0 = disabled, 1 = enabled
{
"comhead": "set beep",
"language": 0,
"beep": 0
}
Complete Examples
Using curl (Unix/Linux/Mac/PowerShell)
Get system status:curl -X POST http://192.168.1.168/cgi-bin/instr \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"comhead":"get system status","language":0}'
Switch input 5 to output 2:
curl -X POST http://192.168.1.168/cgi-bin/instr \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"comhead":"video switch","language":0,"source":[5,2]}'
Power on the matrix:
curl -X POST http://192.168.1.168/cgi-bin/instr \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"comhead":"set poweronoff","language":0,"power":1}'
Quick status check (default command, no body):
curl -X POST http://192.168.1.168/cgi-bin/instr \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Using curl (Windows CMD)
Get system status:curl -X POST http://192.168.1.168/cgi-bin/instr -H "Accept: application/json" -H "Content-Type: application/json" -d"{\"comhead\":\"get system status\",\"language\":0}"
Switch input 5 to output 2:
curl -X POST http://192.168.1.168/cgi-bin/instr -H "Accept: application/json" -H "Content-Type: application/json" -d"{\"comhead\":\"video switch\",\"language\":0,\"source\":[5,2]}"
Power on the matrix:
curl -X POST http://192.168.1.168/cgi-bin/instr -H "Accept: application/json" -H "Content-Type: application/json" -d"{\"comhead\":\"set poweronoff\",\"language\":0,\"power\":1}"
Quick status check (default command, no body):
curl -X POST http://192.168.1.168/cgi-bin/instr -H "Accept: application/json" -H "Content-Type: application/json"
Using Python (requests)
``python
import requests
import json
Get system status
response = requests.post( API_URL, headers={"Accept": "application/json"}, json={"comhead": "get system status", "language": 0}, timeout=5 ) print(response.json())Switch input 3 to output 1
response = requests.post( API_URL, headers={"Accept": "application/json"}, json={"comhead": "video switch", "language": 0, "source": [3, 1]}, timeout=5 ) print(response.json())
<h3>Using JavaScript (fetch)</h3>
javascript
const MATRIX_IP = "192.168.1.168";
const API_URL = http://${MATRIX_IP}/cgi-bin/instr;
// Get system status
fetch(API_URL, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comhead: "get system status",
language: 0
})
})
.then(response => response.json())
.then(data => console.log(data));
// Switch input 2 to output 4
fetch(API_URL, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comhead: "video switch",
language: 0,
source: [2, 4]
})
})
.then(response => response.json())
.then(data => console.log(data));
`
Notes
- All responses include a
comhead` field that echoes the request command