# MQTT Payload Manual for Bits and Integers

This manual provides guidance on the payload structure and commands for working with bits and integers in MQTT (Message Queuing Telemetry Transport). Bits and integers represent binary states and numerical values respectively in an iNELS environment.

### Topics and Payload Format

#### Status Topic

The status topic is used to retrieve the current state of bits and integers.

**Topic Structure:**

**Payload Format:**

`<timestamp>`

: Time when the status was last updated.`<ID>`

: Unique identifier for the bit or integer.`<value>`

: Binary state (for bits) or numerical value (for integers).

#### Set Topic

The set topic is used to send commands to control bits and integers.

**Topic Structure:**

**Command Format:**

`<ID>`

: Unique identifier for the bit or integer.`<command>`

: Action to be performed on the corresponding bit or integer.

### Commands

#### For Bits

`0`

: Turn off the bit.`1`

: Turn on the bit.`toggle`

: Toggle the current state of the bit.

#### For Integers

Set a specific value for the integer.

### Limitations

Maximum 40 bits or 20 integers can be included in one topic.

If there are more bits or integers, they will be displayed in additional topics.

### Example

#### Status Topic Payload (Bits)

**Topic:** `inels/status/2C6A6F104825/bits/000001`

**Payload:**

#### Set Topic Command (Bits)

**Topic:** `inels/set/2C6A6F104825/bits/000001`

**Command:**

#### Status Topic Payload (Integers)

**Topic:** `inels/status/2C6A6F104825/integers/000001`

**Payload:**

#### Set Topic Command (Integers)

**Topic:** `inels/set/2C6A6F104825/integers/000001`

**Command:**

### Conclusion

This manual provides a clear understanding of the payload structure and commands for interacting with bits and integers over MQTT. It facilitates efficient communication and control in IoT applications.

Last updated