Boa tarde.
Estou prestes a desistir do node red, alguém que me restore a fé no sistema! Estou a usar a automação do preço dos combustíveis, e essa tem trabalhado bem.
No entanto, tenho tentado configurar uma automação para abrir cortinas e ligar ar condicionado, baseado em dias úteis, horas certas, temperaturas, cobertura de nuvens, férias ou não e nascer do sol. Não estava a conseguir por o sistema a trabalhar, porque quando o trigger era o nascer do sol, a coisa lá avançava se se cumpriam determinados parâmetros. Mas se o trigger era hora (time range switch), a coisa não marchava. Resolvi usar o node bigtimer. Assim que experimentei, a automação deu mais sinal de vida (os triggers seguintes - temperatura e cobertura de nuvens - começaram a dar info). Mas passados 10s, o node red morreu, e mais nada aconteceu a não ser " 502 Bad Gateway - nginx".
Segue o log do node red:
`
[14:44:16] INFO: Starting Node-RED…
start
node $NODE_OPTIONS node_modules/node-red/red.js “–settings” “/etc/node-red/config.js”
24 Mar 14:44:20 - [info]
Welcome to Node-RED
===================
24 Mar 14:44:20 - [info] Node-RED version: v2.2.2
24 Mar 14:44:20 - [info] Node.js version: v16.14.0
24 Mar 14:44:20 - [info] Linux 5.9.0-arm-64 arm64 LE
24 Mar 14:44:22 - [info] Loading palette nodes
2022/03/24 14:44:29 [error] 581#581: *4445 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: a0d7b954-nodered, request: “GET / HTTP/1.1”, upstream: “http://xxx.x.x.x:xxxxx/”, host: “xxxxxxxx.duckdns.org”, referrer: “https://xxxxxxxx.duckdns.org/a0d7b954_nodered/dashboard”
24 Mar 14:44:29 - [info] Dashboard version 3.1.6 started at /endpoint/ui
24 Mar 14:44:31 - [info] Settings file : /etc/node-red/config.js
24 Mar 14:44:31 - [info] Context store : ‘default’ [module=memory]
24 Mar 14:44:31 - [info] User directory : /config/node-red/
24 Mar 14:44:31 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Mar 14:44:31 - [info] Flows file : /config/node-red/flows.json
24 Mar 14:44:31 - [info] Server now running at http://xxx.0.0.1:46836/
24 Mar 14:44:31 - [info] Starting flows
24 Mar 14:44:33 - [info] Started flows
(node:15610) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 state listeners added to [MySQLNode]. Use emitter.setMaxListeners() to increase limit
(Usenode --trace-warnings ...
to show where the warning was created)
24 Mar 14:44:35 - [error] [api-current-state:Temperatura Interior 16] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:35 - [error] [api-current-state:Temperatura Interior 16] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:35 - [error] [api-current-state:Temperatura Interior 17] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:35 - [error] [api-current-state:Temperatura Interior 17] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:35 - [error] [api-current-state:Temperatura Interior 18] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:35 - [error] [api-current-state:Temperatura Interior 18] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:35 - [red] Uncaught Exception:
24 Mar 14:44:35 - [error] TypeError: Cannot read properties of undefined (reading ‘sendMessagePromise’)
at Websocket.send (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/Websocket.js:405:28)
at DeviceAction.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/device/action-controller.js:26:34)
at DeviceAction.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:411:18)
at /opt/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
at Object.trigger (/opt/node_modules/@node-red/util/lib/hooks.js:166:13)
at deviceNode.Node._emitInput (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
at deviceNode.Node.emit (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
at deviceNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)
at Immediate. (/opt/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
at processImmediate (node:internal/timers:466:21)
[14:44:36] INFO: Starting Node-RED…
start
node $NODE_OPTIONS node_modules/node-red/red.js “–settings” “/etc/node-red/config.js”
24 Mar 14:44:41 - [info]
Welcome to Node-RED
===================
24 Mar 14:44:41 - [info] Node-RED version: v2.2.2
24 Mar 14:44:41 - [info] Node.js version: v16.14.0
24 Mar 14:44:41 - [info] Linux 5.9.0-arm-64 arm64 LE
24 Mar 14:44:43 - [info] Loading palette nodes
24 Mar 14:44:50 - [info] Dashboard version 3.1.6 started at /endpoint/ui
24 Mar 14:44:51 - [info] Settings file : /etc/node-red/config.js
24 Mar 14:44:51 - [info] Context store : ‘default’ [module=memory]
24 Mar 14:44:51 - [info] User directory : /config/node-red/
24 Mar 14:44:51 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Mar 14:44:51 - [info] Flows file : /config/node-red/flows.json
24 Mar 14:44:51 - [info] Server now running at http://xxx.0.0.1:46836/
24 Mar 14:44:52 - [info] Starting flows
24 Mar 14:44:54 - [info] Started flows
(node:15660) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 state listeners added to [MySQLNode]. Use emitter.setMaxListeners() to increase limit
(Usenode --trace-warnings ...
to show where the warning was created)
24 Mar 14:44:55 - [error] [api-current-state:Temperatura Interior 16] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:55 - [error] [api-current-state:Temperatura Interior 16] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:55 - [error] [api-current-state:Temperatura Interior 17] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:55 - [error] [api-current-state:Temperatura Interior 17] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:55 - [error] [api-current-state:Temperatura Interior 18] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:55 - [error] [api-current-state:Temperatura Interior 18] Entity could not be found in cache for entity_id: sensor.sensor_temperatura_e_humidade_temperature
24 Mar 14:44:55 - [red] Uncaught Exception:
24 Mar 14:44:55 - [error] TypeError: Cannot read properties of undefined (reading ‘sendMessagePromise’)
at Websocket.send (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/Websocket.js:405:28)
at DeviceAction.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/device/action-controller.js:26:34)
at DeviceAction.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:411:18)
at /opt/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
at Object.trigger (/opt/node_modules/@node-red/util/lib/hooks.js:166:13)
at deviceNode.Node._emitInput (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
at deviceNode.Node.emit (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
at deviceNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)
at Immediate. (/opt/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
at processImmediate (node:internal/timers:466:21)
[14:44:57] INFO: Starting Node-RED…
start
node $NODE_OPTIONS node_modules/node-red/red.js “–settings” “/etc/node-red/config.js”
24 Mar 14:45:01 - [info]
Welcome to Node-RED
===================
24 Mar 14:45:01 - [info] Node-RED version: v2.2.2
24 Mar 14:45:01 - [info] Node.js version: v16.14.0
24 Mar 14:45:01 - [info] Linux 5.9.0-arm-64 arm64 LE`
No entanto as infos dos preços dos combustíveis continuam a aparecer no home assistant.
Ajuda sff!