Remote Two/3 WebSocket Dock-API 0.8.0-beta

Work in progress API definition of the Remote Two/3 Dock WebSocket API.

API message status legend:

Icon Description
💡 Idea, not yet official part of API definition.
🚧 Planned feature and most likely not (fully) implemented in the initial release.
👷 API definition is work in progress, not ready yet for implementation.
🔍 API definition review & implementation.
🧪 API has been implemented in the Dock and is currently being tested.
🚀 Ready to use - feedback welcomed.
2️⃣️ Only supported on Dock Two.
3️⃣️ Only supported on Dock 3.

Overview

The Remote Two/3 WebSocket Dock-API allows you to interact with the Unfolded Circle smart charging dock and take full control of its features.

🚧 Missing Features

This API is a beta version and does not yet contain all functionality.

Planned features:

  • 3️⃣ RS232 communication.
  • Static network settings for WiFi and ethernet.
  • Additional event messages for a multi-remote setup, e.g. IR learning started.

API Versioning

The API is versioned according to SemVer.
The initial public release will be 1.0.0 once it is considered stable enough.

Any major version zero (0.y.z) is for initial development and may change at any time!
I.e. backward compatibility for minor releases is not yet established, anything MAY change at any time!

WebSocket Connection

  • A client must authenticate itself after opening a connection to use all defined request messages.
    Only the following messages can be used without authentication:
    • get_sysinfo
  • The dock supports a maximum af 5 concurrent WebSocket connections.

Authentication

The dock will send the auth_required message right after the connection is established.

  • The client must reply with the auth message containing the access token.

    • All other messages requiring authentication will be ignored, until the client successfully authenticates itself.
    • The dock will close the connection after a timeout.
  • The dock replies with the authentication event including the result code of the authentication:

    • 200: authentication succeeded, API can be used.
    • 401: invalid authentication and the connection will be closed.
  • #ucd2
  • #ucd3

Servers

  • ws://uc-dock.local:946wstest

    Test docking station.

