# Heartbeat 1 and Heartbeat 2

Heartbeats 1 and 2 were created to let you know that the device is alive periodically. We have also added additional settings and the possibility to append various data. Each heartbeat is controlled by 3 registers - a total of *6 registers* (**from 0x07 to 0x0C**).

**Heartbeat period** is controlled by registers 0x07 and 0x0A for Heartbeats 1 and 2 respectively. The values of these registers are encoded as a *SimpleTime* value in a single byte.

*Example: Setting the Heartbeat 1 period register (0x07) to 10 minutes (0x4A) would make the device send the heartbeat message every 10 minutes (duh!:)).*

***

**Heartbeat settings** registers (**0x08** and **0x0B** for **Heartbeats 1** and **2** respectively) control behavior of the heartbeat event. The 8 binary flags (bits) of this **one byte value** modify the following:

| **Bit** | **Set to 0**                                                                                       | **Set to 1**                                                                                        |
| ------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **7**   | <p>Heartbeat time period is <strong>not</strong> reset<br>by other events sent from the device</p> | <p>Heartbeat time period is reset by other events<br>sent from the device (to save the battery)</p> |
| **6**   | Heartbeats sent while armed only                                                                   | Heartbeats sent regardless of device state                                                          |
| **5**   | Uplink only heartbeat message                                                                      | Heartbeat message requests standard downlink                                                        |
| **4**   | Uplink only heartbeat message                                                                      | <p>Heartbeat message requests downlink<br>with world time to sync the internal clock</p>            |
| **3**   | Standard 3 frames transmitted                                                                      | Only one frame message will be sent                                                                 |
| **2**   | (empty)                                                                                            | (empty)                                                                                             |
| **1**   | (empty)                                                                                            | (empty)                                                                                             |
| **0**   | (empty)                                                                                            | (empty)                                                                                             |

*Example: Setting the Heartbeat 1 settings register (0x08) to value 0x40 (01000000) would make the device send the heartbeat message even when disarmed.*

**Heartbeat appended payload mask** registers (**0x09** and **0x0C** for **Heartbeats 1** and **2** respectively) control the various data that can be appended to the heartbeat message. The mask is identical to the standard *Appended payload* mask that controls what data is sent with events from 0x00 to 0x7F.

*Example: The default value of these registers is 0xC0 (11000000) - this means that with every heartbeat, battery voltage and temperature will be appended.*

{% content-ref url="/pages/11eIe9gH2cR6tZOnJmho" %}
[Appended payload](/kb/simple-api-6-generation/modes/api-6-mode-independent-information-and-events_15237121/appended-payload.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ask.simplehw.eu/kb/simple-api-6-generation/modes/api-6-mode-independent-information-and-events_15237121/heartbeats/heartbeat-1-and-heartbeat-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
