HA - Integração com central de Alarme Intelbras

aparentemente o fluxo de comandos para a amt8000 precisa ser diferente, entao o ideal era definir logo o modelo antes de solicitar o status geral

Eu acho melhor fazer um fluxo separado, somente para a 8000.
Como a central é diferente vai ter que mudar a logica.
Acredito eu que se vc quiser pegar o status das zonas, vc vai ter que logar e depois pedir o stauts.
O login deve expirar em algum momento, então vai ser preciso criar uma logica (que não tem no fluxo) para logar novamente.

Eu faria algo assim.

Um inject enviando o comando de status da central
No function verificaria a resposta da central, se não estiver autenticado faz um loop para autenticar.
Caso seja a resposta correta, manda para os sensores.

Os “change” estão simulando o tcp

[{"id":"710f8d1ff9148fb4","type":"debug","z":"4fcf8d484e65f829","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1050,"y":720,"wires":[]},{"id":"e5f75cea90320262","type":"debug","z":"4fcf8d484e65f829","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1050,"y":760,"wires":[]},{"id":"c9b05239273fe5e9","type":"function","z":"4fcf8d484e65f829","name":"function 49","func":"var ack_aut = Buffer.from([0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xfc]);\nvar ack_model = Buffer.from([0x0a, 0xc2, 0x41, 0x4d, 0x54, 0x20, 0x38, 0x30, 0x30, 0x30, 0x00, 0x47]);\n\nif (Buffer.compare(msg.payload, ack_aut) == 0) {\n    msg.payload = Buffer.from([0x01, 0xc2, 0x3e]);\n\n    return [msg, null, null];// saida 1\n\n} else if (Buffer.compare(msg.payload, ack_model) == 0) {\n    return [null, msg, null];\n\n} else {\n    msg.payload = Buffer.from([0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xf0, 0xf0, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x10, 0x00, 0xe2]);\n    return [null, null, msg];\n\n\n}\n","outputs":3,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":760,"wires":[["710f8d1ff9148fb4","8100eda0f1a57b3a"],["e5f75cea90320262"],["f3de7914cc11c9a3","e460c9cf2372b5b1"]]},{"id":"f3de7914cc11c9a3","type":"debug","z":"4fcf8d484e65f829","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1050,"y":800,"wires":[]},{"id":"e460c9cf2372b5b1","type":"change","z":"4fcf8d484e65f829","name":"Autorizado (TCP)","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\"0x00\",\"0x00\",\"0x00\",\"0x00\",\"0x00\",\"0x03\",\"0xf0\",\"0xf0\",\"0x00\",\"0xfc\"]","tot":"bin"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":920,"wires":[["c9b05239273fe5e9"]]},{"id":"8100eda0f1a57b3a","type":"change","z":"4fcf8d484e65f829","name":"Modelo","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\"0x0a\",\"0xc2\",\"0x41\",\"0x4d\",\"0x54\",\"0x20\",\"0x38\",\"0x30\",\"0x30\",\"0x30\",\"0x00\",\"0x47\"]","tot":"bin"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":980,"wires":[["c9b05239273fe5e9"]]},{"id":"b62c1ef9c641d7fc","type":"inject","z":"4fcf8d484e65f829","name":"Falha Autenticação","props":[{"p":"payload"},{"p":"host","v":"192.168.0.100","vt":"str"},{"p":"port","v":"9009","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"0xff\",\"0x00\",\"0x00\",\"0x00\",\"0x00\",\"0x0b\",\"0xf0\",\"0xf0\",\"0x01\",\"0x01\",\"0x02\",\"0x03\",\"0x04\",\"0x05\",\"0x06\",\"0x10\",\"0x00\",\"0xe2\"]","payloadType":"bin","x":330,"y":1000,"wires":[["c9b05239273fe5e9"]]}]

pra quem quiser add um switch template pra ligar e desligar o alarme esta aqui um modelo:

