> 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-vicki-lorawan/vicki-lorawan-device-communication-protocol/heating-schedules.md).

# Heating schedules

## Before you start

For heating schedules to work correctly, you have to make sure three things are configured correctly first:

* **Device time**
  * By default, Vicki asks the LoRaWAN network for the current UTC time (using a MAC command). If the time is not correctly set by the LoRaWAN Network Server, you might want to set it yourself and disable the MAC command syncing
* **Device time-zone**
  * Adjust the correct time-zone based on UTC where the device is installed.
* **Heating season start and end date**
  * To minimize motor movements, the heating schedules are only executed during the heating season.

{% hint style="info" %}
Keep in mind that the maximum downlink size is 51 bytes!
{% endhint %}

## Good practices

* When your country switches from daylight savings time to winter time, adjust the time-zone correctly and automatically.
* The easiest way to sync time is through the LoRaWAN MAC command that Vicki sends to the LNS. While this works on all LNS we've tested so far, please make sure it works on your instance too.
  * To make sure that the device has the correct time, it'll send the current reading to the Application Server. In case the UNIX timestamp sent is not correct, use a SET command to set the correct time and consider turning off the MAC sync.
* Decide on the heating start/end dates wisely so that Vicki doesn't move the motor when the heating system is still not operational.

## Heating event details

This command is used to configure the device's internal heating schedule. Maximum of 20 events are supported, which are executed at individual time slots during the day and the user can choose on which week-day they are to be executed/repeated. This allows to precisely control the device target temperature on a week day, hour and minute basis.

{% tabs %}
{% tab title="SET" %}

<table><thead><tr><th width="123.48828125"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Hex value / Meaning</strong></td><td><strong>Bit</strong></td></tr><tr><td>0</td><td>59 – command code</td><td></td></tr><tr><td>1</td><td>Event index – 0–19 for configuring of total 20 events.</td><td></td></tr><tr><td>2</td><td>Starting hour for a given heating event – 0–23.</td><td></td></tr><tr><td>3</td><td>Starting minute for a given heating event – 0–59.</td><td></td></tr><tr><td>4-MSB<br>5-LSB</td><td><p>Target temperature to be set at the heating event beginning, represented in Celsius degrees multiplied by 10, in order to support point decimal values.<br><strong>Min. allowed value – 50 (5°C)</strong></p><p><strong>Max. allowed value – 300 (30°C).</strong></p></td><td></td></tr><tr><td>6</td><td><p>Mark which day the heating event will be executed/repeated for.</p><p>A bit value 0 means disabled, 1 means enabled. Bit 0 is for Monday, bit 6 is for Sunday.</p></td><td></td></tr></tbody></table>

**Example command:** `5900080101021F59020600006460`

* `00` – Configure event index 0:
  * `08 01` – Starts at 08:01
  * `01 02` – Target = 25.8°C
  * `1F` – Monday to Friday
* `02` – Configure event index 2:
  * `06 00` – Starts at 06:00
  * `00 64` – Target = 5.0°C
  * `60` – Saturday to Sunday
    {% endtab %}

{% tab title="GET" %}

<table><thead><tr><th width="107.0703125"></th><th width="223.23046875"></th><th></th></tr></thead><tbody><tr><td></td><td><strong>Hex value – Meaning</strong></td><td></td></tr><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>5A – The command code.</td><td>5A – The command code.</td></tr><tr><td>1</td><td>00 – Get events 0–7;<br>01 – Get events 8–15;<br>02 – Get events 16–19.</td><td>Same global index value as the request.</td></tr><tr><td>2…41</td><td></td><td>Heating events, as described in the corresponding set command, but without individual index for each event. Note that the response length for heating events with index 16-19 equals the length for the other indexes and the unused indexes are filled with zeros.</td></tr></tbody></table>

**Example command 1:** `0x5A00`

**Example response 1:** `0x5A00 080101021F 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000`\
`0x5A00` – Response contains configuration for heating events with indexes 0-7.\
`0x080101021F` – Configuration of heating event with index 0 – from Monday to Friday set target temperature of 25.8°C at 8:01 o'clock.\
`0x0000000000` – events with index 1-7 aren't configured.

**Example command 2:** `0x5A02`

**Example response 2:** `0x5A02 070100DC1F 080101021F 090100F01F 060F00B440 0000000000 0000000000 0000000000 0000000000`\
0x5A02 – Response contains configuration for heating events with indexes 16-19.\
`0x070100DC1F` – Configuration of heating event with index 16 – from Monday to Friday set target temperature of 22.0°C at 7:01 o'clock.\
`0x080101021F` – Configuration of heating event with index 17 – from Monday to Friday set target temperature of 25.8°C at 8:01 o'clock.\
`0x090100F01F` – Configuration of heating event with index 18 – from Monday to Friday set target temperature of 24.0°C at 9:01 o'clock.\
`0x060F00B440` – Configuration of heating event with index 19 – from Saturday to Sunday set target temperature of 18.0°C at 6:15 o'clock.
{% endtab %}
{% endtabs %}