Operations

  • PUB /

    Dock-API for clients to interact with the docking station.

    Operation IDpubDockMessage

    Accepts one of the following messages:

    • #0auth

      🚀 Authenticate a connection.

      Sent by the client right after establishing a connection, or after an auth_required request by the server.

      object
      uid: authRequestMsg
        Examples values:
      • {"type":"auth","token":"1234"}

      Examples

    • #1ping

      🚀 Application level based ping to determine whether connection is alive.

      Client can ping the server to determine whether connection is alive. Server responds with pong.

      This is an application level ping as opposed to the standard WebSocket ping frames. This is only required if a client framework doesn't support WebSocket ping frames!

      object
      uid: ping

      Examples

    • #2command

      🚀 Perform a system command.

      The following system commands can be executed:

      • ir_receive_on: Enables IR learning.
        • Learned codes are broadcasted with the ir_receive event message.
        • Learning mode status can be retrieved with the get_sysinfo request.
        • While learning mode is activated, no IR codes can be transmitted.
      • ir_receive_off: Stops IR learning.
      • remote_charged: Set status LED to normal operation (LED off)
      • remote_lowbattery: Set status LED to low battery mode (blink twice every 4 seconds).
      • remote_normal: Set status LED to normal operation (LED off, turn on when charging).
      • identify: Docking station identification, blink status LED green, amber, blue and red.
      • reboot: Reboot the device.
      • reset: Factory reset the device.
        • ❗️ All configuration data is erased and the device is put in setup mode.

      The server will respond with a result message and a status code of the request.

      ❗️ For reboot and reset commands there might be no response message. The dock will reboot after the command is processed.

      object allOf
      uid: systemCmdMsg

      Examples

    • #3get_sysinfo

      🚀 Get system information.

      Get hardware and software information about the device like serial number, model number, connection status and installed firmware version.

      This message does not require authentication.

      object allOf
      uid: getSystemInfoMsg

      Examples

    • #4ir_send

      🚀 Send an IR code or continue repeating a previous code.

      Send an IR code on the given output(s), either in Unfolded Circle or PRONTO HEX format.

      • If multiple outputs are specified, the IR signal is transmitted in parallel on the given outputs.
      • Only one IR code can be transmitted at the same time.
        It is not possible to send different codes on individual outputs at the same time.
      • IR transmission is blocked while the device is in learning mode.
      • If no output is specified: int_side is used as default output.
      • 3️⃣ Outputs not configured for IR sending are silently ignored.

      The IR transmission begins after the full message has been received, parsed and validated. Depending on the state of the IR device, different actions are taken:

      • Device is idle: a single code is transmitted and status code 200 returned after completion.
      • Transmitting the same IR code with the repeat field set: return status code 202 and continue repeating the IR code.
      • Transmitting another IR code: return error code 429.

      See Result codes below for all status codes.

      Continuous IR repeat

      This feature allows to repeat an IR signal autonomously by the dock for a specified number of times.

      The repeated IR signal is usually a special IR command to tell the receiving device, that a button on a remote control is hold for a longer time. Depending on the device, a repeat signal can either simply execute the same action as if someone would rapidly press the same button, or it can adjust the command to a different function. One common example is to progressively increase the volume steps, e.g. start slowly with 0.1 dBA steps, then after a short time increase to 0.5 or 1 dBA steps.
      Please note that not all devices or IR formats / commands support this feature. This is manufacturer specific.

      The continuous IR repeat feature is activated with the optional repeat field in the ir_send command.

      • The IR repeat signal will automatically be sent the number of times specified in the repeat field.
      • If the next ir_send request contains the same command value, the repeat count will be reset and therefore the repeat signal prolonged.
      • An ir_stop request will stop the remaining repeat commands.
      • Depending on the IR format, a repeat value might be already part of the code.
        • ⚠️ The repeat value will override the embedded repeat information.
        • See IR formats below.
      • Each repeat request will be acknowledged with a response message and a 202 status code, unless it gets disabled with the feature flag in bit 0.

      If not specified (or set to zero):

      • The provided code is sent as is, with the contained repeat information (depending on IR format).
      • Continuous IR repeat is not activated:
        • every ir_send command will send the full IR command.
        • ⚠️ the ir_stop command will have no effect!

      IR formats

      • pronto: PRONTO HEX format:
        • The PRONTO HEX format does not include a dedicated repeat count field, but an optional 2nd burst pair sequence used for repeats.
          • The third number in the PRONTO code specifies the number of burst pairs in the 1st sequence.
          • The fourth number in the PRONTO code specifies the number of burst pairs in the 2nd sequence.
          • If the fourth number is 0, then there's no repeat sequence.
          • Note that either sequence is optional. Also there might be both sequences defined, or only the 1st or 2nd one.
        • If the repeat field is set (> 0), the 2nd burst pair sequence of the PRONTO code is repeated.
          • If the PRONTO code doesn't contain a 2nd burst pair sequence, then the repeat value is ignored.
      • hex: Unfolded Circle format:
        • The repeat count is part of the code and might be required for certain protocols.
          • E.g. Sony needs to send the same command two or three times so it's recognized as a single command by a device.
        • If the repeat field is set (> 0), this will override the repeat count in code!
        • The actual emitted IR repeat signal depends on the IR protocols.
          • E.g. Denon will simply repeat the full command, whereas LG has a mandatory repeat-specific code sent after the command. This is all handled by the dock firmware, when sending the IR code.

      Result codes

      • 200: IR command has been sent. Either a single command, or after an IR repeat has finished.
      • 202: IR repeat command accepted. Default behavior, except the response message has been disabled with the feature flag.
      • 400: Cannot send command: invalid data or format.
      • 429: Cannot send command: last IR command is still being sent.
      • 503: IR sending not possible because learning is active.
      object allOf
      uid: irSendMsg
        Examples values:
      • {"type":"dock","id":1,"command":"ir_send","code":"4;0x10;12;0","format":"hex","int_side":true}
      • {"type":"dock","id":2,"command":"ir_send","code":"0000 006c 0022 0002 015b 00ad 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0622 015b 0057 0016 0e6c","format":"pronto","ext1":true}
      • {"type":"dock","id":3,"command":"ir_send","code":"4;0x10;12;1","format":"hex","repeat":3,"int_side":true}
      • {"type":"dock","id":4,"command":"ir_send","code":"0000 006c 0022 0002 015b 00ad 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0622 015b 0057 0016 0e6c","format":"pronto","repeat":3,"ext1":true}

      Examples

    • #5ir_stop

      🔍 Stop an active IR repeat transmission.

      This command stops an active IR repeat transmission at the end of the current repeat signal.

      Status 200 is always returned, even if there's no active IR transmission.

      object allOf
      uid: irStopMsg

      Examples

    • #6set_config

      🚀 Configure the dock.

      Configure the dock with a custom friendly name, change the API access token and set the WiFi connection.

      Notes:

      • One or multiple settings can be configured at once.
      • For the WiFi configuration both ssid and wifi_password fields must be specified.
      • The dock will be restarted if the WiFi configuration is specified.
      • Ethernet has precedence over WiFi connection. If the ethernet connection has a link, WiFi won't be activated.
      • The friendly name will be announced over mDNS and returned in get_sysinfo.
      object allOf
      uid: setConfigMsg
        Examples values:
      • {"type":"dock","id":1,"command":"set_config","friendly_name":"My dock"}
      • {"type":"dock","id":2,"command":"set_config","token":"1234"}
      • {"type":"dock","id":3,"command":"set_config","ssid":"My WiFi","wifi_password":"topsecret"}

      Examples

    • #7set_brightness

      🚀 Set status LED brightness.

      Set the maximum brightness of the status LED and ethernet indicator LED.

      object allOf
      uid: setBrightnessMsg

      Examples

    • #8set_volume

      3️⃣️ 🔍 Set speaker volume.

      object allOf
      uid: setVolumeMsg

      Examples

    • #9set_logging

      2️⃣ 🧪 Configure logging parameters.

      Set log level and an optional syslog server. Levels:

      • 0: EMERGENCY, system is unusable
      • 1: ALERT, action must be taken immediately
      • 2: CRITICAL, critical conditions
      • 3: ERROR, error conditions
      • 4: WARNING, warning conditions
      • 5: NOTICE, normal but significant condition
      • 6: INFO, informational
      • 7: DEBUG, debug-level messages

      ⚠️ This feature is currently only available on Dock Two.

      object allOf
      uid: setLogging
      • #ucd2

      Examples

    • #10get_port_mode

      3️⃣️ 🧪 Get external port configuration.

      ⚠️ This feature is only available on Dock Three.

      object allOf
      uid: getPortMode
      • #ucd3

      Examples

    • #11set_port_mode

      3️⃣️ 🧪 Configure an external port.

      ⚠️ This feature is only available on Dock Three.

      object allOf
      uid: setPortMode
      • #ucd3

      Examples

    • #12get_port_modes

      3️⃣️ 🧪 Get all external port configurations.

      ⚠️ This feature is only available on Dock Three.

      object allOf
      uid: getPortModes
      • #ucd3

      Examples

    • #13set_port_trigger

      3️⃣️ 🧪 Set trigger state of an external port.

      Result codes

      • 200: trigger has been set.
      • 400: invalid port number or unsupported command (on Dock Two).
      • 404: port is not configured as trigger.
      • 409: conflict: impulse is already active.
      • 423: port is temporarily unavailable. It might be reconfigured or is in use.
      • 500: internal error.
      • 503: port not available. ⚠️ This feature is only available on Dock Three.
      object allOf
      uid: setPortTrigger
      • #ucd3

      Examples

    • #14get_port_trigger

      3️⃣️ 🧪 Get trigger state of an external port.

      ⚠️ This feature is only available on Dock Three.

      object allOf
      uid: getPortTrigger
      • #ucd3

      Examples

  • SUB /

    Dock-API for clients to receive messages from the docking station.

    Operation IDsubDockMessage

    Accepts one of the following messages:

    • #0pong

      🚀 Pong is a response to ping message.

      Server pong response to a ping to determine whether connection is alive. This is an application level pong as opposed to default pong in websockets standard which is sent by client in response to a ping.

      object
      uid: pong

      Examples

    • #1authentication

      🚀 Authentication response.

      The authentication result is provided in the code attribute:

      • 200: success, API can be used and message requests are accepted.
      • 401: authentication failed, the provided API-key is not valid. The server will close the connection.
      object
      uid: authResponseMsg

      Examples

    • #2result

      🚀 Command result message.

      object
      uid: commonResp

      Common response message properties.

      Examples

    • #3sysinfo

      🚀 System information response.

      object allOf
      uid: systemInfoMsg
        Examples values:
      • {"type":"dock","req_id":2,"msg":"get_sysinfo","code":200,"name":"My dock","hostname":"UC-Dock-1234","model":"UCD2","revision":"5.4","version":"0.4.0","serial":"0042","ir_learning":false}

      Examples

    • #4port_mode

      3️⃣️ 🧪 External port configuration.

      ⚠️ This feature is only available on Dock Three.

      object allOf
      uid: portMode
      • #ucd3

      Examples

    • #5port_modes

      3️⃣️ 🧪 External port configurations.

      ⚠️ This feature is only available on Dock Three.

      object allOf
      uid: portModes
      • #ucd3

      Examples

    • #6port_trigger

      3️⃣️ 🧪 Trigger state of an external port.

      Result codes

      • 200: success.
      • 400: invalid port number or unsupported command (on Dock Two).
      • 404: port is not configured as trigger.
      • 503: port not available.
      object allOf
      uid: portTrigger
      • #ucd3

      Examples

    • #7auth_required

      🚀 Authentication request event after connection is established.

      The event contains additional metadata of the dock to inform the client of the specific dock model and firmware version.
      The client must authenticate with the auth request message.

      object
      uid: authRequiredEvent
        Examples values:
      • {"type":"auth_required","model":"UCD2","revision":"5.4","version":"0.6.0"}

      Examples

    • #8ir_receive

      🚀 IR learning event.

      Sent whenever an IR code was learned in IR learning mode.

      object allOf
      uid: irReceiveEvent
        Examples values:
      • {"type":"event","msg":"ir_receive","ir_code":"4;0x10;12;0"}

      Examples

    • #9ir_receive_on_event

      3️⃣️ 🧪 IR-learning active event.

      Sent when IR-learning has been activated.

      ⚠ currently only available on Dock 3.

      object allOf
      uid: irReceiveOnEvent
      • #ucd3

      Examples

    • #10ir_receive_off_event

      3️⃣️ 🧪 IR-learning stopped event.

      Sent when IR-learning has been stopped.

      ⚠ currently only available on Dock 3.

      object allOf
      uid: irReceiveOffEvent
      • #ucd3

      Examples

    • #11port_mode_event

      3️⃣️ 🧪 External port mode change event.

      Sent when an external port mode was detected.

      object allOf
      uid: portModeEvent
      • #ucd3

      Examples

