Define global variable in homey script to be used in flow

Hi

i have the data i want to use in a variable in homey script defined in:

var data = body2.value
console.log(data)

output:
-4.418066024780273

i have tried using:

global.set(‘myHomeyScriptVariable’, ‘data’);

no errors, but it does not look like the variable is getting created or set.

the plan is to use the variable in a flow to do the rest of the work.

any suggestion’s?

thanks!

In flows we use logic and call the variables tags
See the examples

1 Like

wow that was fast!

i had mixed variables and tags, worked as expected