Node-RED Ghost Node

I’m using Node-Red in Home Assistant and have run into the most bizarre bug. I have an active “ghost” node left over from an experimental flow I was designing.

Essentially I was using the timerswitch node to trigger a Tasmota Sensor reading of a Tasmotized Sonoff S31 switch. I was parsing out the Yesterday kWh reading and using an IFTTT trigger to send it to a Google Sheet. The inspiration was from I had the timerswitch triggering every five minutes while I was experimenting and debugging. It worked great and the value was recorded every five minutes.

Fine, now to use it in real life, I deleted the timerswitch and in its place installed the schedex node to trigger once per day. However the flow keeps triggering and recording exactly every five minutes for days now! I searched and found some references from 2018 where a similar thing occurred. So I did what they had done. First I tried to copy the flow to a new tab, and deleted the old tab. No joy. Then I deleted that tab and in a new tab rebuilt the flow without copying anything from the old flow. Still triggers every five minutes! I’ve rebooted and restarted the entire system many times, stopped and started Node-Red, resated the S31 module. Still, every five minutes a reading is triggered.

Has anyone seen that before?

I’ve never seen that before and used node-red for quite some time.

It could be worth trying to find the ‘ghost node’ in the flows.json file and maybe doing a manual removal, but I’d make sure you’ve got a backup of the file pre delete, as I’m not sure what editing this might do to the flows with dependencies/etc… but it’s something I’d certainly try if I was having same issues as you :frowning:

1 Like

Really strange. Today I made sure there were no instances of Home Assistant running on any of my machines except my Debian HA server. Then I disabled the timerswitch node and full rebooted/restarted. No joy. Then I deleted the timerswitch node and rebooted. Nope. I did previously export the flow and examined it for any references to timerswitch or 5 minute intervals. Nothing. Still every 5 minutes I get a trigger sent to IFTTT to insert a row in Google Sheets and record yesterdays kWh from the S31. I guess at this point I’ll recreate the IFTTT recipe to direct to another spreadsheet. But I guess that means that every 5 minutes forever I’ll have a message sent from Home Assistant to IFTTT. I don’t know how to fix that and am open to suggestions!

and to be doubly sure… if you stop node-red, the 5 minute polling stops?

1 Like

That is why these forums are so valuable. I hadn’t tried stopping Node-RED to see if the 5-minute polling stopped with it. I just tried that and the 5-minute polling stops along with Node-RED. So it is some kind of Node-RED artifact.

Yesterday I found this article:
End random “ghost switching” for good by fixing your retain settings in tasmota and home assistant
So I went down that road. I completely reset my S31 to factory defaults, got out the soldering gun and re-Tasmotized it. The 5-minute polling continued.

How many flow tabs do you have? Is it possible that there’s some duplication in one of those causing the 5 minute timer?

1 Like

I tend to keep my flow tabs specific to certain areas (like kitchen, living room) or functions (like ZHA testing, Hue color cycling). So the tab spaces are small and granular. Currently I have 16 active tabs and 6 inactive. The inactives are mostly reference flows I use as component routine libraries.

I don’t think I have artifacts impacting this issue in any of those other tabs. I typically start a Scratchpad flow tab when experimenting with a new flow like this, then copy it into the appropriate area when fully debugged.

In this case I had never used the timerswitch node before, or the IFTTT Trigger node, or the Tasmota Sensor read node. So it was only in one tab which at this point I have deleted and recreated several times with the behavior continuing.

The Google Sheet fills up pretty quick when it gets a row every 5 minutes! It’s maxed out a 2000 rows now so it’s just getting pinged to no effect. I’m still uncomfortable with an artifact pinging through my network every 5 minutes for eternity.

I’ll append the exported flow with my network and IFTTT deets obfuscated in case you or anyone else with more knowledge than I have can spot something strange.

