Now() and runScript(script, 5000) errors

What @Kevin.Herron said, don’t do this in runScript. Make a gateway timer event that runs periodically, gets the number of alarms, and writes that to a tag, and then have your clients just read from that tag.

Generally speaking don’t use runScript with any function that has to go out and fetch something like to the db or gateway because while that’s going on the user can’t do anything. Keep it for simple calculations or lookups from a hardcoded dictionary or similar. Avoid system.db/system.alarms/system.tag calls in runScripts.

2 Likes