What are Channels?

Channels are data structures that allow Things and applications to publish data and to read data. Channels are equivalent to Topics in the message bus terminology.  The CloudPlugs channels are automatically created when data is published and they have a hierarchical structure like a file system. This channel architecture provides maximum flexibility and easy in development and deployment of Things.

Things, controllers or applications publish data into channels or subscribe to channels to read data published by other Things or applications. Things can subscribe and publish data into one or more channels.

Channels can have one level or have multiple levels of sub-channels. The forward slash (/) is used as the channel level separator and is used to provide a hierarchical structure to the channel space. Multiple consecutive slashes such as (//) or (///) are invalid. The following are examples of channels:

  • temperature

  • sensor/temperature  (sensor is a channel and temperature is a sub-channel)

  • sensor/temperature/fridge (each level is a channel)

CloudPlugs does not offer a specific tool to create channels since they do not exist as individual elements.  Channels are created dynamically as data gets published. For example, you do not need to create sensor before creating temperature and to createtemperature before fridge.  You can simply publish to sensor/temperature/fridge and the structure will be automatically created if it did not exist.  You can see all your channels under  Channels in the Published data -> Data tab.

Things can subscribe to multiple channels at once using single level or multi-level wildcards.  For more information on wildcards, refer to the wildcards section.

Channels have one or more data fields with structured and/or unstructured data.   Structured data fields are JSON objects such as:

{
"internal": 70,
"external": 90
}

An example of unstructured data for a temperature channel is the value 70 (for 70 degrees Fahrenheit).

Channel Names

The maximum length of a channel name is 200 characters including the channel separators.  It is recommended to plan the channel structure beforehand to ensure an architecture that will support your environment.

When creating your data structures, you should consider creating channel names that will reflect at least some key transactions such as command, settings, properties, firmware, mode, updates, etc. For example, you can create a channel name such as:

  • room/temperature/commands

or

  • room1/thermostat/settings

Managing Channels

The hierarchical tree structure of your channels is displayed under Channels in the Published data -> Data tab. Channels that have sub-channels are displayed as a closed folder (Closed folder ) or as an open folder ( Open folder ). Channels with no sub-channels are represented by the icon: Channel folder

Selecting any channel level will filter and display the data available only for that channel.

Data

Deleting Channels

Channels, their sub-channels and their data can be deleted with one click under Channels in the Published data -> Data tab. In addition, because channels resemble tags which exist only if they have published data, channels will automatically disappear if all the data published in the channel is erased.

To erase all channels and their data, select the “All channels” folder and delete. You will be asked to enter a delete code for safety reasons.

Still need help? Get in touch!
Last updated on 26th Mar 2019