# Application Operation

## **Operating Modes**

The device has 2 operational modes

* Normal Mode
* Button Override Mode

### Normal Mode

In Normal Mode the Relay outputs are controlled by LoRaWAN downlinks.

### Button Override Mode

In the Override Channel mode the user can control the output of each relay by a button operation on the device.

{% hint style="info" %}
When an override of a channel is detected the State of the relay will change from automatic to manual, which will trigger an uplink event to the LoRaWAN network.
{% endhint %}

## Relay Operation

<figure><img src="/files/5EGC51I3qcf8DnztBS6A" alt=""><figcaption><p>Flowchart Relay Operation</p></figcaption></figure>

The relay channel is operated based on the flowdiagram shown above, both relay channels follow the same flowdiagram.

{% hint style="info" %}
Within this documentation we speak of the relay being **ON** or **OFF** for clarity we define what this means.&#x20;

**Relay ON**, means that there is current running between the terminals **C** and **NO** of the relay. **Relay OFF**, means that there is current running between the terminals **C** and **NC** of the relay.
{% endhint %}

The initial state is activated every time mains power is connected, of when the reset button is pressed. When reaching the initial state the relay will switch to a user programmable “default state” this allows for applications where you want to resume the relay output after a power outage. The LoRaWAN communication watchdog makes it possible to handle LoRaWAN network outages.

The Desired Relay State is determined based on the last change of value to the controller, so the last command received will be the Desired Relay State. After the Normal Mode Desired Relay State is determined, the signal goes through the Button Override Mode followed by the Temperature Check which will determine if the relay can be powered without damaging the PCB, if the temperature check is not in an Alarm State the signal will be send onwards to Physical Relay.

### Default State

The default state is a good mechanism to avoid unwanted activations of the relay for example after a power outage. The last known state of the relay channels are saved in the flash memory of the device, and so is the default state setting. This allows for setting the default state to 3 possible settings;

* **Off**: switch the relay off
* **On**: switch the relay on
* **Retain**: go back to the last known state of the relay

|                           | Address | Default Value | Remarks                                |
| ------------------------- | ------- | ------------- | -------------------------------------- |
| Channel 1 - Default State |         | 0             | <p>0 = Off<br>1 = On<br>2 = Retain</p> |
| Channel 2 - Default State |         | 0             | <p>0 = Off<br>1 = On<br>2 = Retain</p> |

### Communication Watchdog

The communication watchdog is a built-in mechanism to handle LoRaWAN network outages, the watchdog will check if the communication with the LoRaWAN network server is still “alive”. When a communication watchdog alarm occurs the Desired Relay State is set back to the timeout state, the timeout for the watchdog alarm to be given is configurable.

{% hint style="info" %}
The watchdog for communication comes from the LoRaWAN Communication.
{% endhint %}

<table><thead><tr><th width="204"></th><th>Address</th><th>Default Value</th><th width="155">Comment</th><th>R/W</th></tr></thead><tbody><tr><td>Channel 1 State on Communication Watchdog</td><td></td><td>2</td><td>0 = Off<br>1 = On<br>2 = Retain</td><td>R/W</td></tr><tr><td>Channel 2 State on Communication Watchdog</td><td>0x65</td><td>2</td><td>0 = Off<br>1 = On<br>2 = Retain</td><td>R/W</td></tr></tbody></table>

The timeout state setting has 3 possible settings;

* **On**: switch the relay on
* **Off**: switch the relay off
* **Retain**: go back to the last known state of the relay

### Button Override

The button override mode is stored in the flash memory of the device, after a power outage the last known override mode is restored.&#x20;

The override mode can be changed by sending a downlink command, note that the override mode by downlink can only be set to ‘Normal Mode’.

<table><thead><tr><th width="194"></th><th>Address</th><th width="127">Default Value</th><th width="167">Comment</th><th>R/W</th></tr></thead><tbody><tr><td>Override Button Function - Channel 1</td><td></td><td>1</td><td>0 = Disabled<br>1 = Enabled</td><td>R/W</td></tr><tr><td>Button Override Status - Channel 1</td><td></td><td>-</td><td>0 = Normal Mode<br>1 = Manual On<br>2 = Manual Off</td><td>R</td></tr><tr><td>Reset Button Override - Channel 1</td><td></td><td>-</td><td>sent 1 to reset override back to Normal Mode</td><td>W</td></tr><tr><td>Override Button Function - Channel 1</td><td></td><td>1</td><td>0 = Disabled<br>1 = Enabled</td><td>R/W</td></tr><tr><td>Button Override Status - Channel 1</td><td></td><td>-</td><td>0 = Normal Mode<br>1 = Manual On<br>2 = Manual Off</td><td>R</td></tr><tr><td>Reset Button Override - Channel 1</td><td></td><td>-</td><td>sent 1 to reset override back to Normal Mode</td><td>W</td></tr></tbody></table>

### Temperature Protection

The internal circuit of the device is monitored to detect abnormal internal device temperatures. Abnormal temperatures can result from overloading the relay or the internal circuit / busbar etc.

The temperature treshold is fixed at the maximum operating temperature as listed within the technical specifications. If the measures temperature goes above the treshold the relay channels will go **OFF** immediately regardless of the relay state or the manual override.

When the temperature drops 5°C below the maximum operating temperature the device will return to the initial device state.


---

# 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://docs.yobiiq.com/rm200/device/operation/application-operation.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.
