I'm trying to update an alarm clock-type rule to leverage a time variable connector on a dashboard. I'd like to be able to set the alarm time from the dashboard, rather than edit the rule directly. I'm seeing unexpected behavior when using the time variable with the Days of Week Schedule.
I initially set up the rule to trigger M-F at a certain time. This works as expected. Editing the trigger event to use the time variable shows the current variable time.
I've also added a Certain Time trigger tied to the same variable as a "control" scenario (my actual rule doesn't need this trigger, just adding to contrast the behavior).
As the screenshot shows, the certain time trigger updates with the new variable value, but the Days of Week trigger does not. Editing the days of week trigger will refresh the time to the current value of the variable.
Thanks! Based on a bit of research, I can likely add a day of week check in the rule body if it's not reasonable to expect the DoW trigger to handle the time variable.
Updated to 147, I'm still having this problem in Rule Machine. Tried one in simple automation and it worked, but not in Rule Machine even with a new rule.
I'm the OP. Rather than creating a new thread, I'm exhuming this one as the problem definition seems to remain valid. The original issue is persisting for me in version 2.2.7.124.
Specifically: Days of the Week triggers don't acknowledge time variable changes.
I created a new rule from scratch today to test. Changing the time variable is not reflected in the trigger value. I tested changing both via a dashboard connector and the "set" link in the rule's variable section.
The below rule screenshot shows the incorrect Days of the Week time (6:55am 6:51am) after the time variable was updated to 6:51am 6:55am. The second trigger is only included to show the functionality variance.
Thanks!
edits: I completely messed up the problem description swapping the times and also got the screenshot wrong. My apologies. Regardless, I think the above description is now correct!
I think this is only a UI issue (I can replicate). But when I change the time, the actual trigger event is updated. Look at Application State (gear icon) Scheduled Jobs, at the bottom of the page.
I think there is a difference between a local variable and a global variable. There was not an expectation of a rule being triggered by a local variable, and I suspect that changing a local variable will not update the time (unless the rule is updated). Most likely the fix for this is to not allow selection of a local variable in that context. With a global variable, the rule has a 'subscription' to the global variable, precisely so that it will update its scheduled jobs when the global variable changes.
As a relative novice, I use local variables when utilized in only a single rule and global variables for usage across multiple rules. I guess using a connector on a dashboard does overflow my single rule paradigm. The "subscription" concept is also helpful info, so I'll work to keep local variables out of my triggers.
Thinking through it, I'll rewrite this rule to use a global variable and a virtual switch in lieu of local variables.