Warning email alert send multiple warn!(how to send only 1 warn ?)

Hello dear community,

i have developed a warning system for a accelerometer built in phone which data recieved via MQTT.
The problem is the email warning triggered for multiple times.How do i send only 1 warning that is when value is >10 .


my flow


trigger value code


this is email alert, i did try to remove the circled code, but the email still trigger for normal /balanced condition

how do i send only 1 alert when unbalance condition occur (value payload>10)..


email alert that being send multiple times :frowning:

Use a filter(formerly RBE) node, it will ony let messages pass when the configured property changes.

1 Like

can u share a bit details , i mean where can i find that node and which part did i will put it.

for easier look i will share the nodes below

[
    {
        "id": "64915f5c.0a7238",
        "type": "change",
        "z": "df46d25bb9adc247",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "\"X-AXIS,\" & $$.payload.`X-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 520,
        "y": 80,
        "wires": [
            [
                "55a1aba7.7cb53c",
                "8258bfd2.d739a"
            ]
        ]
    },
    {
        "id": "85bcb7f0.7b1cc8",
        "type": "change",
        "z": "df46d25bb9adc247",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "\"Y-AXIS,\" & $$.payload.`Y-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 520,
        "y": 140,
        "wires": [
            [
                "8258bfd2.d739a",
                "a2609af6.5d05b"
            ]
        ]
    },
    {
        "id": "258a1d49.c7bce2",
        "type": "change",
        "z": "df46d25bb9adc247",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "\"Z-AXIS,\" & $$.payload.`Z-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 520,
        "y": 200,
        "wires": [
            [
                "8258bfd2.d739a",
                "90b1a43d.e74fa"
            ]
        ]
    },
    {
        "id": "8258bfd2.d739a",
        "type": "debug",
        "z": "df46d25bb9adc247",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 790,
        "y": 20,
        "wires": []
    },
    {
        "id": "55a1aba7.7cb53c",
        "type": "file",
        "z": "df46d25bb9adc247",
        "name": "",
        "filename": "C:\\Users\\nazme\\OneDrive\\Desktop\\x-axis.csv",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "false",
        "encoding": "utf8",
        "x": 880,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "a2609af6.5d05b",
        "type": "file",
        "z": "df46d25bb9adc247",
        "name": "",
        "filename": "C:\\Users\\nazme\\OneDrive\\Desktop\\y-axis.csv",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "false",
        "encoding": "utf8",
        "x": 880,
        "y": 140,
        "wires": [
            []
        ]
    },
    {
        "id": "90b1a43d.e74fa",
        "type": "file",
        "z": "df46d25bb9adc247",
        "name": "",
        "filename": "C:\\Users\\nazme\\OneDrive\\Desktop\\z-axis.csv",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "false",
        "encoding": "utf8",
        "x": 880,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "3124b708.80021",
        "type": "mqtt in",
        "z": "df46d25bb9adc247",
        "name": "",
        "topic": "SENSE",
        "qos": "0",
        "datatype": "json",
        "broker": "277379c9.ca83a6",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 110,
        "y": 280,
        "wires": [
            [
                "64915f5c.0a7238",
                "85bcb7f0.7b1cc8",
                "258a1d49.c7bce2",
                "387d5149f767379c",
                "e481df87a2125974",
                "6e950eec79376623",
                "3558e8ac8464fd37",
                "dd91f4da10d131e0",
                "689703588ca3ebef"
            ]
        ]
    },
    {
        "id": "3558e8ac8464fd37",
        "type": "change",
        "z": "df46d25bb9adc247",
        "name": "move msg.payload X-AXIS",
        "rules": [
            {
                "t": "move",
                "p": "payload.X-AXIS",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 400,
        "y": 540,
        "wires": [
            [
                "9e07181b9e50b96f"
            ]
        ]
    },
    {
        "id": "dd91f4da10d131e0",
        "type": "change",
        "z": "df46d25bb9adc247",
        "name": "move msg.payload Y-AXIS",
        "rules": [
            {
                "t": "move",
                "p": "payload.Y-AXIS",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 400,
        "y": 600,
        "wires": [
            [
                "a479ab128864b4f8"
            ]
        ]
    },
    {
        "id": "689703588ca3ebef",
        "type": "change",
        "z": "df46d25bb9adc247",
        "name": "move msg.payload Z-AXIS",
        "rules": [
            {
                "t": "move",
                "p": "payload.Z-AXIS",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 400,
        "y": 660,
        "wires": [
            [
                "a7bf2b6c6a65299c",
                "f4f74d416cb457e4"
            ]
        ]
    },
    {
        "id": "387d5149f767379c",
        "type": "ui_gauge",
        "z": "df46d25bb9adc247",
        "name": "",
        "group": "c9187d66c3b99d19",
        "order": 1,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "X-AXIS",
        "label": "m/s2",
        "format": "{{msg.payload[\"X-AXIS\"]}}",
        "min": "-10",
        "max": 10,
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "className": "",
        "x": 440,
        "y": 320,
        "wires": []
    },
    {
        "id": "e481df87a2125974",
        "type": "ui_gauge",
        "z": "df46d25bb9adc247",
        "name": "",
        "group": "31b2f86b9e18b1bf",
        "order": 1,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Y-AXIS",
        "label": "m/s2",
        "format": "{{msg.payload[\"Y-AXIS\"]}}",
        "min": "-10",
        "max": 10,
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "className": "",
        "x": 440,
        "y": 380,
        "wires": []
    },
    {
        "id": "6e950eec79376623",
        "type": "ui_gauge",
        "z": "df46d25bb9adc247",
        "name": "",
        "group": "cdaee5a1552bc622",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Z-AXIS",
        "label": "m/s2",
        "format": "{{msg.payload[\"Z-AXIS\"]}}",
        "min": 0,
        "max": 10,
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "className": "",
        "x": 440,
        "y": 440,
        "wires": []
    },
    {
        "id": "a479ab128864b4f8",
        "type": "ui_chart",
        "z": "df46d25bb9adc247",
        "name": "",
        "group": "a29a2ba8fc256010",
        "order": 0,
        "width": "6",
        "height": "6",
        "label": "Y-AXIS ",
        "chartType": "line",
        "legend": "false",
        "xformat": "HH:mm:ss",
        "interpolate": "linear",
        "nodata": "",
        "dot": false,
        "ymin": "-10",
        "ymax": "10",
        "removeOlder": 1,
        "removeOlderPoints": "",
        "removeOlderUnit": "60",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 640,
        "y": 600,
        "wires": [
            []
        ]
    },
    {
        "id": "a7bf2b6c6a65299c",
        "type": "ui_chart",
        "z": "df46d25bb9adc247",
        "name": "",
        "group": "6a71a459e9092533",
        "order": 0,
        "width": "6",
        "height": "6",
        "label": "Z-AXIS",
        "chartType": "line",
        "legend": "false",
        "xformat": "HH:mm:ss",
        "interpolate": "linear",
        "nodata": "",
        "dot": false,
        "ymin": "-10",
        "ymax": "10",
        "removeOlder": 1,
        "removeOlderPoints": "",
        "removeOlderUnit": "60",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 640,
        "y": 660,
        "wires": [
            []
        ]
    },
    {
        "id": "9e07181b9e50b96f",
        "type": "ui_chart",
        "z": "df46d25bb9adc247",
        "name": "",
        "group": "895685059660d05a",
        "order": 0,
        "width": "6",
        "height": "6",
        "label": "X-AXIS",
        "chartType": "line",
        "legend": "false",
        "xformat": "HH:mm:ss",
        "interpolate": "linear",
        "nodata": "",
        "dot": false,
        "ymin": "-10",
        "ymax": "10",
        "removeOlder": 1,
        "removeOlderPoints": "",
        "removeOlderUnit": "60",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 640,
        "y": 540,
        "wires": [
            []
        ]
    },
    {
        "id": "16437b1fb059e8d7",
        "type": "e-mail",
        "z": "df46d25bb9adc247",
        "server": "smtp.gmail.com",
        "port": "465",
        "secure": true,
        "tls": true,
        "name": "senseitalert@gmail.com",
        "dname": "send emails alert",
        "credentials": {},
        "x": 870,
        "y": 800,
        "wires": []
    },
    {
        "id": "40e21428a7da55cc",
        "type": "function",
        "z": "df46d25bb9adc247",
        "name": "email alert status",
        "func": "var acceleration =msg.payload;\nmsg.to=\"senseitalert@gmail.com\"\nmsg.from=\"noreply@gmail.com\"\n\nvar d =new Date();\nvar message=\"\";\nif(msg.alarm==1)\n{\n    msg.topic =\"Abnormalities condition occur\"\n    message = \"unbalance machine condition = \" ;\n}\nelse\n{\n    msg.topic =\"normal condition\"\n    message = \"balance machine condition = \" ;\n}\nmsg.payload=\"time:\"+d+message+msg.payload;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 670,
        "y": 880,
        "wires": [
            [
                "16437b1fb059e8d7"
            ]
        ]
    },
    {
        "id": "f4f74d416cb457e4",
        "type": "function",
        "z": "df46d25bb9adc247",
        "name": "trigger value",
        "func": "var payload=msg.payload;\nvar alarm_flag=context.get(\"alarm_flag\");\nif(typeof alarm_flag==\"undefined\")\nalarm_flag=false;\n\nif (payload > 10 && !alarm_flag)\n{\n    alarm_flag=true;\n    msg.alarm=1;\n    context.set(\"alarm_flag\",alarm_flag);\n    return msg;\n}\nif (payload <= 10 && alarm_flag)\n{\n    alarm_flag=false;\n    msg.alarm=0;\n    context.set(\"alarm_flag\",alarm_flag);\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 760,
        "wires": [
            [
                "40e21428a7da55cc"
            ]
        ]
    },
    {
        "id": "277379c9.ca83a6",
        "type": "mqtt-broker",
        "name": "",
        "broker": "broker.hivemq.com",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    },
    {
        "id": "c9187d66c3b99d19",
        "type": "ui_group",
        "name": "X-AXIS ACCELERATION",
        "tab": "5736cae9.f98874",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "31b2f86b9e18b1bf",
        "type": "ui_group",
        "name": "Y-AXIS ACCELERATION",
        "tab": "5736cae9.f98874",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "cdaee5a1552bc622",
        "type": "ui_group",
        "name": "Z-AXIS ACCELERATION",
        "tab": "5736cae9.f98874",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "a29a2ba8fc256010",
        "type": "ui_group",
        "name": "Y-AXIS",
        "tab": "7a8514bf75f8bb13",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "6a71a459e9092533",
        "type": "ui_group",
        "name": "Z-AXIS",
        "tab": "7a8514bf75f8bb13",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "895685059660d05a",
        "type": "ui_group",
        "name": "X-AXIS",
        "tab": "7a8514bf75f8bb13",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "5736cae9.f98874",
        "type": "ui_tab",
        "name": "SENSE IT DASHBOARD(GAUGE)",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    },
    {
        "id": "7a8514bf75f8bb13",
        "type": "ui_tab",
        "name": "SENSE IT DASHBOARD(LINECHART)",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

thanks for your time appreciate it

Ctrl-click on the flows pane and start typing filter and the node should appear. If not then you must be using an old version of node-red when it was called rbe, so type that. Then add it to the flow and look at the help text for it.

1 Like

try

[{"id":"689703588ca3ebef","type":"change","z":"c791cbc0.84f648","name":"move msg.payload Z-AXIS","rules":[{"t":"move","p":"payload.Z-AXIS","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":1420,"wires":[["a7bf2b6c6a65299c","f4f74d416cb457e4"]]},{"id":"3124b708.80021","type":"mqtt in","z":"c791cbc0.84f648","name":"","topic":"SENSE","qos":"0","datatype":"json","broker":"277379c9.ca83a6","x":110,"y":1040,"wires":[["64915f5c.0a7238","85bcb7f0.7b1cc8","258a1d49.c7bce2","387d5149f767379c","e481df87a2125974","6e950eec79376623","3558e8ac8464fd37","dd91f4da10d131e0","689703588ca3ebef"]]},{"id":"a7bf2b6c6a65299c","type":"ui_chart","z":"c791cbc0.84f648","name":"","group":"6a71a459e9092533","order":0,"width":"6","height":"6","label":"Z-AXIS","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":640,"y":1420,"wires":[[]]},{"id":"f4f74d416cb457e4","type":"function","z":"c791cbc0.84f648","name":"trigger value","func":"var payload=msg.payload;\nvar alarm_flag=context.get(\"alarm_flag\");\nif(typeof alarm_flag==\"undefined\")\nalarm_flag=false;\n\nif (payload > 10 && !alarm_flag)\n{\n    alarm_flag=true;\n    msg.alarm=1;\n    context.set(\"alarm_flag\",alarm_flag);\n    return msg;\n}\nif (payload <= 10 && alarm_flag)\n{\n    alarm_flag=false;\n    msg.alarm=0;\n    context.set(\"alarm_flag\",alarm_flag);\n    return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":1520,"wires":[["bc342dde.0de5c8"]]},{"id":"64915f5c.0a7238","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"X-AXIS,\" & $$.payload.`X-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":840,"wires":[["55a1aba7.7cb53c","8258bfd2.d739a"]]},{"id":"85bcb7f0.7b1cc8","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Y-AXIS,\" & $$.payload.`Y-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":900,"wires":[["8258bfd2.d739a","a2609af6.5d05b"]]},{"id":"258a1d49.c7bce2","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Z-AXIS,\" & $$.payload.`Z-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":960,"wires":[["8258bfd2.d739a","90b1a43d.e74fa"]]},{"id":"387d5149f767379c","type":"ui_gauge","z":"c791cbc0.84f648","name":"","group":"c9187d66c3b99d19","order":1,"width":0,"height":0,"gtype":"gage","title":"X-AXIS","label":"m/s2","format":"{{msg.payload[\"X-AXIS\"]}}","min":"-10","max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":440,"y":1080,"wires":[]},{"id":"e481df87a2125974","type":"ui_gauge","z":"c791cbc0.84f648","name":"","group":"31b2f86b9e18b1bf","order":1,"width":0,"height":0,"gtype":"gage","title":"Y-AXIS","label":"m/s2","format":"{{msg.payload[\"Y-AXIS\"]}}","min":"-10","max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":440,"y":1140,"wires":[]},{"id":"6e950eec79376623","type":"ui_gauge","z":"c791cbc0.84f648","name":"","group":"cdaee5a1552bc622","order":0,"width":0,"height":0,"gtype":"gage","title":"Z-AXIS","label":"m/s2","format":"{{msg.payload[\"Z-AXIS\"]}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":440,"y":1200,"wires":[]},{"id":"3558e8ac8464fd37","type":"change","z":"c791cbc0.84f648","name":"move msg.payload X-AXIS","rules":[{"t":"move","p":"payload.X-AXIS","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":1300,"wires":[["9e07181b9e50b96f"]]},{"id":"dd91f4da10d131e0","type":"change","z":"c791cbc0.84f648","name":"move msg.payload Y-AXIS","rules":[{"t":"move","p":"payload.Y-AXIS","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":1360,"wires":[["a479ab128864b4f8"]]},{"id":"bc342dde.0de5c8","type":"rbe","z":"c791cbc0.84f648","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"alarm","x":600,"y":1580,"wires":[["40e21428a7da55cc"]]},{"id":"55a1aba7.7cb53c","type":"file","z":"c791cbc0.84f648","name":"","filename":"C:\\Users\\nazme\\OneDrive\\Desktop\\x-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":880,"y":840,"wires":[[]]},{"id":"8258bfd2.d739a","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":780,"wires":[]},{"id":"a2609af6.5d05b","type":"file","z":"c791cbc0.84f648","name":"","filename":"C:\\Users\\nazme\\OneDrive\\Desktop\\y-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":880,"y":900,"wires":[[]]},{"id":"90b1a43d.e74fa","type":"file","z":"c791cbc0.84f648","name":"","filename":"C:\\Users\\nazme\\OneDrive\\Desktop\\z-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":880,"y":960,"wires":[[]]},{"id":"9e07181b9e50b96f","type":"ui_chart","z":"c791cbc0.84f648","name":"","group":"895685059660d05a","order":0,"width":"6","height":"6","label":"X-AXIS","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":640,"y":1300,"wires":[[]]},{"id":"a479ab128864b4f8","type":"ui_chart","z":"c791cbc0.84f648","name":"","group":"a29a2ba8fc256010","order":0,"width":"6","height":"6","label":"Y-AXIS ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":640,"y":1360,"wires":[[]]},{"id":"40e21428a7da55cc","type":"function","z":"c791cbc0.84f648","name":"email alert status","func":"var acceleration =msg.payload;\nmsg.to=\"senseitalert@gmail.com\"\nmsg.from=\"noreply@gmail.com\"\n\nvar d =new Date();\nvar message=\"\";\nif(msg.alarm==1)\n{\n    msg.topic =\"Abnormalities condition occur\"\n    message = \"unbalance machine condition = \" ;\n}\nelse\n{\n    msg.topic =\"normal condition\"\n    message = \"balance machine condition = \" ;\n}\nmsg.payload=\"time:\"+d+message+msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1640,"wires":[["16437b1fb059e8d7"]]},{"id":"16437b1fb059e8d7","type":"e-mail","z":"c791cbc0.84f648","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"senseitalert@gmail.com","dname":"send emails alert","credentials":{},"x":870,"y":1560,"wires":[]},{"id":"277379c9.ca83a6","type":"mqtt-broker","name":"","broker":"broker.hivemq.com","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"6a71a459e9092533","type":"ui_group","name":"Z-AXIS","tab":"7a8514bf75f8bb13","order":3,"disp":true,"width":"6","collapse":false},{"id":"c9187d66c3b99d19","type":"ui_group","name":"X-AXIS ACCELERATION","tab":"5736cae9.f98874","order":1,"disp":true,"width":"6","collapse":false},{"id":"31b2f86b9e18b1bf","type":"ui_group","name":"Y-AXIS ACCELERATION","tab":"5736cae9.f98874","order":2,"disp":true,"width":"6","collapse":false},{"id":"cdaee5a1552bc622","type":"ui_group","name":"Z-AXIS ACCELERATION","tab":"5736cae9.f98874","order":3,"disp":true,"width":"6","collapse":false},{"id":"895685059660d05a","type":"ui_group","name":"X-AXIS","tab":"7a8514bf75f8bb13","order":1,"disp":true,"width":"6","collapse":false},{"id":"a29a2ba8fc256010","type":"ui_group","name":"Y-AXIS","tab":"7a8514bf75f8bb13","order":2,"disp":true,"width":"6","collapse":false},{"id":"7a8514bf75f8bb13","type":"ui_tab","name":"SENSE IT DASHBOARD(LINECHART)","icon":"dashboard","disabled":false,"hidden":false},{"id":"5736cae9.f98874","type":"ui_tab","name":"SENSE IT DASHBOARD(GAUGE)","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

i did try the nodes but the result as shown in image..somehow it still sends multiple warning

i did change the code only to send abnormal conditions

but it still send like 2-3 email every time the abnormal condition triggered

Check, using a debug node, what the message looks like before the filter node. If the messages are different then the filter will not block them.

1 Like

i see , i did change the filter node position, and it did work ,sends the email only once :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.