Getting Started - Logic variables

I am building a ArrayAdapter for this precicly in HOOP.

Sounds good @Arie_J_Godschalk, but what is HOOP?

@zakraket Glad 2 hear you discovered the magic yourself.
I also didn’t get it at first🙃, but the THEN action card explains what do do

And how nice! The new testversion let’s you also calc trends live! No flows needed. Handy for troubleshooting
https://homey.app/nl-nl/app/ch.philippewechsler.trends/Insight-Trends/test/

Tag “Average” value:

Here r my 2 example flows:

As u can see, you can use calculated tag(s) for further use.
Or did you mean someting else to re-use the tagvalue with:

{“When you use calulate Trend in the AND section you can’t use the outcome in the THEN
f.e. IF trigger AND calculate Trend average > 0 then set Var to Average
Outcome is not available as a tag, which might be a shame.”}

H.O.O.P. (Hope) - Homey Object Oriented Programming - Apps - Homey Community Forum (athom.com)

1 Like

Yes, I’ve been playing with it for a few things now.

I have one flow that calculates several trends
IF every minute
AND…
THEN
calculate trend temperature
calculate trend humidity
calculate trend sunpower (from solarpanels)
etc

Now I can create separate flows for each calculated trigger
IF temperature trend calculated THEN f.e. put in var (for later use)
IF humidity trend calculated AND value<x THEN f.e. push to user

But I think the use of
IF trigger AND calculated Trend < value THEN something
is limiting since the AND calculated trend is not available later on. It would be better if it was put into a tag (but maybe that’s just too difficult to build or whatever)

At least I now have real trendvalues to work with instead of values that go up and down and are not suitable for proper decisions.

In your example you don’t need the Start Flow 2 in flow 1 :slight_smile:

1 Like

So nice to hear this works for you!

I’ve created a logic NUM var:

With this flow I store the calculated value to the ‘Insights_Average_Saved’ var:

Outputted values:

Edit I see now​:laughing: Flow 2 gets triggered when the calculation has finished. Didn’t get that at first :upside_down_face:
(Orig: While I’m just testing, it seemed handy for me to start flow 2 with flow 1, and then get my calculated value as in “real life”)

Very very interesting Arie. I never got it why flows can’t be set up Macrodroid-wise, but u r going the right direction with H.O.O.P.

Thanks, almost ready for release to HCS. Its been tested and fixed, and allready has more then i currently have written on the topics.

1 Like

yes, but it requires an extra flow. I have also set it up this way. But never mind, at least it works!

Btw what’s this screenshot? Is this the app? I don’t have this

As I wrote: The new testversion (of the app) let’s you also calc trends live, no flows needed. Handy for troubleshooting.
Go to More>Apps>Insights Trends and hit “Configure app”
Link to testversion:
https://homey.app/nl-nl/app/ch.philippewechsler.trends/Insight-Trends/test/

Sorry, missed this between the screenshots , tnx

I wasn’t gonna call you names, yet :wink: :wink: :wink:

How did you figure out the day in order to put the day name in a variable?

I’m not sure to what you’re referring to. Can you quote that pls?

How did you calculate which day it is in order to put the name of the day in that text variable?

While I was curious, and like to find out things, I came up with this.
It should run until Homey dies.
Maybe I missed something, or things can be done in other ways, pls let me know!

How to display (or to use with speech) name of today and this month

A. Create 2 variables, type Text

  1. NaamVanDag (name of day), no text need to be entered.
  2. NaamVanMaand (name of month) & enter the name of the current Month

B. Create 7 flows, one for each weekday
Mon:

Tue:

Wed:


And so forth

C. Create 12 flows, one for each month
Jan:

Feb:

Mar:


And so forth

some/most can be done in HomeyScript:

//MyCreateDay-Tag.js

let SysInfo = await Homey.system.getInfo();
var weekDay   = SysInfo.dateHuman.slice(0,(SysInfo.dateHuman.indexOf(' ')));
await tag("WeekDay", weekDay );       //creating new HomeyScriptTag 'WeekDay'
console.log("Weekdag", weekDay);
return(true);
1 Like

Thanks! I don’t have enough knowledge to write a script like that.
Most of the time I can read what a script should do.
So if I’m correct this script creates tag named Weekday and then this script updates the value of it with the name of the weekday.
Does it create the same tag each day? Or is this skipped if it already exists?

But, well, this saves a lot of flows :wink: :wink:

This script runs ones when called, so it has to be run every day.(can be run in the AND column)
HomeyScript is fun to experiment with, just try, I’m also a beginner but many guys here can assist you, when you get stucked. There are many examples provided with HomeyScript, play with them and be amazed.

Thanks, yes I understood, and alr created a flow for that :wink: Playing with the script examples right now.
So ofcourse I want the month tag also, but, no way it returns something else but weekday

Inside the Playground

Homey.system.getInfo();

returns

"dateHuman": string "donderdag 29ste april 2021 17:31:41"

I can’t even let the homeyscript return that, and I want to pick the 3rd word of the string in some way I was thinking.