Node-Red Ping node ENOMEM

Hiyas,

I have this complicated node setup for a sleep timer to combat my chromecast keeping my TV on.

I am having trouble with the ping node, I have tried node-red-node-ping and ping advanced. Both give the same out of memory error after some time. Usually a day or so. Would anyone happen to know a solution?

I was trying to use it as a confirmation that the device is actually online as the soniq poll takes a few minutes to fall off wifi and stop being found. It works great as until the ENOMEM starts. Without the ping the device flicks on and off and never actually stays off.

[{"id":"134add8d.27c852","type":"tab","label":"Chromecast ABD","disabled":false,"info":""},{"id":"2692d6bb.b2feba","type":"debug","z":"134add8d.27c852","name":"ping soniq","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":690,"y":420,"wires":[]},{"id":"f92a316e.1f537","type":"trigger-state","z":"134add8d.27c852","name":"Chromecast IR CEC on","server":"d93c6d93.9b465","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"media_player.chromecast_ultra","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"or1wqxt8qhk","targetType":"entity_id","targetValue":"device_tracker.soniq65","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"},{"id":"eej4r9v38bd","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"playing"}],"constraintsmustmatch":"all","outputs":3,"customoutputs":[{"outputId":"gvif3yumwbp","messageType":"payload","messageValue":"{\"Protocol\":\"NEC\",\"Data\":0x4ebbff00,\"Bits\":\"32\"}","messageValueType":"str","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"playing"}],"outputinitially":true,"state_type":"str","x":130,"y":140,"wires":[[],[],["d4121029.c9339","28eeacc.1909254"]]},{"id":"500f5b6.6bfa0a4","type":"trigger-state","z":"134add8d.27c852","name":"PS4 IR on","server":"d93c6d93.9b465","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"media_player.playstation_4","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"y5dvqug013q","targetType":"entity_id","targetValue":"device_tracker.soniq65","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"}],"constraintsmustmatch":"all","outputs":3,"customoutputs":[{"outputId":"31wuxu3f2p1","messageType":"payload","messageValue":"{\"Protocol\":\"NEC\",\"Data\":0x4ebbff00,\"Bits\":\"32\"}","messageValueType":"str","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is_not","comparatorValue":"standby"}],"outputinitially":true,"state_type":"str","x":90,"y":220,"wires":[[],[],["28eeacc.1909254","d4121029.c9339"]]},{"id":"b4e68793.41f438","type":"comment","z":"134add8d.27c852","name":"Info contained","info":"HDMI cec for IR controlled Lounge. \nPowers on TV on Playing of Chromecast or PS4.\nStarts a TV sleep timer on Idle of either unit.\n\nThe state of the TV is tracked by wifi connection so has an inherent delay until it drops off the router. \nChromecast and PS4 are tracked with Hassio.\n\nESP8266 with espeasy v.147 controls IR.\n\nping to block false positives on TV still being on","x":430,"y":100,"wires":[]},{"id":"86246b0f.eeb0e8","type":"debug","z":"134add8d.27c852","name":"status","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":610,"y":580,"wires":[]},{"id":"70aeb888.73eae8","type":"debug","z":"134add8d.27c852","name":"PS4 debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":510,"y":240,"wires":[]},{"id":"17adadc3.365c72","type":"debug","z":"134add8d.27c852","name":"timer debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":890,"y":480,"wires":[]},{"id":"28eeacc.1909254","type":"debug","z":"134add8d.27c852","name":"on debug","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":800,"y":160,"wires":[]},{"id":"f3127fcc.6f522","type":"debug","z":"134add8d.27c852","name":"cancel debug ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1010,"y":260,"wires":[]},{"id":"61b1e120.f867c","type":"api-current-state","z":"134add8d.27c852","name":"cast playing","server":"d93c6d93.9b465","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.chromecast_ultra","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":310,"y":420,"wires":[["a2b4f92b.cd9d28"],[]]},{"id":"a552fc70.3d049","type":"api-current-state","z":"134add8d.27c852","name":"PS4 playing","server":"d93c6d93.9b465","version":1,"outputs":2,"halt_if":"standby","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.playstation_4","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":310,"y":300,"wires":[["70aeb888.73eae8","de686f0a.0b477"],["f8286cb2.5213f","6dfd0319.83318c"]]},{"id":"ec3d8251.d1bd","type":"poll-state","z":"134add8d.27c852","name":"Soniq Poll ","server":"d93c6d93.9b465","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"device_tracker.soniq65","state_type":"str","halt_if":"home","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":80,"y":400,"wires":[["38d686b2.c6646a","86246b0f.eeb0e8"],["86246b0f.eeb0e8"]]},{"id":"d4121029.c9339","type":"mqtt out","z":"134add8d.27c852","name":"TV Power","topic":"cmnd/ESP-ir/IRSEND","qos":"","retain":"","broker":"103e803b.0fbab","x":1020,"y":100,"wires":[]},{"id":"39c97d83.3ab8d2","type":"switch","z":"134add8d.27c852","name":"ping switch","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"false","vt":"jsonata"},{"t":"istype","v":"boolean","vt":"boolean"}],"checkall":"true","repair":false,"outputs":2,"x":110,"y":540,"wires":[["61b1e120.f867c","6e298508.77130c","a552fc70.3d049"],["17adadc3.365c72","a2b4f92b.cd9d28"]]},{"id":"6e298508.77130c","type":"api-current-state","z":"134add8d.27c852","name":"cast paused","server":"d93c6d93.9b465","version":1,"outputs":2,"halt_if":"paused","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.chromecast_ultra","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":310,"y":360,"wires":[["cf24a731.b9c408"],[]]},{"id":"cf24a731.b9c408","type":"change","z":"134add8d.27c852","name":"pause playing","rules":[{"t":"change","p":"payload","pt":"msg","from":"paused","fromt":"str","to":"playing","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":360,"wires":[["a2b4f92b.cd9d28"]]},{"id":"f8286cb2.5213f","type":"change","z":"134add8d.27c852","name":"idle play","rules":[{"t":"change","p":"payload","pt":"msg","from":"idle","fromt":"str","to":"playing","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":300,"wires":[["a2b4f92b.cd9d28"]]},{"id":"a2b4f92b.cd9d28","type":"change","z":"134add8d.27c852","name":"play reset","rules":[{"t":"change","p":"payload","pt":"msg","from":"playing","fromt":"str","to":"reset","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"reset","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"reset","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":420,"wires":[["de686f0a.0b477","2692d6bb.b2feba"]]},{"id":"de686f0a.0b477","type":"delay","z":"134add8d.27c852","name":"","pauseType":"delay","timeout":"601","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":710,"y":340,"wires":[["17adadc3.365c72","92089370.93ecf"]]},{"id":"92089370.93ecf","type":"api-call-service","z":"134add8d.27c852","name":"Soniq ADB off","server":"d93c6d93.9b465","version":1,"debugenabled":true,"service_domain":"androidtv","service":"adb_command","entityId":"media_player.soniq65_abd","data":"{\"command\":\"POWER\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":920,"y":340,"wires":[["f3127fcc.6f522"]]},{"id":"6dfd0319.83318c","type":"change","z":"134add8d.27c852","name":"unknown","rules":[{"t":"change","p":"payload","pt":"msg","from":"unknown","fromt":"str","to":"standby","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":280,"wires":[["de686f0a.0b477"]]},{"id":"eb6acffd.1cdca","type":"inject","z":"134add8d.27c852","name":"IRSEND,nec,4EBB708F,32","topic":"","payload":"{\"Protocol\":\"NEC\",\"Data\":0x4ebbff00,\"Bits\":\"32\"}","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":770,"y":60,"wires":[["d4121029.c9339"]]},{"id":"38d686b2.c6646a","type":"ping","z":"134add8d.27c852","mode":"triggered","name":"ping std enomem","host":"10.0.0.16","timer":"20","inputs":1,"x":140,"y":480,"wires":[["39c97d83.3ab8d2","86246b0f.eeb0e8"]]},{"id":"d93c6d93.9b465","type":"server","z":"","name":"Hasqt","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"103e803b.0fbab","type":"mqtt-broker","z":"","name":"Hasmqtt","broker":"10.0.0.50","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Solved with the removal of the ping node and addition of a device tracker ping in home assistant and polling that instead.