[{“id”:“5b81dacb.b1a954”,“type”:“tab”,“label”:“Flow 2”,“disabled”:false,“info”:""},{“id”:“ad54dc5e.4cf4d”,“type”:“schedex”,“z”:“5b81dacb.b1a954”,“name”:“Update”,“passthroughunhandled”:false,“suspended”:false,“lat”:“40.4992”,“lon”:"-74.4996",“ontime”:“05:01”,“ontopic”:"",“onpayload”:“on”,“onoffset”:0,“onrandomoffset”:0,“offtime”:“05:02”,“offtopic”:"",“offpayload”:“off”,“offoffset”:0,“offrandomoffset”:0,“mon”:true,“tue”:true,“wed”:true,“thu”:true,“fri”:true,“sat”:true,“sun”:true,“x”:190,“y”:280,“wires”:[[“e546835f.56678”,“36a25366.6400ec”]]},{“id”:“f933c2b2.6d0fc”,“type”:“inject”,“z”:“5b81dacb.b1a954”,“name”:“On”,“props”:[{“p”:“payload”}],“repeat”:"",“crontab”:"",“once”:false,“onceDelay”:0.1,“topic”:"",“payload”:“on”,“payloadType”:“str”,“x”:190,“y”:220,“wires”:[[“ad54dc5e.4cf4d”]]},{“id”:“2fe28a01.3070f6”,“type”:“inject”,“z”:“5b81dacb.b1a954”,“name”:“Off”,“props”:[{“p”:“payload”}],“repeat”:"",“crontab”:"",“once”:false,“onceDelay”:0.1,“topic”:"",“payload”:“off”,“payloadType”:“str”,“x”:190,“y”:340,“wires”:[[“ad54dc5e.4cf4d”]]},{“id”:“e546835f.56678”,“type”:“switch”,“z”:“5b81dacb.b1a954”,“name”:“Router”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“on”,“vt”:“str”},{“t”:“eq”,“v”:“off”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:330,“y”:280,“wires”:[[“eb789b94.ff5d48”,“ae861fe5.ebe29”],[“6350c91e.545098”,“59a03ed2.cbd6”]]},{“id”:“eb789b94.ff5d48”,“type”:“Tasmota Sensor”,“z”:“5b81dacb.b1a954”,“broker”:“49430200.b1a6b”,“device”:“Plug_17”,“name”:“Andy PC Yesterday kWh”,“outputs”:1,“uidisabler”:false,“fullTopic”:"",“cmndPrefix”:"",“statPrefix”:"",“telePrefix”:"",“rules”:[“ENERGY.Yesterday”],“x”:530,“y”:240,“wires”:[[“133bc846.4374a8”,“ac9d7362.0e276”]]},{“id”:“6350c91e.545098”,“type”:“Tasmota Sensor”,“z”:“5b81dacb.b1a954”,“broker”:“49430200.b1a6b”,“device”:“Plug_05”,“name”:“SkyEye PC Yesterday kWh”,“outputs”:1,“uidisabler”:false,“fullTopic”:"",“cmndPrefix”:"",“statPrefix”:"",“telePrefix”:"",“rules”:[“ENERGY.Yesterday”],“x”:540,“y”:320,“wires”:[[“c5999b1f.f583d8”,“89cef597.5ef948”]]},{“id”:“6ce062f2.61eeac”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug set value1”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:780,“y”:180,“wires”:[]},{“id”:“77c606c3.b96ae8”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug set value2”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:790,“y”:380,“wires”:[]},{“id”:“133bc846.4374a8”,“type”:“change”,“z”:“5b81dacb.b1a954”,“name”:“set value1”,“rules”:[{“t”:“set”,“p”:“value1”,“pt”:“msg”,“to”:“payload”,“tot”:“msg”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:760,“y”:240,“wires”:[[“6ce062f2.61eeac”,“d8879b8f.fedda8”]]},{“id”:“c5999b1f.f583d8”,“type”:“change”,“z”:“5b81dacb.b1a954”,“name”:“set value2”,“rules”:[{“t”:“set”,“p”:“value2”,“pt”:“msg”,“to”:“payload”,“tot”:“msg”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:761,“y”:320,“wires”:[[“77c606c3.b96ae8”,“d8879b8f.fedda8”]]},{“id”:“d8879b8f.fedda8”,“type”:“ifttt trigger”,“z”:“5b81dacb.b1a954”,“url”:"",“name”:“IFTTT Trigger valuex”,“method”:“POST”,“ret”:“txt”,“event”:“daily_energy_ha”,“secretkey”:“secretkeyremoved”,“val1”:“msg.value1”,“val2”:“msg.value2”,“val3”:"",“x”:940,“y”:280,“wires”:[[]]},{“id”:“ac9d7362.0e276”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug sensor Andy PC”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:790,“y”:140,“wires”:[]},{“id”:“89cef597.5ef948”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug sensor SkyEye PC”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:810,“y”:420,“wires”:[]},{“id”:“ae861fe5.ebe29”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug Router Timer On”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:522,“y”:174,“wires”:[]},{“id”:“59a03ed2.cbd6”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug Router Timer Off”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:510,“y”:380,“wires”:[]},{“id”:“36a25366.6400ec”,“type”:“debug”,“z”:“5b81dacb.b1a954”,“name”:“Debug Timer”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:290,“y”:100,“wires”:[]},{“id”:“49430200.b1a6b”,“type”:“mqtt-broker”,“name”:"",“broker”:“333.333.3.333”,“port”:“1111”,“clientid”:"",“usetls”:false,“compatmode”:false,“keepalive”:“60”,“cleansession”:true,“birthTopic”:"",“birthQos”:“0”,“birthRetain”:“false”,“birthPayload”:"",“closeTopic”:"",“closeQos”:“0”,“closeRetain”:“false”,“closePayload”:"",“willTopic”:"",“willQos”:“0”,“willRetain”:“false”,“willPayload”:""}]

If you look at the code, I do have two S31 plugs that I read and process serially.

which timer switch node are you using?

This one?


Is it not worth killing the timer switch node assuming you’re using something customer and just using the “inject” node with a schedule?

If you are using something custom, you could even uninstall that node!

Yep, I finally deleted that node after removing it from that flow and insuring it wasn’t resident anywhere else. The behavior continued, even after multiple warm and cold boots. Very strange. Thanks for your thinking about it!

Yes, that is the node.

maybe try to uninstall that node completely from the palette

Did you manage to fix this? I’m just really, really curious…no other skin in the game.

Hi Dimitri,
Man that was a long time ago, and I can’t remember specifically how it resolved. The behavior did stop though. I’ll try to look at my notes and see if I can find how it was resolved. Welcome to HA!

I just looked back at a reddit thread I had started on this topic. I could never stop the ghost node from sending out triggers to my IFTTT recipe. So I deleted those recipes and created new ones with different filenames and parameters. For all I know that ghost node is still sending triggers to a non-existent IFTTT recipe…

1 Like

Thanks - sobering stuff! Glad its over.