Subscribes or unsubscribes to/from a channel.
When subscribed to a channel, any changes in that channel are relayed to the subscribed device using the {CHSTATE} command, or in the case of sensors, the {S} command. The current state will also be relayed upon subscribing.
Changes can be triggered by any connected device, or by scripts running locally on the RemoteSign ESP. This allows multiple devices stay synchronized with channel data, and obtain state data after connecting.
Syntax
{CHSUB} channel
- channel - the number of the channel to be subscribed to. Use a negative channel number to unsubscribe. E.g. -2 will unsubscribe from channel 2.
- Monochrome lights
- Color Lights
- Signals
- Sensors
- The subscription must be renewed after any disconnection. The subscription has no persistent storage on the RemoteSign ESP and lasts only for the duration of the connection.
- Previously, {SIG} commands were broadcast to all connected devices when a signal changed. Signal changes are now only sent to subscribed devices using {CHSTATE}
- Previously, {S} commands were broadcast to all connected devices when a sensor changed. Signal changes are now only sent to subscribed devices. For backward compatibility, state changes are but are still sent as {S} commands not {CHSTATE}
- Sensors are all defined within the same channel, so subscribing to a sensor channel subscribes to all the sensors (for now anyway).