Node RED GUI Annoying Timeout

Hi.
I have a problem with the Node RED UI.
After a few minutes of non-activity, it seems to time out and restart.
Sometimes debugging sessions involves logging stuff for a long time. That isn’t possible now without logging to a file.
This started happening a few versions ago.
Is there a way to turn off this timeout behaviour?

Hi helgemor

I’m having the same issue I think. I reported it a while ago, but others have it too. The advice I got was to open node red in its own tab instead of trough the Home Assistant UI.

Merijn

The direct link has been timing out on me too. What happens is that browser being the massive resource hogs they used to be have swung completely in the other direction. Inactive pages timeout quickly.

Opening nodered in a serrate browser window helps but still times out. Screen savers too. I was looking at how to stop browsers from throttling and came accross this.

Problem: When a tab is inactive, like you’re on a different tab, or when a window is occluded, i.e. you have another window over top of the browser window, Google chrome will pause or drastically throttle javacript timers. This is annoying, because a lot of web games use javascript timers to run the game loop.

Solution:

go to chrome://flags/ yes, you can type that into URL bar

in the search, type "throttle"

You're going to get 3 options, the two labeled "Throttle Javascript timers in background" and "Calculate window occlusion on Windows", probably set as "default" right now, turn them to "disabled"

bottom right corner, hit relaunch to relaunch chrome with new settings. timers should no longer be throttled when a window is tabbed out or occluded

I haven’t tried this yet but stopping the browser from throttling down tabs is the answer.
Note: If you do disable throttling it’s going to limit how many pages you can have open before taking a performance hit.

1 Like

Thanks for trying, but this didn’t help. Sorry.

Just to be sure we’re on the same page: with direct link; I mean http://homeassistant:1880/#ui instead of http://homeassistant:8123. I this is what you tried, I’m afraid I can’t help you.

Merijn

1 Like

@merijn Sorry. My comment was meant for @Mikefila
I tried your solution as well, but I just got an empty page with only the node red header.
I had to give my credentials, so I got in, somehow.

I was using the link from the supervisor page. This so far looks good, 20 minutes and it didn’t refresh.

Hey guys.
I’m learning node red, I’m pretty basic in programming, but I’ve already managed to do some cool things. I’m trying to do something with my occupancy sensors I have them all over the house.
I created a subflow with two functions, turn the light on and another function turn off the light this worked but now I’m trying to determine a time for the lamps to turn off I’m having a lot of difficulties in the function to turn off the light (turn_of).
It has several conditionals in it, my biggest problem is resetting the time to turn off the lamp when the presence sensor is activated. What I need is this to reset the time to turn off the lamp every time the presence sensor goes on. Can someone help me? That is my funcion turn_off:

const entities = global.get('homeassistant').homeAssistant.states;
var msg1,msg2;
var grupo = env.get("grupo");
var sensor = env.get("sensor");
var tempo = env.get("tempo");
var meutempo = (entities[tempo].state * 1000 * 60)
var setar;




if((msg.payload === "on"))  
        {
        clearTimeout(setar);
        node.send(msg);  //{payload:false}
}

if((msg.payload === "off"))  
        {
if((entities[grupo].state === "on") && (entities[sensor].state === "on") ) 
{            
    setar = setTimeout(function(){
        msg.payload = {
                domain: "light",
                service: "turn_off",
                data: {
                    entity_id: [grupo],
                }
        };
        node.send(msg);
        },
        meutempo);
}
}
return null;

and this is my subflow:

If anyone can help me I would greatly appreciate it.

I think a simple stop timer will accomplish what you need. every time the sensor is active you can send a msg to the stop timer which will start it over.