Getting Started - Logic variables

I already managed to create some flows (f.e. average humidity in two rooms), the logic behind the Trends cards was not immediatly clear to me. I thought Trends needed to monitor values for the set duration, but I now understand it just takes it’s data from insights (which is kinda logic of course :wink: ) so the wanted values is immedialty available as soon as you use one of these cards
Tnx for the tip, it does exactly what I need. Trends calculated values are not directly available in Homey Logic to use in other flows but you can assign them to Logic variables in a flow similar to your second.

edit: what I don’t get is how you would use the Trend card in the THEN part of a flow. so, IF thisflowstarted … AND…THEN “calculate Trend something” but you can’t do anything with what you calculate after that moment? Like when you start a flow with a Calculate Trend you have that available as a tag, but not when you calculate in the THEN section of the flow

Ah wait, I do know (because I used them in my own testflows :smile: ) when you “THEN calculate Trend” you can use that calculation as a trigger. In your example: you don’t need to trigger the second flow using “Start Flow” in your first flow, it will be triggered on the “IF calculated” in your second flow

So it would be f.e.

  • IF every 5 min THEN calculate Trend temperature
  • IF Trend Calculated Temperature AND < 20 THEN push “temp too low”

You also could have the first flow calculated more than 1 values, then you can use these as triggers in other flows

Flow 1 calculate all trends:

  • IF every 5 min THEN calculate Trend temperature, calculate Trend Humidity, calculate Trend Luminosity

Flow 2 do something with temp

  • IF trend calculated Temperature AND …THEN send push

Flow 3 do something with hum

  • IF trend calculated Humidity AND …THEN put in Logic variable
    etc

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.
.

edit: woops…app-author has a fight with Athom