ioBroker.ws
This adapter is used by WEB applications and adapters to communicate with ioBroker using websockets.
It is almost the same as ioBroker.socketio, but does not use socket.io library and only simulates it.
Important Note: Since v4.0 of this adapter, pure Websockets are used exclusively! Socket.io is no longer implemented by the socket.io library but simulated via pure WebSockets!
Users can use this adapter to connect their products to ioBroker via web sockets. Actually, this adapter could be used by echarts, vis and many other adapters to extract data from ioBroker.
You can find in the example directory a simple application that uses this interface to show some data.
By using of socket.io interface user should understand the basics and concept of the system.
It is useful to read about the structure of the objects too.
Brief description of the concept
Object
Object is a description of a data point or group. The group could content other data points in this case it called a channel. If a group consists of other channels, in this case it is called a device.
Object is meta-information that describes data point and could content: max/min value, unit, name, default value, type of value, information for adapter for communication (e.g., IP address) and so on.
State
State is the actual value of the data point and presented by a JavaScript object:
const state = {
"val": VALUE,
"ack": ACKNOWLEDGED,
"ts": TIMESTAMP, // could be converted into time with "new Date(state.ts)" (In older version of js-controller - "new Date(state.ts * 1000)")
"lc": TIMESTAMP_of_last_change,
"from": ADAPTER_NAME,
"q": QUALITY
}
States change themselves very frequently in comparison to the objects. (Normally objects should be changed once by creation, and that's all)
Acknowledgment
Every state has the attribute ack. It shows the direction of command.
- If ack=false, it means some other adapter wants to control (write) this variable, so that command will be executed (e.g., light will be switched on).
- If ack=true, it means that the device informs about new value. (e.g., light was switched on manually, or motion was detected)
Example: we have some home automation adapter (HAA) that has one lamp connected under address haa.0.lamp1.
- Lamp can be switched on manually with a physical switch or via Wi-Fi with the help of HAA.
- If vis wants to switch the lamp on via Wi-Fi, it should set the new value with
{ value: true, ack: false }. - When the lamp is switched on it is normally informing HAA about new state and the value should be immediately overwritten with
{ value: true, ack: true }. - If the lamp is switched off manually via physical switch it informs HAA about new state with
{ value: false, ack: true }.
Quality
Every data point has an attribute q - quality.
Usage
You can find the description of every supported method here.
It is suggested to use socket class for communication.
Changelog
5.1.3 (2026-10-14)
- (@GermanBluefox) Updated packages
5.1.2 (2026-10-04)
- (@GermanBluefox) The copy of the browser client under
build/lib/socket.io.jsis refreshed by the build instead of staying behind. It had stopped at the version of April and still carried the query string of the page into the WebSocket address without encoding it again, so a page whose address contains an encoded#- a colour of a chart, for example - produced an address with a fragment, which a browser refuses to open a WebSocket to. Only web 8.x reads this copy; web 9.x takes the client from@iobroker/ws-server-libraryand was never affected
5.1.1 (2026-09-24)
- (@GermanBluefox) Added the HTTP/2 option (enabled by default, with HTTP/1.1 fallback, only used with HTTPS)
- (@GermanBluefox) Updated packages
5.0.2 (2026-08-31)
- (@GermanBluefox) Updated packages
5.0.1 (2026-08-28)
- (@GermanBluefox) Updated packages