when you insert a “Run script” node in a Thingsplex flow, it contains an example code. The header of this code contains several import commands that links to the Futurehome code repo on Github. 2 of these import commands lead to 404 pages:
here comes another potential hint for educated readers. When I try to save the flow containing the Golang script node, I get the following error message in the log:
I’m growing more and more certain that this issue is caused by the environment variable not being set correctly in the Futurehome system. This means no GO scripts would work at all in Thingsplex, which I would consider a major issue. @futurehome, could you please have a look and verify?
I’m asking because I actually want to solve this issue:
Golang node might not be supported by flow engine that is supplied with Futurehome smarthub. It’s supported in open source version of tpflow engine but it has to be run outside of the hub .
That would mean that more sophisticated automations than simple flows are impossible! This would be a showstopper for any advanced use of the hub. Any chance of fixing this? Any other option for using script language on Futurehome?
That is correct , unless FH agrees to accept 3rd party apps to Playground app store . In theory the process is in place but in practice nothing gets through. The open tpflow engine supports golang scripting , python and lua .
As an alternative to my approach, would you know how to read and set the elements of an array, which is a global variable in the Futurehome hub, from a Thingsplex flow?
@Rafal I just updated tpflow to the latest version from futurehome and it can’t reliably load flows in ThingsplexUI . Log inspection shows that the engine reloads all flow periodically due to some crash or something else. Now I’m reverting back to open source version. Maybe there are some bugs but at least it was quite stable and working fine.
@Spielkind Hey, we’re still waiting for the UI to be updated. But in your case, change the exec node import path to: github.com/futurehomeno/tpflow/internal/node/action
This seems to work, so that is a huge step forward. But it is very difficult to find documentation of how to use the go implementation in Futurehome. For example I am not able to use SetVariable as in your example. Nothing happens in the Context part of the Flows page.
Could you please include some info of how to find documentation and possibly update the SetVariable? For info, GetVariable is able to get the home mode in the example, so something is definitely working.
Unfortunately there is not yet any documentation that touches exec node and how to use go code. This is something that will come up later on. But regarding your issue - I just copy&pasted the code to my flow, and it did saved the variable (as flow variable). But to see it, switch from local to global variables and back. As the refresh button does not work every time.