Haha! Beautiful! I see numbers.
Thank you very much my good man!
Will make a fix for new users
Great job, Martijn!
Iāve looked through the app now, and it works beautifully.
I have an idea for some future releases.
A category in FLOWS tab that shows dependant flows (i.e. the flows to which the other flows reference).
That way, if you are about to implement some crazy s*** something new, you could check beforehand if this is going to mess up some other automations where that particular flow is used. Does that make sense?
I am in the process of bulding my automation after a homey meltdown without a backup, so I donāt have that many flows now. The way I tracked it before was manually in a document (works well if you are religiously filling it) or making a beta flow and seeing what stops to function in a period of a month or so. This would eliminate that.
I donāt know how difficult it actually is to show that, but it looks like you check that in the app already. Itās but an idea to consider. Again - itās a great app as it is! Thank you.
No change unfortunately.
Thanks Martijn. I just wonder what could be possibly wrong, take a look on screenshotsā¦
And one of the flow :
I donāt see any variable brokenā¦tried re-saving, no difference.
Common is ā()ā in the name of variable (defined by the app itself).
1. FIX: settings page issue for new users.
2. FIX: findLogic
@Sharkys made a fix. Can you check if this resolves it?
excellent, thank you ! Old broken flows disappeared, 4 new broken appeared as expected, well done
Nice!
Hi Martijn,
No clue if itās realistic, but is it possible to show an overview of Logics Vars (and BetterLogic maybe) and the flows they reside in?
(I have a script for that (below this message) ).
Or better, a search field āFind the flow(s) used with this variableā.
Enter a (partial) variable name, and it returns the flowname(s).
I donāt know what the impact will be on the memory usage of the app.
(How did I ever do without Flow Checkerā¦ )
Cheers!
// FindLogicsVarsInFlows.js
//
// Script to find Homey Logics Variables in Flows, and orphaned Variables (by RonnyW)
// Adjusted somewhat, when called from a flow, it returns the output in a Variable (PD)
const flows = await Homey.flow.getFlows();
const logicVars = await Homey.logic.getVariables();
let flowMatches;
let varUsed;
let position = [];
let results2Var; // To be able to build a string to output the results to
// a variable [FoundLogicsVarsInFlows], for usage in flows
results2Var = ("*** Logics Variables found in Flows ***\n\n script: FindLogicsVarsInFlows.js\n\n");
for (var iLogicVar in logicVars){
results2Var = results2Var + "\n**VARIABLE:** ["+logicVars[iLogicVar].name + "]\n";
let logicVar = logicVars[iLogicVar].name;
let logicVarId = logicVars[iLogicVar].id;
varUsed = false;
for (var iFlow in flows){
flowMatches = false;
position = [];
// Search for variable name in Triggers
if (flows[iFlow].trigger.uri == "homey:manager:logic"){
for (var iArgs in flows[iFlow].trigger.args){
if ( flows[iFlow].trigger.args[iArgs].name == logicVar
|| flows[iFlow].trigger.args[iArgs].id == logicVarId){
position.push("Trigger card (IF)");
flowMatches = true;
}
}
}
// Search for variable name in Condition cards
for(var iCond in flows[iFlow].conditions){
if ( flows[iFlow].conditions[iCond] &&
flows[iFlow].conditions[iCond].uri == "homey:manager:logic"){
//log(flows[iFlow].conditions[iCond].args);
for (var iArgs in flows[iFlow].conditions[iCond].args){
if ( flows[iFlow].conditions[iCond].args[iArgs].name == logicVar
|| flows[iFlow].conditions[iCond].args[iArgs].id == logicVarId ){
position.push("Condition (AND) - direct reference");
flowMatches = true;
}
}
}
for (var iArgs in flows[iFlow].conditions[iCond].args){
if ( flows[iFlow].conditions[iCond].args[iArgs] &&
JSON.stringify( flows[iFlow].conditions[iCond].args[iArgs] ).indexOf( logicVarId ) > 0 &&
JSON.stringify( flows[iFlow].conditions[iCond].args[iArgs] ).indexOf( "homey:manager:logic" ) > 0 ){
position.push("Condition (AND) - indirect reference (Tag)");
flowMatches = true;
}
}
}
// Search for variable name in Action cards
for(var iAct in flows[iFlow].actions){
if ( flows[iFlow].actions[iAct] &&
flows[iFlow].actions[iAct].uri == "homey:manager:logic"){
for (var iArgs in flows[iFlow].actions[iAct].args){
if ( flows[iFlow].actions[iAct].args[iArgs].name == logicVar
|| flows[iFlow].actions[iAct].args[iArgs].id == logicVarId ){
position.push("Action (THEN) - direct reference");
flowMatches = true;
}
}
}
for (var iArgs in flows[iFlow].actions[iAct].args){
if ( flows[iFlow].actions[iAct].args[iArgs] &&
JSON.stringify( flows[iFlow].actions[iAct].args[iArgs] ).indexOf( logicVarId ) > 0 &&
JSON.stringify( flows[iFlow].actions[iAct].args[iArgs] ).indexOf( "homey:manager:logic" ) > 0 ){
position.push("Action (THEN) - indirect reference (Tag)");
flowMatches = true;
}
}
}
// Results of Flows found:
if (flowMatches == true){
varUsed = true;
results2Var = results2Var + " - ";
results2Var = results2Var + "**Flowname:** (" + flows[iFlow].name + ") \n";
results2Var = results2Var +" -Position: \n";
for (iPos in position){
results2Var = results2Var + " -" +position[iPos] + " / \n";
}
}
}
if (!varUsed){
results2Var = results2Var +"*** NOT FOUND IN FLOWS *** \n\n";
}
}
// Output to a StringVariable [FoundLogicsVarsInFlows]
await tag( "FoundLogicsVarsInFlows", results2Var );
//
// Output (just test to view the result data in 'results2Var')
//console.log(results2Var)
return(true);
Hey @Peter_Kawa
I like the idea
It should be possible. Just thinking what the best place should be for this.
Hi @martijnpoppen,
after the last app update v1.16.2 all the variables used as āvalue storageā are recognized as UNUSED_LOGIC again. The same issue like mentioned in post #295.
Info:
ā Variable Hue_Lesen_Dimm = 1
ā Variable Hue_Lesen_Temp = 0.55
This issue was solved with app v1.16.0.
If itās not fixable or to complicated to fix, I will use ānormalā values in the flows instead of logic variables.
Will have a check @DirkG
Probalby I can fix it but then Iāll @Sharkys too to test. As this seems to conflict with each other
I wasnāt reporting issues with unused variables, it was other way around - until latest Flow check version, it reported something broken, which was not and something not broken, which actually was
Yes exaclty. But thatās on the same line
So itās conflicting in some way
will check!
1. FIX: nested logic
@DirkG can you check?
@Sharkys everything still working?
seems to be ok after upgrade and forcing the check
Hi Martijn,
Because Iām having some problems with my Homey in terms of memory, Iām working with Athom to find out where the problem is.
They indicate that my memory is usually at 200% and that it is most likely due to some apps and flows that run too often etc.
I just wouldnāt know what flows that could be.
Is there an option in flow checker to see how often a certain flow is run and if it consumes too much memory?
All my apps stay well below 30mb of memory so I donāt know where to look for the problem.
Thank you.