Page 1 of 1

Time range: Variables

Posted: 18 Nov 2016 08:21
by krishnivas
Hello.

I've been using a time range condition for executing certain flows. Is it possible to use variables for the start time and end time values instead of fixed ones. I am unable to come up with a workaround.

Any help in this regard is greatly appreciated.

Best regards
Krishna

Re: Time range: Variables

Posted: 18 Nov 2016 08:49
by MURTUMA
Please, explain the use case in more detail. There just might be a workaround but it needs more information.

Re: Time range: Variables

Posted: 11 Mar 2017 00:22
by krishnivas
I'm back at this. I have a flow where certain things like screen timeout and WiFi state are set based on 'user present' trigger between a certain time range. Currently time range accepts time values. I would like to instead use variables for the from time and to time values.

Re: Time range: Variables

Posted: 12 Mar 2017 13:27
by Bingwu
Hello Krishna!

If I have understood you correctly, then you are looking for a way to query a time range with variables in a condition.
Perhaps the following will help you. (Unfortunately, I know no better way.)

flow_condition_expression_timerange_20170312_132151.png
flow_condition_expression_timerange_20170312_132151.png (55.72 KiB) Viewed 12856 times
(The flow is attached. - The actions are only examples.)

The condition (expression) compares the variable "triggertime" with the variables "mystarttime" and "myendtime"
mystarttime and myenddtime are decimal numbers, the minutes do not have to be converted.
For example: 8:45 = 8.45 (not 8.75) or 11:30 = 11.3 (not 11.5)

Best regards
Peter

Re: Time range: Variables

Posted: 07 Apr 2017 08:06
by krishnivas
Hi Peter!

Firstly, thank you. I was already thinking of a flow like this. Feeding the start time and end time as global variables (as I use this time range condition is multiple flows) and using an expression to check.
I was just wondering if there was an elegant way of doing it that I wasn't aware of.

I would like this as a feature. It would be nice to have variables for time range values.

Best regards,
Krishna