What to do when Node-RED crashes on start

I had a problem with Node-RED to crash immediately on startup. The root cause was my error in a function node code (probably causing memory overflow), which was executed immediately after Node-RED startup. I could not interact with GUI, as the crash did happen immediately after flows did start. To fix this, I did temporarily … Read more

Using RAM as a storage for your Home Assistant database

By default, Home Assistant saves your sensor history database to /config/home-assistant_v2.db, which is located in your local HDD/SSD/memory card/other media. This is usually most responsible for writes and reads in Home Assistant, as when more and more sensors are added, the local media comes more and more busy. This may cause performance problems or performance … Read more

How to compare multiple JavaScript object properties more efficiently

My comparisons in JavaScript ifs started to look like this: if (obj1.name === ‘apple’ || obj2.name === ‘apple’ || obj3.name === ‘apple’) { //code here } To do this more efficiently, JavaScript array method “includes” can be used to prevent repetition as follows: if ([‘obj1′, obj2’, ‘obj3’].includes(‘apple’) === true) { //code here } First, array … Read more

Debugging Node-RED function nodes

Use the following functions in your Node-RED function node code for debugging: node.log() -> message to consolenode.warn() -> message to console & warning to debug panelnode.error() -> message to console & warning to debug panel Example: node.warn([“Debug message, print my variable”, myVar]);