There’s only “Execute Code with an Argument and Return a Number”, but I don’t want to use that, because my script can be called by a lot of flows (and if I need to change something, I only need to change one script, not all the “execute code” in all my flows).
What is wrong with the additional tag you can use in the flow? Just connect the HomeyScript card to the card you want to use value in, and select the local tag “result” in there.
Which “result”? There’s no local tag “result”, because there’s now flow card which calls a SCRIPT which returns a local tag.
Only the cards which uses CODE have a return tag. As I have written before, my SCRIPT can be called from a lot of places, I don’t want to copy-paste my SCRIPT into a CODE section of HomeyScript.
Aaah, then I read it wrong my bad.
Indeed, HomeyScript’s Script, is a separate part of the app, the flow can only run the script, that is how it was designed as Advanced Flows didn’t exist back then, changing that would most likely break all those existing codes of people already running scripts.
The code part of the app was added when Advanced flows was introduced for this very reason, so the only option you have is to run it in the Code card, or indeed save it to a logic variable.
The error card only gets triggered when the HS card errors. I don’t see that is gonna use much resources.
I still don’t get what you want to achieve yet. The “resultaat = OK” will never be true now.
Bit late on this (as always) as was looking for potential solution to combine my (exiting) multi-argument input approach (separated by “;” ) and (now needed) returning text-tag(s) out from HomeyScript (not code-card) - comments welcomed
I created test flow (most flex case, normally would not check “false”, but only continue when “true” and error-handling):
Otherwise I am happy, but cannot figure out how I could used “Res1” also to read a-Res1 tag (as now need to run script 1st to create a-Res1 and only then can select it from tag-list…)
Any advice appreciated (trying to avoid Global- and BLL-variables, so not looking for those)