Messages

  • #1request

    🚀 Generic request message.

    object
    uid: commonReq

    Common request message properties.

  • #2result

    🚀 Command result message.

    object
    uid: commonResp

    Common response message properties.

  • #3event

    🚀 Generic event message.

    object
    uid: commonEvent

    Common event message properties.

  • #4auth_required

    🚀 Authentication request event after connection is established.

    The event contains additional metadata of the dock to inform the client of the specific dock model and firmware version.
    The client must authenticate with the auth request message.

    object
    uid: authRequiredEvent
      Examples values:
    • {"type":"auth_required","model":"UCD2","revision":"5.4","version":"0.6.0"}
  • #5auth

    🚀 Authenticate a connection.

    Sent by the client right after establishing a connection, or after an auth_required request by the server.

    object
    uid: authRequestMsg
      Examples values:
    • {"type":"auth","token":"1234"}
  • #6authentication

    🚀 Authentication response.

    The authentication result is provided in the code attribute:

    • 200: success, API can be used and message requests are accepted.
    • 401: authentication failed, the provided API-key is not valid. The server will close the connection.
    object
    uid: authResponseMsg
  • #7ping

    🚀 Application level based ping to determine whether connection is alive.

    Client can ping the server to determine whether connection is alive. Server responds with pong.

    This is an application level ping as opposed to the standard WebSocket ping frames. This is only required if a client framework doesn't support WebSocket ping frames!

    object
    uid: ping
  • #8pong

    🚀 Pong is a response to ping message.

    Server pong response to a ping to determine whether connection is alive. This is an application level pong as opposed to default pong in websockets standard which is sent by client in response to a ping.

    object
    uid: pong
  • #9command

    🚀 Perform a system command.

    The following system commands can be executed:

    • ir_receive_on: Enables IR learning.
      • Learned codes are broadcasted with the ir_receive event message.
      • Learning mode status can be retrieved with the get_sysinfo request.
      • While learning mode is activated, no IR codes can be transmitted.
    • ir_receive_off: Stops IR learning.
    • remote_charged: Set status LED to normal operation (LED off)
    • remote_lowbattery: Set status LED to low battery mode (blink twice every 4 seconds).
    • remote_normal: Set status LED to normal operation (LED off, turn on when charging).
    • identify: Docking station identification, blink status LED green, amber, blue and red.
    • reboot: Reboot the device.
    • reset: Factory reset the device.
      • ❗️ All configuration data is erased and the device is put in setup mode.

    The server will respond with a result message and a status code of the request.

    ❗️ For reboot and reset commands there might be no response message. The dock will reboot after the command is processed.

    object allOf
    uid: systemCmdMsg
  • #10get_sysinfo

    🚀 Get system information.

    Get hardware and software information about the device like serial number, model number, connection status and installed firmware version.

    This message does not require authentication.

    object allOf
    uid: getSystemInfoMsg
  • #11sysinfo

    🚀 System information response.

    object allOf
    uid: systemInfoMsg
      Examples values:
    • {"type":"dock","req_id":2,"msg":"get_sysinfo","code":200,"name":"My dock","hostname":"UC-Dock-1234","model":"UCD2","revision":"5.4","version":"0.4.0","serial":"0042","ir_learning":false}
  • #12ir_send

    🚀 Send an IR code or continue repeating a previous code.

    Send an IR code on the given output(s), either in Unfolded Circle or PRONTO HEX format.

    • If multiple outputs are specified, the IR signal is transmitted in parallel on the given outputs.
    • Only one IR code can be transmitted at the same time.
      It is not possible to send different codes on individual outputs at the same time.
    • IR transmission is blocked while the device is in learning mode.
    • If no output is specified: int_side is used as default output.
    • 3️⃣ Outputs not configured for IR sending are silently ignored.

    The IR transmission begins after the full message has been received, parsed and validated. Depending on the state of the IR device, different actions are taken:

    • Device is idle: a single code is transmitted and status code 200 returned after completion.
    • Transmitting the same IR code with the repeat field set: return status code 202 and continue repeating the IR code.
    • Transmitting another IR code: return error code 429.

    See Result codes below for all status codes.

    Continuous IR repeat

    This feature allows to repeat an IR signal autonomously by the dock for a specified number of times.

    The repeated IR signal is usually a special IR command to tell the receiving device, that a button on a remote control is hold for a longer time. Depending on the device, a repeat signal can either simply execute the same action as if someone would rapidly press the same button, or it can adjust the command to a different function. One common example is to progressively increase the volume steps, e.g. start slowly with 0.1 dBA steps, then after a short time increase to 0.5 or 1 dBA steps.
    Please note that not all devices or IR formats / commands support this feature. This is manufacturer specific.

    The continuous IR repeat feature is activated with the optional repeat field in the ir_send command.

    • The IR repeat signal will automatically be sent the number of times specified in the repeat field.
    • If the next ir_send request contains the same command value, the repeat count will be reset and therefore the repeat signal prolonged.
    • An ir_stop request will stop the remaining repeat commands.
    • Depending on the IR format, a repeat value might be already part of the code.
      • ⚠️ The repeat value will override the embedded repeat information.
      • See IR formats below.
    • Each repeat request will be acknowledged with a response message and a 202 status code, unless it gets disabled with the feature flag in bit 0.

    If not specified (or set to zero):

    • The provided code is sent as is, with the contained repeat information (depending on IR format).
    • Continuous IR repeat is not activated:
      • every ir_send command will send the full IR command.
      • ⚠️ the ir_stop command will have no effect!

    IR formats

    • pronto: PRONTO HEX format:
      • The PRONTO HEX format does not include a dedicated repeat count field, but an optional 2nd burst pair sequence used for repeats.
        • The third number in the PRONTO code specifies the number of burst pairs in the 1st sequence.
        • The fourth number in the PRONTO code specifies the number of burst pairs in the 2nd sequence.
        • If the fourth number is 0, then there's no repeat sequence.
        • Note that either sequence is optional. Also there might be both sequences defined, or only the 1st or 2nd one.
      • If the repeat field is set (> 0), the 2nd burst pair sequence of the PRONTO code is repeated.
        • If the PRONTO code doesn't contain a 2nd burst pair sequence, then the repeat value is ignored.
    • hex: Unfolded Circle format:
      • The repeat count is part of the code and might be required for certain protocols.
        • E.g. Sony needs to send the same command two or three times so it's recognized as a single command by a device.
      • If the repeat field is set (> 0), this will override the repeat count in code!
      • The actual emitted IR repeat signal depends on the IR protocols.
        • E.g. Denon will simply repeat the full command, whereas LG has a mandatory repeat-specific code sent after the command. This is all handled by the dock firmware, when sending the IR code.

    Result codes

    • 200: IR command has been sent. Either a single command, or after an IR repeat has finished.
    • 202: IR repeat command accepted. Default behavior, except the response message has been disabled with the feature flag.
    • 400: Cannot send command: invalid data or format.
    • 429: Cannot send command: last IR command is still being sent.
    • 503: IR sending not possible because learning is active.
    object allOf
    uid: irSendMsg
      Examples values:
    • {"type":"dock","id":1,"command":"ir_send","code":"4;0x10;12;0","format":"hex","int_side":true}
    • {"type":"dock","id":2,"command":"ir_send","code":"0000 006c 0022 0002 015b 00ad 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0622 015b 0057 0016 0e6c","format":"pronto","ext1":true}
    • {"type":"dock","id":3,"command":"ir_send","code":"4;0x10;12;1","format":"hex","repeat":3,"int_side":true}
    • {"type":"dock","id":4,"command":"ir_send","code":"0000 006c 0022 0002 015b 00ad 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0622 015b 0057 0016 0e6c","format":"pronto","repeat":3,"ext1":true}
  • #13ir_stop

    🔍 Stop an active IR repeat transmission.

    This command stops an active IR repeat transmission at the end of the current repeat signal.

    Status 200 is always returned, even if there's no active IR transmission.

    object allOf
    uid: irStopMsg
  • #14ir_receive

    🚀 IR learning event.

    Sent whenever an IR code was learned in IR learning mode.

    object allOf
    uid: irReceiveEvent
      Examples values:
    • {"type":"event","msg":"ir_receive","ir_code":"4;0x10;12;0"}
  • #15ir_receive_on_event

    3️⃣️ 🧪 IR-learning active event.

    Sent when IR-learning has been activated.

    ⚠ currently only available on Dock 3.

    object allOf
    uid: irReceiveOnEvent
    • #ucd3
  • #16ir_receive_off_event

    3️⃣️ 🧪 IR-learning stopped event.

    Sent when IR-learning has been stopped.

    ⚠ currently only available on Dock 3.

    object allOf
    uid: irReceiveOffEvent
    • #ucd3
  • #17port_mode_event

    3️⃣️ 🧪 External port mode change event.

    Sent when an external port mode was detected.

    object allOf
    uid: portModeEvent
    • #ucd3
  • #18set_config

    🚀 Configure the dock.

    Configure the dock with a custom friendly name, change the API access token and set the WiFi connection.

    Notes:

    • One or multiple settings can be configured at once.
    • For the WiFi configuration both ssid and wifi_password fields must be specified.
    • The dock will be restarted if the WiFi configuration is specified.
    • Ethernet has precedence over WiFi connection. If the ethernet connection has a link, WiFi won't be activated.
    • The friendly name will be announced over mDNS and returned in get_sysinfo.
    object allOf
    uid: setConfigMsg
      Examples values:
    • {"type":"dock","id":1,"command":"set_config","friendly_name":"My dock"}
    • {"type":"dock","id":2,"command":"set_config","token":"1234"}
    • {"type":"dock","id":3,"command":"set_config","ssid":"My WiFi","wifi_password":"topsecret"}
  • #19set_brightness

    🚀 Set status LED brightness.

    Set the maximum brightness of the status LED and ethernet indicator LED.

    object allOf
    uid: setBrightnessMsg
  • #20set_volume

    3️⃣️ 🔍 Set speaker volume.

    object allOf
    uid: setVolumeMsg
  • #21set_logging

    2️⃣ 🧪 Configure logging parameters.

    Set log level and an optional syslog server. Levels:

    • 0: EMERGENCY, system is unusable
    • 1: ALERT, action must be taken immediately
    • 2: CRITICAL, critical conditions
    • 3: ERROR, error conditions
    • 4: WARNING, warning conditions
    • 5: NOTICE, normal but significant condition
    • 6: INFO, informational
    • 7: DEBUG, debug-level messages

    ⚠️ This feature is currently only available on Dock Two.

    object allOf
    uid: setLogging
    • #ucd2
  • #22get_port_mode

    3️⃣️ 🧪 Get external port configuration.

    ⚠️ This feature is only available on Dock Three.

    object allOf
    uid: getPortMode
    • #ucd3
  • #23port_mode

    3️⃣️ 🧪 External port configuration.

    ⚠️ This feature is only available on Dock Three.

    object allOf
    uid: portMode
    • #ucd3
  • #24get_port_modes

    3️⃣️ 🧪 Get all external port configurations.

    ⚠️ This feature is only available on Dock Three.

    object allOf
    uid: getPortModes
    • #ucd3
  • #25port_modes

    3️⃣️ 🧪 External port configurations.

    ⚠️ This feature is only available on Dock Three.

    object allOf
    uid: portModes
    • #ucd3
  • #26set_port_mode

    3️⃣️ 🧪 Configure an external port.

    ⚠️ This feature is only available on Dock Three.

    object allOf
    uid: setPortMode
    • #ucd3
  • #27set_port_trigger

    3️⃣️ 🧪 Set trigger state of an external port.

    Result codes

    • 200: trigger has been set.
    • 400: invalid port number or unsupported command (on Dock Two).
    • 404: port is not configured as trigger.
    • 409: conflict: impulse is already active.
    • 423: port is temporarily unavailable. It might be reconfigured or is in use.
    • 500: internal error.
    • 503: port not available. ⚠️ This feature is only available on Dock Three.
    object allOf
    uid: setPortTrigger
    • #ucd3
  • #28get_port_trigger

    3️⃣️ 🧪 Get trigger state of an external port.

    ⚠️ This feature is only available on Dock Three.

    object allOf
    uid: getPortTrigger
    • #ucd3
  • #29port_trigger

    3️⃣️ 🧪 Trigger state of an external port.

    Result codes

    • 200: success.
    • 400: invalid port number or unsupported command (on Dock Two).
    • 404: port is not configured as trigger.
    • 503: port not available.
    object allOf
    uid: portTrigger
    • #ucd3

