After about a week of testing I have disconnected about fifty nodes and waited a few hours to check if the problem was occurring I found these two nodes which when activated give an error.
- They serve respectively to send a warning of voltage too high or low (I have the operator's cabin very close by) .
- Another alert is used to warn via alexa of an overload on the meter to avoid disconnection after a few minutes of overload.
[
{
"id": "849f833ae6e15879",
"type": "comment",
"z": "0420bb4bf87242a2",
"d": true,
"name": "avvisi ed allarmi",
"info": "",
"x": 220,
"y": 1960,
"wires": []
},
{
"id": "738bc12abfce592a",
"type": "switch",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gte",
"v": "250",
"vt": "str"
},
{
"t": "lte",
"v": "200",
"vt": "str"
},
{
"t": "btwn",
"v": "210",
"vt": "num",
"v2": "249",
"v2t": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 710,
"y": 2080,
"wires": [
[
"a340daf1baf7033b"
],
[
"a340daf1baf7033b"
],
[
"d7f3fe2f2d471cb6"
]
]
},
{
"id": "d7f3fe2f2d471cb6",
"type": "change",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 920,
"y": 2120,
"wires": [
[
"a340daf1baf7033b"
]
]
},
{
"id": "a340daf1baf7033b",
"type": "trigger",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"op1": "",
"op2": "0",
"op1type": "pay",
"op2type": "str",
"duration": "0",
"extend": false,
"overrideDelay": false,
"units": "ms",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 920,
"y": 2060,
"wires": [
[
"21dcf73a6769abe5"
]
]
},
{
"id": "21dcf73a6769abe5",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "function 1",
"func": "var msg1 = \"la tensione di casa, ha valori fuori norma, \";\nvar msg2 = msg.payload;\nvar msg3 = \" Ciaone\";\n\n\nreturn [{payload:msg1+msg2+msg3}]\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1080,
"y": 2060,
"wires": [
[
"6d57981c3d2da24a"
]
]
},
{
"id": "5c3a6698c64bc1b5",
"type": "alexa-remote-routine",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"account": "e0d0608560b4720d",
"routineNode": {
"type": "speakAtVolume",
"payload": {
"type": "regular",
"text": {
"type": "msg",
"value": "payload"
},
"volume": {
"type": "num",
"value": "25"
},
"mode": "set",
"devices": [
"18e395e9bf2e4604bad62de8bf305428"
]
}
},
"x": 1490,
"y": 2060,
"wires": [
[]
]
},
{
"id": "4083cf1f3fe2caa1",
"type": "telegram sender",
"z": "0420bb4bf87242a2",
"d": true,
"name": "testdomo",
"bot": "65de0924a6725207",
"haserroroutput": false,
"outputs": 1,
"x": 1420,
"y": 2120,
"wires": [
[]
]
},
{
"id": "60a55c27950726e3",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "function 2",
"func": "var voltage = flow.get(\"voltage\") || 0;\nvoltage = voltage.toString();\n\nvar message = \"tensione fuori norma,la lettura è di \" + voltage + \" volts\";\nmsg.payload = message;\n\nvar msg1 = msg.payload\nmsg.payload = {}\n\nmsg.payload.chatId = \"-1001855120388\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1240,
"y": 2120,
"wires": [
[
"4083cf1f3fe2caa1"
]
]
},
{
"id": "6d57981c3d2da24a",
"type": "time-range-switch",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"lat": "",
"lon": "",
"startTime": "22:00",
"endTime": "7:00",
"startOffset": 0,
"endOffset": 0,
"x": 1230,
"y": 2060,
"wires": [
[],
[
"5c3a6698c64bc1b5",
"60a55c27950726e3"
]
]
},
{
"id": "33e192d3fd034486",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "Read variable(s) for Alexa",
"func": "// Get the flow variable(s) to be used in the message\nvar voltage = flow.get(\"voltage\") || 0;\n\n// Convert them to a string\nvoltage = voltage.toString();\n\n\nvar message = \"la tensione è di <break time='0.5s'/>\"+voltage+ \"volts .<break time='0.25s'/>\";\n\nmsg.payload = message;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 2080,
"wires": [
[
"738bc12abfce592a"
]
]
},
{
"id": "e0befd265a991399",
"type": "inject",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 270,
"y": 2080,
"wires": [
[
"33e192d3fd034486"
]
]
},
{
"id": "3586afff621062f1",
"type": "switch",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gte",
"v": "3750",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 690,
"y": 2280,
"wires": [
[
"8026d55f61107576"
]
]
},
{
"id": "14487cd6b31fb767",
"type": "alexa-remote-routine",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"account": "e0d0608560b4720d",
"routineNode": {
"type": "speakAtVolume",
"payload": {
"type": "regular",
"text": {
"type": "msg",
"value": "payload"
},
"volume": {
"type": "num",
"value": "25"
},
"mode": "set",
"devices": [
"18e395e9bf2e4604bad62de8bf305428"
]
}
},
"x": 1450,
"y": 2220,
"wires": [
[]
]
},
{
"id": "a2de2cca9f04824a",
"type": "telegram sender",
"z": "0420bb4bf87242a2",
"d": true,
"name": "msg to gruppodomo",
"bot": "65de0924a6725207",
"haserroroutput": false,
"outputs": 1,
"x": 1460,
"y": 2320,
"wires": [
[]
]
},
{
"id": "16ae92586ba8dd67",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "function 5",
"func": "var power = flow.get(\"power\") || 0;\npower = power.toString();\n\nvar message = \"sovraccarico,la lettura è di \" + power + \" watts spegnere apparecchio\";\nmsg.payload = message;\n\nvar msg1 = msg.payload\nmsg.payload = {}\n\nmsg.payload.chatId = \"-1001855120388\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1140,
"y": 2320,
"wires": [
[]
]
},
{
"id": "8026d55f61107576",
"type": "time-range-switch",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"lat": "",
"lon": "",
"startTime": "23:59",
"endTime": "6:00",
"startOffset": 0,
"endOffset": 0,
"x": 870,
"y": 2280,
"wires": [
[],
[
"16ae92586ba8dd67",
"bfa80fe7ec7ffb47",
"f3e087cf92f0443d"
]
]
},
{
"id": "cf119dde6c102cd0",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "Read variable(s) for Alexa",
"func": "// Get the flow variable(s) to be used in the message\nvar power = flow.get(\"power\") || 0;\n\n// Convert them to a string\n//power = power.toString();\n\n\n//var message = \"la potenza è di <break time='0.5s'/>\"+power+ \"watts .<break time='0.25s'/>\";\n\nmsg.payload = power;\nreturn msg;\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 2280,
"wires": [
[
"3586afff621062f1"
]
]
},
{
"id": "52785f42c9a8c43a",
"type": "inject",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "30",
"crontab": "",
"once": false,
"onceDelay": "1",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 270,
"y": 2280,
"wires": [
[
"cf119dde6c102cd0"
]
]
},
{
"id": "bfa80fe7ec7ffb47",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "function 6",
"func": "var msg1 = \"avviso di sovraccarico <break time='0.25s'/> spegnere o abbassare apparecchio <break time='0.25s'/> \";\nvar msg2 = msg.payload;\nvar msg3 = \" watts \";\n\n\nreturn [{payload:msg1+msg2+msg3}]\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1140,
"y": 2260,
"wires": [
[
"14487cd6b31fb767",
"f127f1d53de9eb25"
]
]
},
{
"id": "f3e087cf92f0443d",
"type": "function",
"z": "0420bb4bf87242a2",
"d": true,
"name": "function 7",
"func": "var power = flow.get(\"power\") || 0;\npower = power.toString();\n\nvar message = \"sovraccarico,la lettura è di \" + power + \" watts spegnere apparecchio\";\nmsg.payload = message;\n\nvar msg1 = msg.payload\nmsg.payload = {}\n\nmsg.payload.chatId = \"-1001654395886\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1140,
"y": 2380,
"wires": [
[
"11f773a74b83416b"
]
]
},
{
"id": "11f773a74b83416b",
"type": "telegram sender",
"z": "0420bb4bf87242a2",
"d": true,
"name": "msg to Avvisi",
"bot": "c254c8951ae33eec",
"haserroroutput": false,
"outputs": 1,
"x": 1430,
"y": 2380,
"wires": [
[]
]
},
{
"id": "5fa1aa10b7918747",
"type": "comment",
"z": "0420bb4bf87242a2",
"d": true,
"name": "alert sovraccarico",
"info": "",
"x": 380,
"y": 2220,
"wires": []
},
{
"id": "591713b32c85cbce",
"type": "comment",
"z": "0420bb4bf87242a2",
"d": true,
"name": "alert tensione di rete",
"info": "",
"x": 390,
"y": 2020,
"wires": []
},
{
"id": "f127f1d53de9eb25",
"type": "alexa-remote-routine",
"z": "0420bb4bf87242a2",
"d": true,
"name": "",
"account": "e0d0608560b4720d",
"routineNode": {
"type": "speakAtVolume",
"payload": {
"type": "regular",
"text": {
"type": "msg",
"value": "payload"
},
"volume": {
"type": "num",
"value": "40"
},
"mode": "set",
"devices": [
"G091AA10139601L8"
]
}
},
"x": 1450,
"y": 2280,
"wires": [
[]
]
},
{
"id": "4c945cd3f0e80e15",
"type": "mqtt in",
"z": "0420bb4bf87242a2",
"name": "Voltaggio",
"topic": "tele/sensore_energia/SENSOR",
"qos": "2",
"datatype": "json",
"broker": "22f544be.780a3c",
"nl": false,
"rap": false,
"inputs": 0,
"x": 200,
"y": 260,
"wires": [
[
"723fc828f32b513d"
]
]
},
{
"id": "723fc828f32b513d",
"type": "function",
"z": "0420bb4bf87242a2",
"name": "",
"func": "// Save the reading(s) in a flow variable\n\nflow.set(\"voltage\", msg.payload.ENERGY.Voltage);\n\nreturn null;\n",
"outputs": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 260,
"wires": []
},
{
"id": "5d82858f38077a66",
"type": "mqtt in",
"z": "0420bb4bf87242a2",
"name": "sensore potenza",
"topic": "tele/sensore_energia/SENSOR",
"qos": "2",
"datatype": "json",
"broker": "22f544be.780a3c",
"nl": false,
"rap": false,
"inputs": 0,
"x": 220,
"y": 140,
"wires": [
[
"1705132c3f20686c"
]
]
},
{
"id": "1705132c3f20686c",
"type": "function",
"z": "0420bb4bf87242a2",
"name": "",
"func": "// Save the reading(s) in a flow variable\n\nflow.set(\"power\", msg.payload.ENERGY.Power);\n\nreturn null;\n",
"outputs": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 140,
"wires": []
},
{
"id": "e0d0608560b4720d",
"type": "alexa-remote-account",
"name": "alexa",
"authMethod": "proxy",
"proxyOwnIp": "10.0.0.202",
"proxyPort": "3456",
"cookieFile": "/data/authFile.cookie",
"refreshInterval": "1",
"alexaServiceHost": "alexa.amazon.it",
"pushDispatchHost": "",
"amazonPage": "amazon.it",
"acceptLanguage": "it-IT",
"onKeywordInLanguage": "",
"userAgent": "",
"usePushConnection": "on",
"autoInit": "on",
"autoQueryActivityOnTrigger": "on"
},
{
"id": "65de0924a6725207",
"type": "telegram bot",
"botname": "domotest_bot",
"usernames": "test",
"chatids": "",
"baseapiurl": "",
"updatemode": "polling",
"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": "c254c8951ae33eec",
"type": "telegram bot",
"botname": "Avvisi",
"usernames": "test",
"chatids": "",
"baseapiurl": "",
"updatemode": "polling",
"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": "22f544be.780a3c",
"type": "mqtt-broker",
"name": "Mosquitto",
"broker": "10.0.0.202",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"compatmode": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
in the syntax, I cannot see what is causing the error.