Ik heb zelf geen ervaring met HomeyScript, maar heb deze vraag vaker langs zien komen. Ik raad je aan om even te zoeken op het forum. In ieder geval kwam ik de volgende gerelateerde topics tegen:
Hi,
I’m trying to set a boolean variable from a script, that should be then used in flows.
I understood that I am supposed to set a tag and not a global variable.
So looking at examples i put:
await tag(‘aria_inquinata’, aria_inquinata);
return("aria inquinata: "+aria_inquinata);
The script returns the value, but the variable is not appearing under “variables” in the app and I can’t use it to trigger a flow. It does appear under the tags that can be selected in the “and” part.
If I create…
Hello,
I would like to use the value returned by the function as variable so I can use this one further in the Flows.
I don’t know how to register this value in a variable (not in homeyscript nor in Flow).
[image]
function solarangle(azimuth,altitude){
var teta=90-altitude;
var beta = 90 - Math.atan(Math.tan(teta*Math.PI/180)*Math.sin((azimuth-167)*Math.PI/180))*180/Math.PI;
return beta;
}
So I would like to get the value of “beta” in an existing variable to use in Flow.
I hope that so…