> For the complete documentation index, see [llms.txt](https://docs.efento.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.efento.io/nb-iot-loggers/configuration/sensor-specific-settings/motion-occupancy.md).

# Motion / occupancy

Motion / occupancy sensors are used to detect movement or presence of person(s) in the room. The sensor is of the binary type and can have two states:

* **0 (OK)** - no presence detected,
* **1 (ALARM)** - presence detected

## **Configurable parameters**

| Parameter                             | Configuration Options                                                                                                                   |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Movement detection sensitivity**    | <p>1 to 65,535<br><em>(Default: 1)</em></p>                                                                                             |
| **No movement detection sensitivity** | <p>0 to 65,535<br><em>(Default: 0)</em></p>                                                                                             |
| **Movement detection periods**        | <p>1 to 65,535<br><em>(Default: 1)</em></p>                                                                                             |
| **No movement detection periods**     | <p>1 to 65,535<br><em>(Default: 1)</em></p>                                                                                             |
| **Reversed logic**                    | <p><strong>Enabled (ON) / Disabled (OFF)</strong><br><em>(Default: Disabled – 1 represents movement, 0 represents no movement)</em></p> |

A detailed description of all available parameters and their configuration options is provided below.

### **How motion and presence detection works**

It is possible to set the following parameters for this type of sensor:

* **Movement detection sensitivity**- number of movements detected in a measurement period that are required to mark the period of time with the "1" flag (presence detected). Number of movements is compared against this threshold, if the sensor is in the "no presence detected" state (e.g. "if the number of movements detected in a measurement period is larger than 3, mark it as 1").
* **No movement detection sensitivity** - number of movements detected in a measurement period that are required to mark the period of time with the "0" flag (no presence detected). Number of movements is compared against this threshold, if the sensor is in the "presence detected" state (e.g. "if the number of movements detected in a measurement period is lower than 2, mark it as 0").
* **Movement detection periods** - number of the consecutive measurement periods with "1" flag required to change the sensor state to "presence detected" (e.g. "if the number of the consecutive measurement periods with "1" flag is larger than 1, change the sensor state to "presence detected").
* **No movement detection periods** - number of the consecutive measurement periods with "0" flag required to change the sensor state to "no presence detected" (e.g. "if the number of the consecutive measurement periods with "0" flag is larger than 1, change the sensor state to "presence not detected").

The way the sensor works:

1. User defines a measurement interval
2. Sensor counts the number of movements in the measurement period
3. Sensor checks, if the number of movements in the measurement period is over the sensitivity threshold set
4. If the number of the movements is over the sensitivity threshold, sensor marks the period of time with "1" flag (movement detected)
5. If the number of the movements is below the sensitivity threshold, sensor marks the period of time with "0" flag (movement not detected)
6. Sensor checks, if the number of the consecutive measurement periods with "1" or "0" flag is above or below the consecutive measurement periods threshold
7. If the number of the consecutive measurement periods with "1" is over the threshold, sensor will set its state to "1" - presence detected
8. If the number of the consecutive measurement periods with "1" is below the threshold, sensor will not change its state
9. If the number of the consecutive measurement periods with "0" is over the threshold, sensor will set its state to "0" - presence not detected
10. If the number of the consecutive measurement periods with "0" is below the threshold, sensor will not change its state

![](https://content.gitbook.com/content/GPFUI36OraG706yJS7dJ/blobs/wNsVz7KHhxmZSnFXSJrY/Unknown%20image)

### **Configuration examples**

#### **Standard motion detection**

If the sensor shall be used as a regular movement sensor (change its state, if a movement has been detected), use the following settings (defaults):

* Movement detection sensitivity = 1
* No movement detection sensitivity = 0
* Movement detection periods = 1
* No movement detection periods = 1

#### **Presence detection**

All the other settings are used in case of the presence sensor and allow to filter out short movements, that would result in a false positive detection that a room is occupied (e.g. a person opens and closes a conference room door, would result in changing the sensor state to "presence detected") or false-negative detection that a room is not occupied (e.g. a person sits still in a room for a while, would result in changing the sensor state to "presence not detected"). These settings can be adjusted depending on the specification of the room, in which the sensor is used.

#### **Example configuration**

Efento motion sensor configuration:

* Movement detection sensitivity = 10
* No movement detection sensitivity = 0
* Movement detection periods = 1
* No movement detection periods = 2

The five-day measurement results for this configuration are shown in the chart below.

![](https://content.gitbook.com/content/GPFUI36OraG706yJS7dJ/blobs/8keRY4czpHV27xjqeZLP/Unknown%20image)

The device detected movement only between 7:00 and 18:00 - office working hours. At other times, no movement was detected.

### **Reversed logic**

Motion sensor normally signals the detection of the motion by high state which results in sending over Bluetooth / NB-IoT displaying “ALARM” status. Enabling this function will reverse the logic and the motion detection sensor will indicate the status “OK”.

## **Configuration using the Efento mobile application**

All parameters described above can be configured using the Efento mobile application in the **Nearby Devices** section.

Connect to the logger, tap the gear icon, open **Channel settings**, and select **Settings** for the required channel.


---

# 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.efento.io/nb-iot-loggers/configuration/sensor-specific-settings/motion-occupancy.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.
