Rule Machine Time Variables

Did you define a time variable yet?

Got it, I assumed it set up a variable based on it's purpose automatically. I've set a global variable and now have the option - thanks

1 Like

OK, set up a rule machine variable as a "time" and mapped it to trigger event. Now in dashboard I've selected the device to control, thdn selected variable time the tile now shows as invalid, then when clicking on it, it says "Invalid date:undefined am"

What did you set the time to when you set up the variable? Can you show a screenshot of your RM global variables setup?

Tried variable with both % and without

First of all, you do not need to put % in front and behind your variable names. In fact, you shouldn't do that. It will just confuse you later. That is how you designate a variable when you want to type it in a field. So, you would have to type %%kettle-on-time%%.

Also, you have not created a GV connector for this variable yet. So, what device did you add to the dashboard? You have to create a GV connector is you want to manipulate a variable on the dashboard.

I would suggest reading through this post on GV connectors and how they work in general. This will be a big help.

Great thanks for that assistance. I've removed the % and the missing step was making a connector which I've now selected as dashboard device. I assumed it was an automatic link as once it was assigned to a trigger it showed up as being linked in the global variable.

The rule is linked to the global variable. Just out of curiosity, what device did you pick in the dashboard before adding the connector?

Bruce, you are freaking awesome! This is great. I've updated my RM color temp rules:

I have noticed a bug with interface when setting a time variable however. I'm using chrome on a mac and I get this:

obviously the update button is cut off, but I also can't really read or see what is in the hours or minutes boxes.

Once I hit done to get the variable created, it doesn't seem to create the variable, until I hit "add another global variable" again, and then the variable appears in the list. Also when I press "add new global variable" that second time, it doesn't allow me to add another global variable, it really just seems to update the interface.

something similar occurs with local variables, but if I just back out of the variable editing screen and then return it updates. Also local variables don't seem to give me a "done" button and I have to click on and off of things before I get the variable to be accepted.

1 Like

That's really crazy!! In Chrome on a PC, when I got to set variable, it comes up like this:

Also, do you have your system set for a 24 hour clock or a 12 hour one? Because I don't see the input for am/pm even though you're in the US.

This is what I get on a Mac running Chrome

Creating the global var (I set this to 12:00pm but took screen shot prior to that)

Updating the var

That is weird. I have my clock set to 24 hours.

I just switched my time from 12 to 24 and got this.

EDIT: It won't allow me to enter values in either the Hour or Minutes fields.

EDIT2: Changed HM back to 12. The new variable still existed, with no value, and gives me this now

You beat me to it but that's what I thought would be the difference. Now, what timescale is your PC set to? Is that at 12 or 24? That's also for you @jrau272. I wonder if it is not able to set up a time input because your PC is set up for a 12 hour clock.

Mac is set to 12. I will change that and test.

  1. Changed system time to 24

  2. Exited out of HE admin console

  3. Created new global time var with HE set to 12 hour - worked correctly

  4. Changed HE time format to 24

  5. Created new global var and get the error

EDIT: As jrau272 stated. Even if you delete the variables they still are populated when you go into edit/create global vars. I deleted sunrise3 but it's still here

my system time is set to 24 hours also.

Ah ha! It has something to do with the width of the page. Because on my PC this is the first thing I got.

That was on a full 1920x1024. But after reducing the window to 1/2 the screen, it looks like this:
image

1 Like

It seems to be a UI framework error wrt 24 hour clock setting. Haven't looked at that recently. Check if setting Certain Time works the same or not.

I just did...it works fine. And it looks file on a widescreen monitor. It also looks fine on a mobile device. Here's a time variable in 24 hour mode on my Android phone in Chrome:

It appears to only be a problem in smaller windows in the desktop browser.