nodes channel

the nodes channel opens communication with all WebSocket nodes in a veadotube instance.

if you’re using veadotube, these nodes will have both a display name and an ID, as well as the node type itself, all which you can create and configure.

if you’re using veadotube mini, which uses the node system behind the scenes, these nodes are always exposed:

getting the node list

to get a complete list of exposed nodes through the WebSocket, you send a list event. you may also send listen or unlisten events to automatically receive the list when it changes. examples:

for the command line, you can request a line-separated list of nodes (their type and id, space-separated), and then request the display name of that node separately.

node events

to communicate with a node through the WebSocket, you’ll be sending and receiving payload events, where the payload object structure will vary depending on the node type. for example:

for all node types, you can send a listen/unlisten event, so that you’ll automatically receive new events when the current node state changes:

boolean nodes

for boolean nodes, you can get their current value, which will either be true or false (or an empty object, in case no value has been set). it may also return 1 for true and 0 for false.

you can also set a new value by either setting it specifically to either true or false, or by telling it to toggle it (so if it is currently true it should become false and vice-versa).

to get a value through the WebSocket:

to set a new value through the WebSocket:

to get or set values through the command line:

number nodes

for number nodes, you can get their current value or set a new one. number values can also include their range (minimum and maximum possible values).

when setting a new value, you can either set to a specific number, or to add to the current number. you can also include a new possible range; if a range is not included in the message, the previous range will be kept if you’re adding to the current number, and discarded if you’re setting to a specific number.

to get a value through the WebSocket:

to set a new value through the WebSocket:

same examples, but for the command line:

stateEvents nodes

stateEvents nodes control a state stack. said stack works similar to a stack in computing:

to get a list of possible states through the WebSocket:

both the state id and name are always the same, except in veadotube mini 2.0a and older, where state ids and names were different from each other, and thumbnail hashes weren’t present.

to get the thumbnail image for a given state:

to peek on the current state on top of the stack:

to modify the state stack:

the same examples but for the command line: