Metrics - how to use

I am trying to use the component called “Metrics” in Thingsplex, but without success. I cannot found any examples of anyone using it either. I’m trying to increment a value every time it runs, but the value does not seem to increase any tips?

When I need counters I just use transform and if blocks. In this example I want the if block to run with success 3 times in a row to proceed. Should be fine creating a for loop also, I just havent had use for it yet. had a look at metrics block also but after not succeding for a few tries I did it manually instead.

image

+1 transform block
image

1 Like

Hi Brommen,

Thank you! What does is it mean here when “Left variable” is set to “Trigger variable”? I don’t want the calculation to depend on any input parameter. Or does that just mean that the “Expression” below is used? I am using a global variable ( not sure if that is a good idea though). I want to count number of days without rain.

In this case it doesnt matter if you have counter itself or trigger variable as left variable, result will be have the same. Expression is where the calculation is done.
if you use another variable in an expression you probably need to mention that one in left variable.

You can use a non global variable (which means it is stored in this flow and will store its new value for next time flow runs). Or you can use a global variable (which is available to all flows to use and can also bee seen in context) Both will work.

just to test you can make a simplified test flow like this.
image

time triggger:
image

Transform counter:
image

you can see it increments every 5 seconds. Its not live so push refresh button in lower left corner