Strange issue where periodic inject timer stops firing AC control

Bit of a strange issue here.
I have a bunch of DC air cons which are controlled with a simple contactor via SNMP.
I also have a bunch of SNMP read temperature values.

I use a simple SNMP get to grab the current temperature via SNMP, then use a simple switch node to either turn the AC on or off..

It works great, until it doesn't. It just randomly stops working after what seems a few hours.

I was using the default inject node to time this every 30 seconds. Now I'm using contrib-interval.

Both have same results, the temperature controlled AC's work great for a few hours. Then I come back in the morning and the rooms are super hot and the AC's haven't turned on.

Not sure what could be stopping the loops from working, but basically I move a node slightly on the page and re-deploy it all and it immediately works again.

Cheers
Dan

there can be lots of reasons for the flow to stop, usually it is that one of your nodes is having a connect or read/write issue without displaying an error.. pls share your flow

general comments:

  • checking the temperature every 30 seconds is a lot, TEMP does not change that frequent and every request puts unnecessary load on your system
  • you need some debug node or even some LOG mechanism in place to understand where your flow is stopped
  • you mentioned a bunch of DC air cons .. which can be tricky to manage by your system in parallel .. share a flow to understand

my experience:

  • i have several rooms with ceiling fans in my house which I know manage all via NR using climate sensors in each room
  • I had the same issue with unresponsiveness or execution to stop when I had em all in 1 big flow
  • I developed 1 flow with all functionalities for 1 room, than moved this flow in a SUB-Flow
  • This made the flow maintenance much easier and all rooms are now working without issue
  • I dont know why it operates beter (in my case) with the subflows, but I think it does impact the impact the memory and event management

As @xx_Nexus_xx suggests, add debug nodes at each point from the SNMP get onwards to see where it is stopped. For example, is the SNMP get actually fetching a value?

Thanks guys.

These are comms huts. Each hut has its own tab in node-red.
The temp is reporting successfully each time as I've got a debug mode there.
It's like the SNMP write command just doesn't write.
I have a filter after each of the on or off commands so that if the temp is the same it doesn't write.
I'll strip part of the flow out and paste it in shortly.

Cheers
Dan

just a thought ... i had a similar issue where I was writing data-out from parallel tabs and experienced some issues

I changed my flow and defined only 1 OUT-Node where all the traffic was send out.

.. this simplified the debug effort and solved my issue

In your case it would recommend only 1 SNMP OUT node :wink:

Each of the SNMP out nodes are for separate hosts.

Here's a snippet of one of the flows..

