“TypeError: Cannot read properties of undefined (reading ‘includes’)”
i would add export of program but its too large
heres the front few nodes
[
{
"id": "94ae320a7f2aae7a",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "dose",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ph_dose",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "dose",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 260,
"wires": [
[
"edd55a10f9fe46ce"
]
]
},
{
"id": "d7b5efe95dda9d37",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "low",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ph_low",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "low",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 320,
"wires": [
[
"edd55a10f9fe46ce"
]
]
},
{
"id": "33707ea677151864",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "high",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ph_high",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "high",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 380,
"wires": [
[
"edd55a10f9fe46ce"
]
]
},
{
"id": "4c86ba645e6ebcc1",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "warn",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ph_warn",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "warn",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 440,
"wires": [
[
"edd55a10f9fe46ce"
]
]
},
{
"id": "6e3283317d29cb31",
"type": "switch",
"z": "deb79f81e4ba7f60",
"name": "",
"property": "payload.difference",
"propertyType": "msg",
"rules": [
{
"t": "lte",
"v": "3",
"vt": "num"
},
{
"t": "gte",
"v": "4",
"vt": "num"
}
],
"checkall": "true",
"repair": true,
"outputs": 2,
"x": 810,
"y": 520,
"wires": [
[
"4c86ba645e6ebcc1",
"33707ea677151864",
"d7b5efe95dda9d37",
"94ae320a7f2aae7a",
"940b105763c6bf08",
"15ce497af439d2ce",
"b11ad83a55b9a03d",
"e1af138b06734d45",
"37fe55562b751139",
"bfc674c5b5565421",
"d484e054a4155287"
],
[
"f7fb7d61cb77cf44"
]
]
},
{
"id": "d53f7fbbd5c25227",
"type": "function",
"z": "deb79f81e4ba7f60",
"name": "Check Time",
"func": "let lines = msg.payload\nlet dateFromFile = new Date(lines[lines.length - 2].col1).getTime()\nlet dateNow = new Date().getTime()\n\n\n//node.warn(dateFromFile);\n//node.warn(dateNow);\n\nlet difference = (dateNow - dateFromFile) / (1000 * 60) // minutes\n\nmsg.payload = { \n difference : difference,\n col5 : lines[lines.length - 2].col5,\n col4 : lines[lines.length - 2].col4, \n date : new Date().getTime()\n \n }\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 670,
"y": 520,
"wires": [
[
"6e3283317d29cb31"
]
]
},
{
"id": "007da55dfaeefa5b",
"type": "join",
"z": "deb79f81e4ba7f60",
"name": "ph",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 530,
"y": 520,
"wires": [
[
"d53f7fbbd5c25227"
]
]
},
{
"id": "940b105763c6bf08",
"type": "change",
"z": "deb79f81e4ba7f60",
"name": "SMC",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "smc",
"tot": "str"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.col5",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 970,
"y": 500,
"wires": [
[
"edd55a10f9fe46ce"
]
]
},
{
"id": "b11ad83a55b9a03d",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "dose",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ppm_dose",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "dose",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 620,
"wires": [
[
"9e799741d1586fa1"
]
]
},
{
"id": "e1af138b06734d45",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "low",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ppm_low",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "low",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 680,
"wires": [
[
"9e799741d1586fa1"
]
]
},
{
"id": "37fe55562b751139",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "high",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ppm_high",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "high",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 740,
"wires": [
[
"9e799741d1586fa1"
]
]
},
{
"id": "bfc674c5b5565421",
"type": "api-current-state",
"z": "deb79f81e4ba7f60",
"name": "warn",
"server": "a52fadfc.d75d",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.ppm_warn",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
},
{
"property": "topic",
"propertyType": "msg",
"value": "warn",
"valueType": "str"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 970,
"y": 800,
"wires": [
[
"9e799741d1586fa1"
]
]
},
{
"id": "d484e054a4155287",
"type": "change",
"z": "deb79f81e4ba7f60",
"name": "SMC",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "smc2",
"tot": "str"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.col4",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 970,
"y": 860,
"wires": [
[
"9e799741d1586fa1"
]
]
},
{
"id": "15ce497af439d2ce",
"type": "change",
"z": "deb79f81e4ba7f60",
"name": "SMC",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "date",
"tot": "str"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.date",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 970,
"y": 540,
"wires": [
[
"edd55a10f9fe46ce",
"cca161c449f0039f"
]
]
},
{
"id": "e9623b41612ce06e",
"type": "file in",
"z": "deb79f81e4ba7f60",
"name": "file",
"filename": "/config/grogreen.csv",
"filenameType": "str",
"format": "lines",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 270,
"y": 520,
"wires": [
[
"963969060c3a64e5"
]
]
},
{
"id": "ea57bb65e5f106ed",
"type": "inject",
"z": "deb79f81e4ba7f60",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "600",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 520,
"wires": [
[
"e9623b41612ce06e"
]
]
},
{
"id": "963969060c3a64e5",
"type": "csv",
"z": "deb79f81e4ba7f60",
"name": "csv",
"sep": ",",
"hdrin": "",
"hdrout": "none",
"multi": "one",
"ret": "\\n",
"temp": "",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 390,
"y": 520,
"wires": [
[
"007da55dfaeefa5b"
]
]
},
{
"id": "a52fadfc.d75d",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": true,
"heartbeatInterval": "30"
}
]