Schemas

  • object
    uid: commonReq

    Common request message properties.

  • object
    uid: commonResp

    Common response message properties.

  • object
    uid: commonEvent

    Common event message properties.

  • object
    uid: authRequiredEvent
      Examples values:
    • {"type":"auth_required","model":"UCD2","revision":"5.4","version":"0.6.0"}
  • object
    uid: authRequestMsg
      Examples values:
    • {"type":"auth","token":"1234"}
  • object
    uid: authResponseMsg
  • object allOf
    uid: systemCmdMsg
  • object allOf
    uid: getSystemInfoMsg
  • object allOf
    uid: systemInfoMsg
      Examples values:
    • {"type":"dock","req_id":2,"msg":"get_sysinfo","code":200,"name":"My dock","hostname":"UC-Dock-1234","model":"UCD2","revision":"5.4","version":"0.4.0","serial":"0042","ir_learning":false}
  • object allOf
    uid: irSendMsg
      Examples values:
    • {"type":"dock","id":1,"command":"ir_send","code":"4;0x10;12;0","format":"hex","int_side":true}
    • {"type":"dock","id":2,"command":"ir_send","code":"0000 006c 0022 0002 015b 00ad 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0622 015b 0057 0016 0e6c","format":"pronto","ext1":true}
    • {"type":"dock","id":3,"command":"ir_send","code":"4;0x10;12;1","format":"hex","repeat":3,"int_side":true}
    • {"type":"dock","id":4,"command":"ir_send","code":"0000 006c 0022 0002 015b 00ad 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0622 015b 0057 0016 0e6c","format":"pronto","repeat":3,"ext1":true}
  • object allOf
    uid: irStopMsg
  • object allOf
    uid: irReceiveEvent
      Examples values:
    • {"type":"event","msg":"ir_receive","ir_code":"4;0x10;12;0"}
  • object allOf
    uid: irReceiveOnEvent
  • object allOf
    uid: irReceiveOffEvent
  • object allOf
    uid: portModeEvent
  • object allOf
    uid: setConfigMsg
      Examples values:
    • {"type":"dock","id":1,"command":"set_config","friendly_name":"My dock"}
    • {"type":"dock","id":2,"command":"set_config","token":"1234"}
    • {"type":"dock","id":3,"command":"set_config","ssid":"My WiFi","wifi_password":"topsecret"}
  • object allOf
    uid: setBrightnessMsg
  • object allOf
    uid: setVolumeMsg
  • object allOf
    uid: setLogging
  • object
    uid: ping
  • object
    uid: pong
  • object allOf
    uid: getPortMode
  • object allOf
    uid: portMode
  • object allOf
    uid: getPortModes
  • object allOf
    uid: portModes
  • object allOf
    uid: setPortMode
  • object allOf
    uid: setPortTrigger
  • object allOf
    uid: getPortTrigger
  • object allOf
    uid: portTrigger
  • msgId
    integer
    >= 0uid: msgId

    Request message ID which is reflected in response message.

  • command
    string
    [ 1 .. 32 ] charactersuid: command

    One of the defined API message commands.

  • irFormat
    string
    uid: irFormat

    IR format:

    • hex: Unfolded Circle format: <protocol>;<hex-ir-code>;<bits>;<repeat-count> e.g. "4;0x640C;15;0"
      • Maximum repeat count is 20.
      • Protocol and code are based on IRremoteESP8266.
    • pronto: PRONTO HEX format. Codes separated by space or comma.
      • Only raw PRONTO codes are supported (first code must be 0000).
      • Codes may be shortened, e.g. 0000 can be specified as 0, or 0010 as 10.
    Default value:"hex"
      Allowed values:
    • "hex"
    • "pronto"
  • token
    string
    [ 4 .. 40 ] charactersuid: token
  • externalPortNumber
    integer
    [ 1 .. 2 ]uid: externalPortNumber

    1-based port index number.

  • externalPortMode
    string
    uid: externalPortMode
      Allowed values:
    • "AUTO"
    • "NONE"
    • "IR_BLASTER"
    • "IR_EMITTER_MONO_PLUG"
    • "IR_EMITTER_STEREO_PLUG"
    • "TRIGGER_5V"
    • "RS232"
  • object allOf
    uid: externalPortConfiguration

    External port configuration.

    • mode: configured operation mode.
    • active_mode: active operation mode, usually only set with the detected peripheral for mode: AUTO.
  • object
    uid: uartConfiguration
  • baudRate
    integer
    [ 300 .. 115200 ]uid: baudRate

    Common baud rate values: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200

    Default value:9600
  • dataBits
    integer
    [ 5 .. 8 ]uid: dataBits
    Default value:8
  • stopBits
    string
    uid: stopBits

    Stop bits must be set as string, number format is not supported!

    Default value:"1"
      Allowed values:
    • "1"
    • "1.5"
    • "2"
  • parity
    string
    uid: parity
    Default value:"none"
      Allowed values:
    • "none"
    • "even"
    • "odd"
  • features
    integer
    >= 0uid: features

    Bit-field encoded feature flags. These are new or optional features a client can use. They also allow an easy way to keep backward compatibility. Available features:

    • Bit 0: support for disabling IR repeat response messages. Default: disabled.
    • Bit 1: ir_send command supports the hold parameter to send ir command for x milliseconds.