Could you export your flow and attach it to a reply so I could take a look?
Or better yet, could you create a small flow that demonstrates the problem and export and share that one. If you can’t then send the current flow.
Also might I suggest you change your settings.js file to this
contextStorage: {
default : { module: "localfilesystem" },
memory : { module: "memory" }
},
then you only need use
var sensorDevices = global.get("sensorDevices");
global.set("sensorDevices", sensorDevices);
unless you want to temporally save something in memory.
In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```
)
```
code goes here
```
You can edit and correct your post by clicking the pencil icon.
See this post for more details - How to share code or flow json