Testing ideas for rain window warning in Node-RED

home_automation/Home-Assistant-Configs#247
This commit is contained in:
2025-05-23 21:25:16 -04:00
parent 8a969c09fd
commit 688f806c5c

View File

@ -33489,6 +33489,207 @@
[]
]
},
{
"id": "f29d1570059ecc92",
"type": "server-state-changed",
"z": "ebd5561c4f077718",
"name": "Precipitation Type",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.home_tempest_precipitation_type"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "precip_type",
"valueType": "str"
},
{
"property": "local",
"propertyType": "msg",
"value": "true",
"valueType": "bool"
}
],
"x": 250,
"y": 1180,
"wires": [
[]
]
},
{
"id": "f73f117b33aa309d",
"type": "server-state-changed",
"z": "ebd5561c4f077718",
"name": "Precipitation Intensity",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"sensor.home_tempest_cloud_sensors_precipitation_intensity"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "precip_intensity",
"valueType": "str"
},
{
"property": "local",
"propertyType": "msg",
"value": "false",
"valueType": "bool"
}
],
"x": 240,
"y": 1240,
"wires": [
[]
]
},
{
"id": "1d01ca915d4759ec",
"type": "function",
"z": "ebd5561c4f077718",
"name": "Processing",
"func": "\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "const states = global.get('homeassistant.homeAssistant.states')\nconst precipType = states['sensor.home_tempest_precipitation_type'].state\nconst precipIntensity = states['sensor.home_tempest_cloud_sensors_precipitation_intensity'].state\n\nconst typeStatesRaining = ['rain','hail','rain_hail']\nconst intensityStatesRaining = ['very_light','light','moderate','heavy','very_heavy','extreme']\n\nconst isTypeRaining = typeStatesRaining.includes(precipType)\nconst isIntensityRaining = intensityStatesRaining.includes(precipIntensity)\n\nconst isRaining = isTypeRaining || isIntensityRaining\n\nflow.set('typeStatesRaining', typeStatesRaining)\nflow.set('intensityStatesRaining', intensityStatesRaining)\nflow.set('isRaining', isRaining)\n\nreturn null",
"finalize": "",
"libs": [],
"x": 610,
"y": 1180,
"wires": [
[]
]
},
{
"id": "82d975bc07cc9d37",
"type": "context-monitor",
"z": "ebd5561c4f077718",
"name": "",
"monitoring": [
{
"scope": "flow",
"flow": ".",
"node": "7fc67fc156c0f4be",
"key": "test"
}
],
"tostatus": false,
"x": 470,
"y": 1300,
"wires": [
[
"cc522baf847df753"
],
[
"e3e3313d0d169d31"
]
]
},
{
"id": "cc522baf847df753",
"type": "debug",
"z": "ebd5561c4f077718",
"name": "Context Monitor 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 1260,
"wires": []
},
{
"id": "e3e3313d0d169d31",
"type": "debug",
"z": "ebd5561c4f077718",
"name": "Context Monitor 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 1340,
"wires": []
},
{
"id": "1f7af146c06b8b85",
"type": "ha-select",