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).
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 someone can help me and sorry if the answer is already existing but I haven’t found the solution yet (or at least not understood it )
Thanks!
Connect your homeyscript card with the logic card to set variables, select the variable in the logic card (add it if necessary in the variables menu at the top) and select the tag #Result as value.
Good morning,
you understood it right, this was what I needed
Thanks!
Now I just have one more problem to solve:
When I check the return value in the script, I get the expected number so I don’t understand why I get this error message. All values of the variables were checked and are correct and only numerical.