[
    {
        "id": "31cb60748e99cbb6",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "446345fc663163a5",
        "type": "interval",
        "z": "31cb60748e99cbb6",
        "name": "interval",
        "interval": "30",
        "onstart": true,
        "msg": "ping",
        "showstatus": true,
        "unit": "seconds",
        "statusformat": "HH:mm:ss",
        "x": 230,
        "y": 260,
        "wires": [
            [
                "ae6a3bc99c3c336b",
                "52028b154f6d2de8"
            ]
        ]
    },
    {
        "id": "52028b154f6d2de8",
        "type": "snmp",
        "z": "31cb60748e99cbb6",
        "host": "1.1.1.1",
        "version": "1",
        "timeout": 5,
        "community": "xxxx",
        "auth": "noAuthNoPriv",
        "authprot": "MD5",
        "privprot": "DES",
        "oids": "1.3.6.1.4.1.38783.3.5.0",
        "name": "Shelter AC Status",
        "x": 530,
        "y": 300,
        "wires": [
            [
                "6920139ff9f3b23a"
            ]
        ]
    },
    {
        "id": "6920139ff9f3b23a",
        "type": "change",
        "z": "31cb60748e99cbb6",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload[0].value",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "Stop",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload[0].value",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "Run",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 300,
        "wires": [
            [
                "3b6f901b64bd5fe5"
            ]
        ]
    },
    {
        "id": "3b6f901b64bd5fe5",
        "type": "ui_text",
        "z": "31cb60748e99cbb6",
        "group": "d3e251457cfa6e3b",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "AC Status",
        "format": "{{msg.payload[0].value}}",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": 16,
        "color": "#000000",
        "x": 900,
        "y": 300,
        "wires": []
    },
    {
        "id": "ae6a3bc99c3c336b",
        "type": "snmp",
        "z": "31cb60748e99cbb6",
        "host": "1.1.1.1",
        "version": "1",
        "timeout": 5,
        "community": "xxxx",
        "auth": "noAuthNoPriv",
        "authprot": "MD5",
        "privprot": "DES",
        "oids": "1.3.6.1.4.1.38783.3.9.0",
        "name": "Shelter Temperature",
        "x": 540,
        "y": 220,
        "wires": [
            [
                "57936a7ea9bc7c12",
                "95522fd97ceef616"
            ]
        ]
    },
    {
        "id": "95522fd97ceef616",
        "type": "change",
        "z": "31cb60748e99cbb6",
        "name": "",
        "rules": [
            {
                "t": "move",
                "p": "payload[0]",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 760,
        "y": 160,
        "wires": [
            [
                "3e9460debea1f281"
            ]
        ]
    },
    {
        "id": "57936a7ea9bc7c12",
        "type": "ui_text",
        "z": "31cb60748e99cbb6",
        "group": "d3e251457cfa6e3b",
        "order": 3,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Temperature",
        "format": "{{msg.payload[0].value/10}}C",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": 16,
        "color": "#000000",
        "x": 890,
        "y": 220,
        "wires": []
    },
    {
        "id": "3e9460debea1f281",
        "type": "calculator",
        "z": "31cb60748e99cbb6",
        "name": "Divide",
        "inputMsgField": "payload.value",
        "outputMsgField": "payload",
        "operation": "div",
        "constant": "10",
        "round": false,
        "truncate": false,
        "decimals": 0,
        "decimals2": 0,
        "x": 990,
        "y": 160,
        "wires": [
            [
                "0a34805dae5838e0"
            ]
        ]
    },
    {
        "id": "0a34805dae5838e0",
        "type": "switch",
        "z": "31cb60748e99cbb6",
        "name": "Air Con Control",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lt",
                "v": "25",
                "vt": "num"
            },
            {
                "t": "gt",
                "v": "28",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 440,
        "y": 480,
        "wires": [
            [
                "9bb2447162ad414c"
            ],
            [
                "cc96ebe4a114fe5e"
            ]
        ]
    },
    {
        "id": "9bb2447162ad414c",
        "type": "change",
        "z": "31cb60748e99cbb6",
        "name": "false",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 610,
        "y": 440,
        "wires": [
            [
                "820cbda4096dd815"
            ]
        ]
    },
    {
        "id": "cc96ebe4a114fe5e",
        "type": "change",
        "z": "31cb60748e99cbb6",
        "name": "true",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 610,
        "y": 520,
        "wires": [
            [
                "f81efa8c467a12a8"
            ]
        ]
    },
    {
        "id": "820cbda4096dd815",
        "type": "rbe",
        "z": "31cb60748e99cbb6",
        "name": "",
        "func": "rbe",
        "gap": "",
        "start": "",
        "inout": "out",
        "septopics": true,
        "property": "payload",
        "topi": "topic",
        "x": 730,
        "y": 440,
        "wires": [
            [
                "ef9b0f0d185e2614",
                "a70b17e3cc66f818"
            ]
        ]
    },
    {
        "id": "f81efa8c467a12a8",
        "type": "rbe",
        "z": "31cb60748e99cbb6",
        "name": "",
        "func": "rbe",
        "gap": "",
        "start": "",
        "inout": "out",
        "septopics": true,
        "property": "payload",
        "topi": "topic",
        "x": 730,
        "y": 520,
        "wires": [
            [
                "7a64998fefadfb88",
                "a70b17e3cc66f818"
            ]
        ]
    },
    {
        "id": "ef9b0f0d185e2614",
        "type": "ui_button",
        "z": "31cb60748e99cbb6",
        "name": "",
        "group": "d3e251457cfa6e3b",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Stop AC",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "false",
        "payloadType": "bool",
        "topic": "payload",
        "topicType": "msg",
        "x": 900,
        "y": 440,
        "wires": [
            [
                "872257a9b3c89825",
                "0a8da850c06893d5"
            ]
        ]
    },
    {
        "id": "7a64998fefadfb88",
        "type": "ui_button",
        "z": "31cb60748e99cbb6",
        "name": "",
        "group": "d3e251457cfa6e3b",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Start AC",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "true",
        "payloadType": "bool",
        "topic": "payload",
        "topicType": "msg",
        "x": 900,
        "y": 520,
        "wires": [
            [
                "aeec22d53169d451",
                "dce22613f6154ab5"
            ]
        ]
    },
    {
        "id": "a70b17e3cc66f818",
        "type": "debug",
        "z": "31cb60748e99cbb6",
        "name": "debug 4",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1100,
        "y": 280,
        "wires": []
    },
    {
        "id": "0a8da850c06893d5",
        "type": "change",
        "z": "31cb60748e99cbb6",
        "name": "Comms Site - AC Stop",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Comms Site - AC Stop",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1100,
        "y": 380,
        "wires": [
            []
        ]
    },
    {
        "id": "872257a9b3c89825",
        "type": "snmp set",
        "z": "31cb60748e99cbb6",
        "host": "1.1.1.1",
        "version": "1",
        "timeout": 5,
        "community": "xxxx",
        "auth": "noAuthNoPriv",
        "authprot": "MD5",
        "privprot": "DES",
        "oids": "",
        "varbinds": "[\n{\n\"oid\": \"1.3.6.1.4.1.38783.3.5.0\",\n\"type\": \"INTEGER\",\n\"value\": 0\n},\n{\n\"oid\": \"1.3.6.1.4.1.38783.3.13.0\",\n\"type\": \"INTEGER\",\n\"value\": 1\n}\n]",
        "name": "STOP AC",
        "x": 1120,
        "y": 440,
        "wires": []
    },
    {
        "id": "aeec22d53169d451",
        "type": "snmp set",
        "z": "31cb60748e99cbb6",
        "host": "1.1.1.1",
        "version": "1",
        "timeout": 5,
        "community": "xxxx",
        "auth": "noAuthNoPriv",
        "authprot": "MD5",
        "privprot": "DES",
        "oids": "",
        "varbinds": "[\n{\n\"oid\": \"1.3.6.1.4.1.38783.3.5.0\",\n\"type\": \"INTEGER\",\n\"value\": 1\n},\n{\n\"oid\": \"1.3.6.1.4.1.38783.3.13.0\",\n\"type\": \"INTEGER\",\n\"value\": 1\n}\n]",
        "name": "START AC",
        "x": 1130,
        "y": 520,
        "wires": []
    },
    {
        "id": "dce22613f6154ab5",
        "type": "change",
        "z": "31cb60748e99cbb6",
        "name": "Comms Site - AC Run",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Comms Site - AC Run",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1100,
        "y": 580,
        "wires": [
            []
        ]
    },
    {
        "id": "d3e251457cfa6e3b",
        "type": "ui_group",
        "name": "Shelter",
        "tab": "5cfc9c6090411944",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "5cfc9c6090411944",
        "type": "ui_tab",
        "name": "Comms Site",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

And a visual representation of it might be easier to follow...

Hi there, unfortunately I do not have the environment to test your flow but looking thru your flow I have a few observations

  1. I think all looks valid upto your IF-Statement for the "Air Con Control" temperature
  2. it does not make sense to set your payload to FALSE and than have a FILTER on payload to eliminate other values
  3. same as 2) but with true values :wink:
  4. Your nodes to write "STOP AC" and "START AC" are in parallel and may cause problems when there are 2 conflicting write commands close to each other. As I do not know the node to write to SNMP it could cause some issues

recommendation:

  • Use only 1 node to write out to SNMP and provide START/STOP as parameter if possible
  • have a debug node directly in front of the SNMP Write node or better do write into a LOG file the START/STOP command along with timestamp for analysis. You have to check the frequency of write command as well the closest time between a START / STOP command
  • I think your SNMP write node has a problem (maybe network connect or timing) .. the flow looks sound besides the minor concerns mentioned in 1-4 :wink:
  • another method to check this is to generate a test-loop switching ON and OFF for X amount of times (maybe 20x) and check if the AC really switched ON/OFF .. you need a delay between ON/OFF command and can adjust the timing to check on the stability of your SNMP Write node

good luck :wink:

Thanks for your suggestions...

The filter node was just to block subsequent messages that were identical so we're not sending off or on twice etc.

Maybe I've wrong that read in the way that's supposed to work.

I don't have any way to check if a write command has worked, other than to read it back in and see if the value has changed. Maybe I'll have to write a bit of a check loop to ensure the commands are being sent.

From what I can see, I have a dashboard that reports current temps and if the AC's are in run or stop, and after a while they just don't start. The temperature of the rooms and the status of the AC's report fine however.

Hi, yes if you cannot verify that the ON/OFF send command was successful you will need to verify if the ON/OFF state was reached

I have the same issue with my RF commands in the house and do the following

  1. Send the command (eg. ON)
  2. have a short delay (maybe 500ms) and send the same command again
  3. than I'm reading the state for a specific time (e.g. 1min) .. no command can be send in this time!
  4. Either the target state (e.g. ON) has been achieved within the time (e.g. 1min)
  5. or the state has not been achieved in this time and the command sequence needs to be repeated
  6. based on your quality of connectivity it might be necessary to repeat steps 1-5 for 2-3 times (or more if necessary)
1 Like

Thanks mate, turns out when I removed the filter node it all started working again.
When I think about it of course it's only going to act once forever as the filter node is telling it to only allow one state. Not what I was thinking at the time when I put it together lol.
I removed the filter nodes and added in a delay and essentially sends the on or off command twice for good measure any way and now it appears to cycle nicely.
Always good to have a second pair of eyes on these things, thanks again.

Cheers
Dan

1 Like

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