ALARME INTELBRAS

central_intelbras_amt_4010:
  friendly_name: Central Intelbras AMT 4010
  unique_id: central_intelbras_amt_4010
  icon_template: >-
    {% if is_state('binary_sensor.central_amt_central_ativada', 'off') %}
      mdi:shield-lock
    {% else %}
      mdi:shield-lock-open
    {% endif %}
  value_template: >-
    {% if is_state('binary_sensor.central_amt_central_ativada', 'off') %}
      on
    {% else %}
      off
    {% endif %}
  turn_on:
    service: button.press
    data: {}
    target:
      entity_id: button.central_amt_ativar_amt
  turn_off:
    service: button.press
    data: {}
    target:
      entity_id: button.central_amt_desativar_amt
2 curtidas

lembrando que com esse template é possivel integrar o painel de alarme nativo do home asssitant pra ligar a central intelbras

2 curtidas

Alguém teria a versão de Firmware 5.2 da AMT 4010 Smart para passar ou um local para baixar? Não encontrei no site da Intelbras.

1 curtida

Muito obrigado Walber.

pessoal, alguma novidade com respeito da AMT 8000? alguem ja consiguiu fazer esse node red funcionar?

muito bom garoto! Valeu pela contribuição

Voltei de ferias e vi que o negocio bombou.vou enviar logo uma atualização pra central 2018 smart e uma correção com a senha que tenha inicio 0

1 curtida

Estou usando o Alarm Control Panel Template para criar os painéis nativos do Home Assistant…

image image

A desvantagem que não tem a integração via nodered não identifica apenas a partição que está disparada, por isso tenho que fazer uma lógica pra sinalizar apenas os painéis que estiverem ativos. Mas se ambos estiverem ativos e uma partição disparar, ambos os painéis mostraram disparados no Home Assistant.

Nesse link você pode ver como funciona e o código:

PS: Usei um issue genérico do GitHub porque não consigo incluir vídeos aqui…

1 curtida

pessoal boa noite! mais alguem ai pra ajudar com a integração da AMT 8000!, tenho duas aqui pra testar!

aqui depois que atualizei pra ultima versão do node red, o fluxo parou de se conectar com a central 4010, erro de conexão!

23 Jul 12:30:03 - [AMT] Recuperando Comando Status…
23 Jul 12:30:34 - [info] [server:Home Assistant] Connecting to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connecting to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connecting to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connecting to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connected to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connected to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connected to http://supervisor/core
23 Jul 12:30:34 - [info] [server:Home Assistant] Connected to http://supervisor/core
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 23 Jul 12:30:36 - , _f: undefined, _strict: undefined, _locale: [object Object]
Error:
at Function.createFromInputFallback (/opt/node_modules/moment/moment.js:324:25)
at configFromString (/opt/node_modules/moment/moment.js:2550:19)
at configFromInput (/opt/node_modules/moment/moment.js:2993:13)
at prepareConfig (/opt/node_modules/moment/moment.js:2976:13)
at createFromConfig (/opt/node_modules/moment/moment.js:2943:44)
at createLocalOrUTC (/opt/node_modules/moment/moment.js:3037:16)
at createLocal (/opt/node_modules/moment/moment.js:3041:16)
at hooks (/opt/node_modules/moment/moment.js:16:29)
at Object. (/opt/node_modules/@node-red/util/lib/util.js:713:16)
at applyInner (/opt/node_modules/jsonata/jsonata.js:4951:31)
at applyInner.next ()
at apply (/opt/node_modules/jsonata/jsonata.js:4896:26)
at apply.next ()
at evaluateFunction (/opt/node_modules/jsonata/jsonata.js:4871:30)
at evaluateFunction.next ()
at evaluate (/opt/node_modules/jsonata/jsonata.js:3522:34)
at evaluate.next ()
at evaluateStep (/opt/node_modules/jsonata/jsonata.js:3690:31)
at evaluateStep.next ()
at evaluatePath (/opt/node_modules/jsonata/jsonata.js:3620:46)
at evaluatePath.next ()
at evaluate (/opt/node_modules/jsonata/jsonata.js:3484:34)

