Skip to content

JSON RPC Event Server

verybadsoldier edited this page Jun 28, 2019 · 2 revisions

A TCP server running on port 9090 publishes event messages to all connected clients (max. 4 clients). All messages have an ID which is an integer incremented with every message.

The server can be enabled/disabled by using the configuration setting events/server_enabled.

Color Status Message

Every 500 ms a color status message will be sent (only if the color status has changed since the last message). The interval can be configured by config setting events/color_interval_ms. A value of -1 disables color status messages completely. The color status message will also be sent if an animation on any channel finished (independently of events/color_interval_ms). This is done to get final channel states as soon as possible. The config setting events/color_mininterval_ms can be used to limit the rate of color status messages globablly (otherwise very-short animations could trigger messages faster than events/color_interval_ms).

The field mode will show the mode the controller is currently in. It can be raw or hsv. When in mode hsv then there will be a field hsv in the message that contains the HSV values.

Example:

{"jsonrpc":"2.0","method":"color_event","params":{"mode":"hsv","raw":{"r":0,"g":638,"b":442,"ww":379,"cw":6},"hsv":{"h":161.58,"s":62.37,"v":100.00,"ct":2746}},"id":63}

Animation Finished Message

Every time a named animation (see Named Animations) finishes a notification event will be sent. The name will be included in the message. The parameter requeued states if the animation has been requeued to the queue. Usually this is false and means that the animation finished and got removed from the queue. For animations with requeue flag this value can also be true which means that the animation has been finished once but has been requeued to the queue. The rate of this message can be limited using the config setting events/transfin_interval_ms. A value of -1 will disable this limit.

Example:

{"jsonrpc":"2.0","method":"transition_finished","params":{"name":"myFade", "requeued":true},"id":1356}

Keep-Alive Messages

Every 60 seconds the controller will send a keep-alive notification indicating that it is up and running.

Example:

{"jsonrpc":"2.0","method":"keep_alive","params":{},"id":1163}