Galera,
Tenho um servidor proxmox onde tenho instalado o HA e o NodeRed, ambos separados. Estou com um fluxo onde faço a snapshot de uma câmera no HA e depois envio para o Telegram via Node Red, só que quando chega no Nó para ler o snapshot, dar erro, pois o HA e NR são máquinas diferentes, abaixo está meu fluxo, caso alguém possa me ajudar, fico grato.
[
{
"id": "59facbe0d303684e",
"type": "telegram sender",
"z": "33bd0b0e4554971f",
"name": "",
"bot": "f89fe02f9bfaccec",
"haserroroutput": false,
"outputs": 1,
"x": 650,
"y": 500,
"wires": [
[]
]
},
{
"id": "d32b734823a953c9",
"type": "api-call-service",
"z": "33bd0b0e4554971f",
"name": "",
"server": "f0ddc8d1966dbcf6",
"version": 7,
"debugenabled": false,
"action": "camera.snapshot",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"camera.garagem_2_main"
],
"labelId": [],
"data": "{\t \"filename\": \"/config/www/tmp/garagem_2_janela_quarto.jpg\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "camera",
"service": "snapshot",
"x": 810,
"y": 440,
"wires": [
[
"239832b944554fb4"
]
]
},
{
"id": "5fae0d2ca57d095b",
"type": "file in",
"z": "33bd0b0e4554971f",
"name": "Ler Snapshot",
"filename": "/homeassistant/www/tmp/garagem_2_janela_quarto.jpg",
"filenameType": "str",
"format": "",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 270,
"y": 500,
"wires": [
[
"30c4806e3bdeacfd"
]
]
},
{
"id": "30c4806e3bdeacfd",
"type": "function",
"z": "33bd0b0e4554971f",
"name": "Criar Payload",
"func": "// Definir mensagem\nconst gateEmoji = '🪟';\n\n\nconst message = `${gateEmoji} A janela do quarto social foi aberta!!!`;\n\n\nmsg.payload = {\n chatId: \"xxxxxx\",\n type: \"photo\",\n content: msg.filename,\n options: {\n caption: message,\n parse_mode: \"HTML\",\n reply_markup: {}\n }\n};\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 460,
"y": 500,
"wires": [
[
"59facbe0d303684e"
]
]
},
{
"id": "239832b944554fb4",
"type": "delay",
"z": "33bd0b0e4554971f",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 120,
"y": 500,
"wires": [
[
"5fae0d2ca57d095b"
]
]
},
{
"id": "10f73885599fdcad",
"type": "server-state-changed",
"z": "33bd0b0e4554971f",
"name": "Verificar quarto social",
"server": "86154999dfdae5ec",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.janela_quarto_social"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 140,
"y": 440,
"wires": [
[
"7f56e43baf784d21"
],
[]
]
},
{
"id": "7f56e43baf784d21",
"type": "switch",
"z": "33bd0b0e4554971f",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 310,
"y": 440,
"wires": [
[
"a2b0945ab4072d94"
]
]
},
{
"id": "a2b0945ab4072d94",
"type": "api-current-state",
"z": "33bd0b0e4554971f",
"name": "Verificar Alarme",
"server": "f0ddc8d1966dbcf6",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "alarm_control_panel.home_alarm",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 460,
"y": 440,
"wires": [
[
"18815a4913883082"
]
]
},
{
"id": "18815a4913883082",
"type": "switch",
"z": "33bd0b0e4554971f",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "armed_away",
"vt": "str"
},
{
"t": "eq",
"v": "armed_vacation",
"vt": "str"
},
{
"t": "eq",
"v": "armed_custom_bypass",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 610,
"y": 440,
"wires": [
[
"d32b734823a953c9"
],
[
"d32b734823a953c9"
],
[
"d32b734823a953c9"
]
]
},
{
"id": "f89fe02f9bfaccec",
"type": "telegram bot",
"botname": "teste",
"usernames": "",
"chatids": "",
"baseapiurl": "",
"testenvironment": false,
"updatemode": "polling",
"addressfamily": "",
"pollinterval": "300",
"usesocks": false,
"sockshost": "",
"socksprotocol": "socks5",
"socksport": "6667",
"socksusername": "anonymous",
"sockspassword": "",
"bothost": "",
"botpath": "",
"localbotport": "8443",
"publicbotport": "8443",
"privatekey": "",
"certificate": "",
"useselfsignedcertificate": false,
"sslterminated": false,
"verboselogging": false
},
{
"id": "f0ddc8d1966dbcf6",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
},
{
"id": "86154999dfdae5ec",
"type": "server",
"name": "Home Assistant teste",
"version": 5,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
}
]