### Activate/deactivate heating events

In order for a given heating event to be executed regularly it should be marked as activated. **It is automatically set to active when configured via a valid configuration command `0x59`.**&#x20;

An event can be activated/deactivated at any time, this will not erase the event itself (the settings will be preserved for later use).

{% tabs %}
{% tab title="SET" %}

<table><thead><tr><th width="123.48828125"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Hex value / Meaning</strong></td><td><strong>Bit</strong></td></tr><tr><td>0</td><td>6B – command code</td><td></td></tr><tr><td>1</td><td>Event index – 0–19 for configuring of total 20 events.</td><td></td></tr><tr><td>2</td><td>Event state – 1 to activate, 0 to deactivate.</td><td></td></tr></tbody></table>

**Example command 1:** `0x6B0000` – deactivates the heating event at index 0.\
**Example command 2:** `0x6B1001` – activates the heating event at index 16.
{% endtab %}

{% tab title="GET" %}

<table><thead><tr><th width="107.0703125"></th><th width="223.23046875"></th><th></th></tr></thead><tbody><tr><td></td><td><strong>Hex value – Meaning</strong></td><td></td></tr><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>6C – The command code.</td><td>6C – The command code.</td></tr><tr><td>1</td><td></td><td>Reserved</td></tr><tr><td>2</td><td></td><td>State of heating events with indexes from 19 to 16.</td></tr><tr><td>3</td><td></td><td>State of heating events with indexes from 15 to 8.</td></tr><tr><td>4</td><td></td><td>State of heating events with indexes from 7 to 0.</td></tr></tbody></table>

**Example command:** `0x6C`

**Example response:** `0x6C00078003`

`0x07` - events at indexes 18, 17, and 16 are active.

`0x80` – event at index 15 is active.

`0x03` – events at indexed 1 and 0 are active.
{% endtab %}
{% endtabs %}

## Heating season start and end dates

The heating schedule start and end dates are usually the heating season start and end dates. The configured heating events will be executed/repeated throughout that time.&#x20;

{% hint style="warning" %}
To disable the internal heating schedule, simply send the command with either start or end day set to 0.
{% endhint %}

{% hint style="info" %}
Note that because of how commands work (HEX values), the numbers for the months are shifted by 1, where the 1st month (January) corresponds to a value of 0, where February to a value of 1, etc.
{% endhint %}

{% tabs %}
{% tab title="SET" %}

<table><thead><tr><th width="139.2109375"></th><th></th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Hex value / Meaning</strong></td></tr><tr><td>0</td><td>5B – command code</td></tr><tr><td>1</td><td>Starting month – 0–11.</td></tr><tr><td>2</td><td>Starting day – 1–31;<br><strong>0 disables schedule handling.</strong></td></tr><tr><td>3</td><td>End month – 0–11.</td></tr><tr><td>4</td><td>End month day – 1–31;<br><strong>0 disables schedule handling.</strong></td></tr></tbody></table>

**Example command 1:** `0x5B0A010301`

`0x0A01` – Start date is 1<sup>st</sup> of November;\
`0x0301` – End date is 1<sup>st</sup> of April.

**Example command 2:** `0x5B0A000300` – completely disable internal heating schedule handling.
{% endtab %}

{% tab title="GET" %}

<table><thead><tr><th width="109.54296875"></th><th width="219.33984375"></th><th></th></tr></thead><tbody><tr><td></td><td><strong>Hex value – Meaning</strong></td><td></td></tr><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>5C – The command code.</td><td>5C – The command code.</td></tr><tr><td>1</td><td></td><td>Start month – 0–11.</td></tr><tr><td>2</td><td></td><td>Start month day – 1–31.</td></tr><tr><td>3</td><td></td><td>End month – 0–11.</td></tr><tr><td>4</td><td></td><td>End month day – 1–31.</td></tr></tbody></table>

**Example command:** `0x5C`

**Example response:** `0x5C0A010301`

`0x0A01` – Start date is 1<sup>st</sup> of November;

`0x0301` – End date is 1<sup>st</sup> of April.
{% endtab %}
{% endtabs %}

### **Example heating schedule**

{% hint style="success" %}
The whole heating schedule functionality can be configured with single downlink:

`0x5FFD5D6860D6605B060103015900080A01041F5901090A00E61F590206000064605E`

&#x20;

`0x5FFD` - Set time zone UTC-3;

`0x5D68A1CDE9` - Set device date and time;

`0x5B06010301` - Heating schedule will be executed from 1<sup>st</sup> of July to 1<sup>st</sup> of April;

`0x5900080A01041F` - Set heating event 0 – 26.0°C at 8:10 from Monday to Friday;

`0x5901090A00E61F` - Set heating event 1 – 23°C at 9:10 from Monday to Friday.

`0x59020600006460` - Set heating event 2 – 10°C at 6:00 from Saturday to Sunday.

`0x5E` = Get device time to be sure the downlink is received.
{% endhint %}


---

# 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-vicki-lorawan/vicki-lorawan-device-communication-protocol/heating-schedules.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.
