Uibuilder: How to send data when a client connects or reloads the page

Please note the new page in the uibuilder WIKI that explains how to immediately send data to new clients connecting to the page.

This is great with the new file-based global variables in Node-RED as it is very easy to save the data that you want to have sent to a new client when they connect (or when they reload the page in the browser).

The WIKI entry has an example flow and explains the issue and the resolution.

Combine this with the entry on caching and cache replay as they are related. However, using the new global variable features for retaining variables so they are recovered after a restart reduces the need for caching.

1 Like

I have the problem that MQTT retained messages are received by MQTT IN nodes in Node-Red when a client connects or reloads the page, but this messages are not detected on Uibuilder. Any idea how to refresh MQTT retained messages on Uibuilder when a client connects or reloads?
Many Thanks!

MQTT retained msgs are only resent in Node-RED when it restarts. In order for a uibuilder page reload or new connection to get them, you need to use a cache. There is an example in the library and a couple in the WIKI of how to do this.

Thanks a lot for the info, cheers!

1 Like