Using Rule 4.0 Variables for Time

@bravenel is there a way to use a variable as input for a certain time hour and minute?

Not at this time (pun not intended).

There might be some back door way to do this with a Wait for Event, using a timeout (which does accept a variable number of seconds). So you'd fire the thing at a fixed time, and then wait a variable time.

Good hack - it turns out I couldn't do what I wanted to do anyway.

I have rule that governs a gentle wake up. Currently, through the dashboard I have a button that enables or disables the rule. What I wanted to do was add some additional tiles that let me set the start time of the gentle wake up, without needing to go int the rule itself - also this would be easier for my partner who has never looked at the admin site. However, there currently isnt a tile that will let you enter this info nicely.. the level tile goes in 10 increment so it wouldnt really work

I have hacked around this, using a virtual dimmer for both hours and minutes and rules/buttons for +5/-5 mins etc +1/-1 hour etc for our morning alarm time. I then have GVs that I set to current hour and minute and compare them in RM to trigger the alarm at the relevant time. It's clunky but does work.

The perfect solution, I think, would be if some sort of virtual "time storage" device could be introduced which also has it own dashboard tile for display and adjustment. It could then be used in RM to compare with current time and that would solve pretty much any time rule criteria that needed adjustment.

Great tip.. so I've made the dashboard.. but the corresponding rule doesn't seem to work as planned - any tips on where I'm going wrong:

What doesn't work? Does it trigger at all?

I've not used the "wait for condition" technique for mine. I just have a trigger for the minute being correct and a condition of the hour being correct (see below). I set the GV hour and minutes in another rule which runs every minute.

Turn on logging, and see what's going on. What you showed there has two different values, 25 and 24.

Thanks I'm going to give this a go.. it wasnt triggering correctly

I'm going to try this other technique - re: the images - the screenshot I took ere from different times (hence they didnt match up)

Ok so @Geoff_T's method works to get it to trigger.. but my cancellation method does not appear to work.

What I'm trying to achieve is if any of a list of lights get manually turned off whilst the fade is occurring, then it should cancel the fade altogether. I've got this working previously in rule 2.5 with stop rule actions.. I couldn't find the same option in 4.0 so I used exit rule.. I'm guessing that isn't the way to do it?

Can you post a screenshot of your cancellation method because I don't see one in that rule.

It’s in the screenshot. After the fade starts there is a wait for some lights to turn off and then exit rule once that happens (or after a timeout).

FYI this is not about cancel delayed actions- because this is an ongoing fade that is occurring

You're trying to cancel the fade over time action? Is that cancelable @bravenel?

Cancel Rule Timers, this rule, or another rule. Cancels all timed things and Waits.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.