Aqui tá normal. O único problema foi que o NR não iniciou automático após a atualização.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 14.4.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2023.7.3
 Home Assistant Supervisor: 2023.07.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
s6-rc: info: service init-nginx successfully started
up to date, audited 2 packages in 2s
found 0 vulnerabilities
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[11:15:49] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js
23 Jul 11:15:53 - [info] 
Welcome to Node-RED
===================
23 Jul 11:15:53 - [info] Node-RED version: v3.0.2
23 Jul 11:15:53 - [info] Node.js  version: v18.17.0
23 Jul 11:15:53 - [info] Linux 6.1.21-v8 arm64 LE
23 Jul 11:15:55 - [info] Loading palette nodes
23 Jul 11:16:01 - [info] Dashboard version 3.5.0 started at /endpoint/ui
23 Jul 11:16:02 - [info] Settings file  : /etc/node-red/config.js
23 Jul 11:16:02 - [info] Context store  : 'default' [module=memory]
23 Jul 11:16:02 - [info] User directory : /config/node-red/
23 Jul 11:16:02 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Jul 11:16:02 - [info] Flows file     : /config/node-red/flows.json
23 Jul 11:16:03 - [info] Server now running at http://127.0.0.1:46836/
23 Jul 11:16:03 - [warn] Encrypted credentials not found
[11:16:03] INFO: Starting NGinx...
23 Jul 11:16:03 - [info] Starting flows
23 Jul 11:16:03 - [info] Started flows
23 Jul 11:16:08 - [info] [server:Home Assistant] Connecting to http://supervisor/core
23 Jul 11:16:08 - [info] [server:Home Assistant] Connected to http://supervisor/core
23 Jul 11:16:10 - [AMT] Recuperando Comando Status...
23 Jul 11:16:10 - [AMT] Caso tenha alterado a senha, apague o arquivo \config\node-red\amt_comandos.txt e reinicie o flow
23 Jul 11:21:12 - [AMT] Comando enviado: Ativar Partição D, ACK: Comando recebido com sucesso
23 Jul 11:21:15 - [AMT] Comando enviado: Ativar Partição C, ACK: Comando recebido com sucesso
23 Jul 12:00:06 - [info] [debug:Aviso desconexão] Central Desconectada
23 Jul 12:23:11 - [AMT] Comando enviado: Desativar Partição D, ACK: Comando recebido com sucesso
23 Jul 12:23:14 - [AMT] Comando enviado: Desativar Partição C, ACK: Comando recebido com sucesso
23 Jul 12:28:49 - [AMT] Comando enviado: Ativar Partição D, ACK: Comando recebido com sucesso
23 Jul 12:28:52 - [AMT] Comando enviado: Ativar Partição C, ACK: Comando recebido com sucesso
23 Jul 12:29:54 - [AMT] Comando enviado: Anular Zonas Abertas, ACK: Comando recebido com sucesso
23 Jul 12:29:57 - [AMT] Comando enviado: Ativar AMT, ACK: Comando recebido com sucesso

Reiniciou o NR?

Meu arquivo amt_comandos esta ficando com esse conteúdo:

‘utf-8’ codec can’t decode byte 0xe9 in position 1: invalid continuation byte‘

Alguma dica?

Na verdade está gravando corretamente, o addon do “File Editor” que da erro ao abrir… está tudo correto!

Minha unica observação é que cai a conexão de vez em quando… mas volta rapidamente.

2 curtidas

Esse erro de conexão é normal. Aparentemente é algo na própria central, que parece bloquear. Outra coisa que impede é entrar no app de configuração da Intelbrás usando a mesma porta do NR

Pessoal, alguem aí teve algum outro progresso com a AMT 8000?