> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/ss-3710-uhf/configuracao-de-alarmes/alarme-de-porta-aberta.md).

# Alarme de Porta Aberta

### Obter Configuração de Alarme de Porta Aberta

Por meio da chamada abaixo é possível obter configurar o alarme de porta esquecida aberta.

#### Requisição - GET

`http://192.168.1.201/cgi-bin/configManager.cgi?action=getConfig&name=DoorNotClosed`

| param              | type   | description               |
| ------------------ | ------ | ------------------------- |
| `getConfig` \*     | String | Comando para Configuração |
| `DoorNotClosed` \* | String | Nome da Configuração      |

#### Exemplo de Retorno - *text/plain*

```sh
table.DoorNotClosed.Enable=true
table.DoorNotClosed.EventHandler.AlarmOutChannels[0]=0
table.DoorNotClosed.EventHandler.AlarmOutEnable=false
table.DoorNotClosed.EventHandler.AlarmOutTime=60
table.DoorNotClosed.EventHandler.BeepEnable=true
table.DoorNotClosed.EventHandler.BeepTime=900

```

#### Exemplos

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

```python
import requests
 
device_ip = '192.168.1.201'
username = 'admin'
password = 'admin12345'
 
def enable_open_door_alarm(self, enable : bool) -> str:
    '''
    Enable/Disable Open Door Alarm
    '''
    try:
        url = "http://{}/cgi-bin/configManager.cgi?action=getConfig&name=DoorNotClosed".format(
                                    str(device_ip) 
                                )
        digest_auth = requests.auth.HTTPDigestAuth(username, passwd)
        rval = requests.get(url, auth=digest_auth, stream=True, timeout=20, verify=False)  # noqa
 
        if rval.status_code != 200:
            raise Exception()
        return str(rval.text)
    except Exception as e:
        raise Exception("ERROR - During Enable or Disable Open Door Alarm Alarm - ", e)
```

{% endtab %}
{% endtabs %}

### Definir Configuração de Alarme de Porta Aberta

Por meio da chamada abaixo é possível definir configurar o alarme de porta esquecida aberta.

Para o funcionamento correto é necessário que o sensor de porta esteja habilitado, consulte as \[configurações de sensor de porta]\(/configuracoes\_porta/alterar\_sensor\_de\_porta).

#### Requisição - GET

`http://192.168.1.201/cgi-bin/configManager.cgi?action=setConfig&DoorNotClosed.EventHandler.BeepEnable=true&DoorNotClosed.EventHandler.BeepTime=900&DoorNotClosed.EventHandler.AlarmOutTime=60&DoorNotClosed.EventHandler.AlarmOutEnable=false&DoorNotClosed.Enable=true`

| param               | type    | description                         |
| ------------------- | ------- | ----------------------------------- |
| `setConfig` \*      | String  | Comando de Obter configuração       |
| `Enable` \*         | Boolean | Habilita/Desabilita Alarme          |
| `BeepEnable` \*     | Boolean | Habilita/Desabilita Alarme Sonoro   |
| `BeepTime` \*       | Boolean | Define o tempo de Alarme Sonoro     |
| `AlarmOutEnable` \* | String  | Habilita/Desabilita saida de alarme |
| `AlarmOutTime` \*   | String  | Define o tempo de Saida de Alarme   |

#### Exemplo de Retorno - *text/plain*

```sh
OK
```

#### Exemplos

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

```python
import requests
 
device_ip = '192.168.1.201'
username = 'admin'
password = 'admin12345'
 
def enable_open_door_alarm(self, enable : bool) -> str:
    '''
    Set Open Door Alarm
    '''
    try:
        url = "http://{}/cgi-bin/configManager.cgi?action=setConfig&DoorNotClosed.EventHandler.BeepEnable=true&DoorNotClosed.EventHandler.BeepTime=900&DoorNotClosed.EventHandler.AlarmOutTime=60&DoorNotClosed.EventHandler.AlarmOutEnable=false&DoorNotClosed.Enable=true".format(
                                    str(device_ip) 
                                )
        digest_auth = requests.auth.HTTPDigestAuth(username, passwd)
        rval = requests.get(url, auth=digest_auth, stream=True, timeout=20, verify=False)  # noqa
 
        if rval.status_code != 200:
            raise Exception()
        return str(rval.text)
    except Exception as e:
        raise Exception("ERROR - During Set Open Door  Alarm - ", e)
```

