I am using openHAB 3.4.1 and have a problem with the JS function setTimeout. I’ve created a minimal example:
function greet(name, lastName) {
console.log("Hello " + name + " " + lastName + "!");
}
setTimeout(greet, 1000, "John", "Doe");
Taking a look at the logs, the variables name and lastName are undefined within the greet function triggered by the timer. Can someone reproduce this? Or do I have a problem within my JS code?
Thank you for that solution, I just ran into the same issue. The original approach (ie setTimeout(function, timer, parameter)) used to work in 3.3, but following the upgrade to 3.4 was throwing errors for me.