Bom dia Pessoal.
Estou com problemas em configurar uma automação no node red.
Pretendo que a minha bomba AQS ligue apenas quando tenho excedente de energia (se este se mantiver por 2 minutos, para evitar ligar e desligar constantemente)
Segue abaixo o pretendido, mas não está a funcionar:
[
{
"id": "af8fabd7bd8d8fb2",
"type": "server-state-changed",
"z": "0f96bdfeb8c30bfd",
"name": "Excedente Shelly EM",
"server": "263571d7.8a05ce",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.shelly_em_channel_2_power"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "num",
"ifState": "",
"ifStateType": "str",
"outputOnlyOnStateChange": true,
"for": "",
"forType": "num",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [],
"x": 160,
"y": 120,
"wires": [
[
"576c846cae8761f6",
"e5458b71ae08ea52",
"8b92ab7c5ff4a73a"
]
]
},
{
"id": "576c846cae8761f6",
"type": "switch",
"z": "0f96bdfeb8c30bfd",
"name": "Excedente < -800W ?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "-800",
"vt": "num"
}
],
"checkall": "true",
"outputs": 1,
"x": 430,
"y": 60,
"wires": [
[
"5d857d556bdd831b"
]
]
},
{
"id": "5d857d556bdd831b",
"type": "trigger",
"z": "0f96bdfeb8c30bfd",
"name": "Mantém 2 min",
"op1": "ligar",
"op2": "",
"duration": "2",
"units": "min",
"outputs": 1,
"x": 680,
"y": 60,
"wires": [
[
"07cd447daa8f9d23"
]
]
},
{
"id": "07cd447daa8f9d23",
"type": "api-call-service",
"z": "0f96bdfeb8c30bfd",
"name": "Ligar Bomba AQS",
"server": "263571d7.8a05ce",
"version": 7,
"action": "switch.turn_on",
"entityId": [
"switch.bomba_de_calor"
],
"data": "{}",
"dataType": "jsonata",
"x": 950,
"y": 60,
"wires": [
[]
]
},
{
"id": "e5458b71ae08ea52",
"type": "switch",
"z": "0f96bdfeb8c30bfd",
"name": "Excedente > -300W ?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": "-300",
"vt": "num"
}
],
"checkall": "true",
"outputs": 1,
"x": 440,
"y": 160,
"wires": [
[
"5b81846dde7b31f2"
]
]
},
{
"id": "5b81846dde7b31f2",
"type": "trigger",
"z": "0f96bdfeb8c30bfd",
"name": "Mantém 30s",
"op1": "desligar",
"op2": "",
"duration": "30",
"units": "s",
"outputs": 1,
"x": 690,
"y": 160,
"wires": [
[
"14c20cfc50c4b1b2"
]
]
},
{
"id": "14c20cfc50c4b1b2",
"type": "api-call-service",
"z": "0f96bdfeb8c30bfd",
"name": "Desligar Bomba AQS",
"server": "263571d7.8a05ce",
"version": 7,
"action": "switch.turn_off",
"entityId": [
"switch.bomba_de_calor"
],
"data": "{}",
"dataType": "jsonata",
"x": 930,
"y": 160,
"wires": [
[]
]
},
{
"id": "8b92ab7c5ff4a73a",
"type": "switch",
"z": "0f96bdfeb8c30bfd",
"name": "Excedente < -500W ?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "-500",
"vt": "num"
}
],
"checkall": "true",
"outputs": 1,
"x": 430,
"y": 260,
"wires": [
[
"adc1c6bac4c268df"
]
]
},
{
"id": "adc1c6bac4c268df",
"type": "api-call-service",
"z": "0f96bdfeb8c30bfd",
"name": "Ligar Bomba Retorno",
"server": "263571d7.8a05ce",
"version": 7,
"action": "switch.turn_on",
"entityId": [
"switch.bombaretorno"
],
"data": "{}",
"dataType": "jsonata",
"x": 680,
"y": 260,
"wires": [
[]
]
},
{
"id": "263571d7.8a05ce",
"type": "server",
"name": "Home Assistant",
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "",
"connectionDelay": false,
"cacheJson": false,
"heartbeat": false,
"heartbeatInterval": "",
"statusSeparator": "",
"enableGlobalContextStore": false
},
{
"id": "6a34275d927de98e",
"type": "global-config",
"env": [],
"modules": {
"node-red-contrib-home-assistant-websocket": "0.80.3"
}
}
]
Agradeço ajuda.
Obrigado
