> For the complete documentation index, see [llms.txt](https://docs.mclimate.eu/mclimate-lorawan-devices/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mclimate.eu/mclimate-lorawan-devices/devices/mclimate-multipurpose-button-lorawan/mclimate-button-lorawan-device-communication-protocol/button-press-event-counters.md).

# Button press event counters

## Get press event counter

{% hint style="info" %}
These commands are available for devices with firmware version ≥ 1.3.
{% endhint %}

These commands return the counter value for button press events. Each counter tracks a specific type of press: single, double, or triple. The counter increments every time the corresponding press event occurs. The values are stored in long-term (EEPROM) memory, ensuring they persist after a device restart.

The command is sent together with the keepalive of the device. The keepalive data in the example below is omitted for clarity.

{% tabs %}
{% tab title="GET single press event counter" %}

<table data-header-hidden><thead><tr><th width="136.99999999999997"></th><th width="186"></th><th></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Sent request</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>B1 – Command code</td><td>B1 – Command code</td></tr><tr><td>1</td><td> </td><td>Single press event counter, bits [23:16].</td></tr><tr><td>2</td><td></td><td>Single press event counter, bits [15:8].</td></tr><tr><td>3</td><td></td><td>Single press event counter, bits [7:0].</td></tr></tbody></table>

**Example downlink sent by the server:** 0xB1;

**Example command response:** 0xB10001AA – The number of single press events is 426.
{% endtab %}

{% tab title="GET double press event counter" %}

<table data-header-hidden><thead><tr><th width="136.99999999999997"></th><th width="188"></th><th></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Sent request</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>B2 – Command code</td><td>B2 – Command code</td></tr><tr><td>1</td><td> </td><td>Double press event counter, bits [23:16].</td></tr><tr><td>2</td><td></td><td>Double press event counter, bits [15:8].</td></tr><tr><td>3</td><td></td><td>Double press event counter, bits [7:0].</td></tr></tbody></table>

**Example downlink sent by the server:** 0xB2;

**Example command response:** 0xB20001BB – The number of double press events is 443.
{% endtab %}

{% tab title="GET triple press event counter" %}

<table data-header-hidden><thead><tr><th width="136.99999999999997"></th><th width="189"></th><th></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Sent request</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>B3 – Command code</td><td>B3 – Command code</td></tr><tr><td>1</td><td> </td><td>Triple press event counter, bits [23:16].</td></tr><tr><td>2</td><td></td><td>Triple press event counter, bits [15:8].</td></tr><tr><td>3</td><td></td><td>Triple press event counter, bits [7:0].</td></tr></tbody></table>

**Example downlink sent by the server:** 0xB3;

**Example command response:** 0xB30001CC – The number of triple press events is 443.
{% endtab %}
{% endtabs %}

## Clear press event counter

{% hint style="info" %}
This command is available for devices with firmware version ≥ 1.3.
{% endhint %}

Clears the press event counter for the specified press type (1 - single, 2 - double, or 3 - triple). This command allows the system to clear the accumulated press event count stored in long-term (EEPROM) memory, ensuring that the counter resets to zero for the selected press type.

<table><thead><tr><th width="182"></th><th width="111"></th><th></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Bit index</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>-</td><td>20 – The command code.</td></tr><tr><td>1</td><td>-</td><td>XX - Clear (1 - single, 2 - double, or 3 - triple) press event counter.</td></tr></tbody></table>

**Example downlink**: 0x2001 – Clear the single press event counter.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mclimate.eu/mclimate-lorawan-devices/devices/mclimate-multipurpose-button-lorawan/mclimate-button-lorawan-device-communication-protocol/button-press-event-counters.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
