> 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-coacao.md).

# Alarme De Coação

#### O Que é Coação?

A coação refere-se a uma forma de manipulação ou pressão exercida sobre um indivíduo para obter acesso não autorizado a informações ou áreas restritas.

![](https://i.imgur.com/sNtcSZ8.jpg)

### Obter Configuração de Alarme de Coação

Por meio da chamada abaixo é possível obter as configurações de alarme de coação.

#### Requisição - GET

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

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

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

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

### Cadastrar Credencial de Coação

* Para cadastrar um cartão de coação, deve ser utilizado o **CardType** n°5 (Duress card).
* No cadastro de biometria de coação, utilize o **DuressIndex** com o valor Index da biometria de coação.

#### Exemplos

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

```python
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 getConfig(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 Get Config");
        }
    }
}
 
// Example usage:
const deviceConfigManager = new DeviceConfigManager('192.168.1.201', 'admin', 'senha');
const configUrl = 'cgi-bin/configManager.cgi?action=getConfig&name=Duress';
 
deviceConfigManager.getConfig(configUrl)
    .then(response => console.log('Config retrieved successfully:', response))
    .catch(error => console.error('Error getting config:', error));
```

{% 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 getConfig(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 Get Config");
          }
      }
    }
 
    // Example usage:
    const deviceConfigManager = new DeviceConfigManager('192.168.1.201', 'admin', 'senha');
    const configUrl = 'cgi-bin/configManager.cgi?action=getConfig&name=AntiPassback';
 
    deviceConfigManager.getConfig(configUrl)
      .then(response => console.log('Config retrieved successfully:', response))
      .catch(error => console.error('Error getting config:', error));
```

{% endtab %}
{% endtabs %}

## Definir Configuração de Alarme de Coação

Por meio da chamada abaixo é possível definir as configurações de alarme de coação.

O alarme de coação sobrepõe a zona de tempo de acesso.

#### Requisição - GET

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

| 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 set_duress_alarm(self, enable : bool) -> str:
    '''
    Set Duress Alarm Config
    '''
    try:
        url = "http://{}/cgi-bin/configManager.cgi?action=setConfig&Duress.Enable=true&Duress.EventHandler.BeepEnable=true&Duress.EventHandler.BeepTime=900&Duress.EventHandler.AlarmOutTime=60&Duress.EventHandler.AlarmOutEnable=false".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 Duress Alarm Config - ", 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&Duress.Enable=true&Duress.EventHandler.BeepEnable=true&Duress.EventHandler.BeepTime=900&Duress.EventHandler.AlarmOutTime=60&Duress.EventHandler.AlarmOutEnable=false';
 
  deviceConfigManager.setConfig(configUrl)
      .then(response => console.log('Config set successfully:', response))
      .catch(error => console.error('Error setting config:', error));
```

{% endtab %}
{% endtabs %}

### Eventos de Alarme de Coação

Por meio da chamada abaixo é possível ativar ou desativar os eventos de alarme de coação.

O alarme de coação sobrepõe a zona de tempo de acesso.

#### Requisição - GET

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

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

#### 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 set_duress_alarm(self, enable : bool) -> str:
    '''
    Enable/Disable Duress Alarm
    '''
    try:
        url = "http://{}/cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].DuressAlarmEnable={}".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 Duress 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 duressAlarmValue = true; // Replace with the actual value you want
 
const configUrl = `cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].DuressAlarmEnable=${duressAlarmValue}`;
 
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-coacao.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.