{% endtab %}

{% tab title="Node" %}

```javascript
const { AxiosDigestAuth } = require('@lukesthl/ts-axios-digest-auth');
 
class DeviceConfigManager {
    constructor(ip, username, password) {
        this.ip = ip;
        this.digestAuthClient = new AxiosDigestAuth({
            username: username,
            password: password,
        });
    }
 
    async setConfig(url) {
        try {
            const fullUrl = `http://${this.ip}/${url}`;
            const result = await this.digestAuthClient.get(fullUrl, {
                timeout: 2000,
            });
 
            if (result.status !== 200) {
                throw new Error();
            }
 
            return result.data;
        } catch (error) {
            throw new Error("ERROR - During Set Config");
        }
    }
}
 
// Example usage:
const deviceConfigManager = new DeviceConfigManager('192.168.1.201', 'admin', 'senha');
const configUrl = 'cgi-bin/configManager.cgi?action=setConfig&DoorNotClosed.EventHandler.BeepEnable=true&DoorNotClosed.EventHandler.BeepTime=900&DoorNotClosed.EventHandler.AlarmOutTime=60&DoorNotClosed.EventHandler.AlarmOutEnable=false&DoorNotClosed.Enable=true';
 
deviceConfigManager.setConfig(configUrl)
    .then(response => console.log('Config set successfully:', response))
    .catch(error => console.error('Error setting config:', error));
```

{% endtab %}
{% endtabs %}

### Configuração de Evento de Alarme de Porta Aberta

Por meio da chamada abaixo é possível ativar ou desativar o alarme de porta aberta.

Para o funcionamento correto é necessário que o sensor de porta esteja habilitado, consulte as \[configurações de sensor de porta]\(/configuracoes\_porta/alterar\_sensor\_de\_porta).

#### Requisição - GET

`http://192.168.1.201/cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].DoorNotClosedAlarmEnable=true`

| param                         | type    | description                                |
| ----------------------------- | ------- | ------------------------------------------ |
| `setConfig` \*                | String  | Comando para Configuração                  |
| `DoorNotClosedAlarmEnable` \* | Boolean | Ativar ou Desativar Alarme de Porta Aberta |

#### Exemplo de Retorno - *text/plain*

```sh
OK
```

#### Exemplos

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

```python
import requests
 
device_ip = '192.168.1.201'
username = 'admin'
password = 'admin12345'
 
def enable_open_door_alarm(self, enable : bool) -> str:
    '''
    Enable/Disable Open Door Alarm
    '''
    try:
        url = "http://{}/cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].DoorNotClosedAlarmEnable={}".format(
                                    str(device_ip),
                                    str(enable) 
                                )
        digest_auth = requests.auth.HTTPDigestAuth(username, passwd)
        rval = requests.get(url, auth=digest_auth, stream=True, timeout=20, verify=False)  # noqa
 
        if rval.status_code != 200:
            raise Exception()
        return str(rval.text)
    except Exception as e:
        raise Exception("ERROR - During Enable or Disable Open Door Alarm Alarm - ", e)
```

{% endtab %}

{% tab title="Node" %}

```javascript
const { AxiosDigestAuth } = require('@lukesthl/ts-axios-digest-auth');
 
class DeviceConfigManager {
    constructor(ip, username, password) {
        this.ip = ip;
        this.digestAuthClient = new AxiosDigestAuth({
            username: username,
            password: password,
        });
    }
 
    async setConfig(url) {
        try {
            const fullUrl = `http://${this.ip}/${url}`;
            const result = await this.digestAuthClient.get(fullUrl, {
                timeout: 2000,
            });
 
            if (result.status !== 200) {
                throw new Error();
            }
 
            return result.data;
        } catch (error) {
            throw new Error("ERROR - During Set Config");
        }
    }
}
 
// Example usage:
const deviceConfigManager = new DeviceConfigManager('192.168.1.201', 'admin', 'senha');
const configUrl = 'cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].DoorNotClosedAlarmEnable=true';
 
deviceConfigManager.setConfig(configUrl)
    .then(response => console.log('Config set successfully:', response))
    .catch(error => console.error('Error setting config:', error));
```

{% endtab %}
{% endtabs %}


---

# 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://portal-integracao.intelbras.com.br/ss-3710-uhf/configuracao-de-alarmes/alarme-de-porta-aberta.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.
