Setting up a time variable

I'll like to ask for some help on how to set up a global time variable. With the old rule machine (4), I could set up a variable time. I can use a dashboard to set the time, and the variable will trigger the lights to start coming on in the morning.

It broke when we now have rule machine 5, and I'm deciding to rebuild that using RM 5. But using the Hub Variable, there's no time setting but Date and Time variable. So I created a WakeUp Time datetime variable, to a time of 5:30 to start with. I set a test rule machine and then using the dashboard, I put in a new time of 5am. Then the dashboard said Invalid Date. I went back to the Hub Variable but it would not load, saying there's an error. I couldn't do anything to get in, a reboot didn't fix it. Luckily I decided to make a rule machine, to set WakeUp time to match the WakeUpStart variable that I already set, and that fixed it and I was able to get in the hub variable settings.

I cannot use the dashboard to change the time? How can I do that?

1 Like

Yes, I am seeing the same thing. When I add a "Variable Time" tile for a DateTime hub variable, the time is displayed fine. When I enter a new time into the tile, the tile returns "Invalid Data" and the following error appears when I bring up the Hub Variables page. I then need to reload a backup to get going again.
RM 5.1 version 2.2.9.146

I also have a broken rule (morning alarm with circadian lights etc) which relied on a time input from a dashboard tile, which now seems to think it needs a date also. I thought it was just me that didn't have it figured out... :thinking:

I tested this and was also able to reproduce something similar in 2.9.145 and .146.

  • Created a Data Time variable and set it to 0:00.
  • Built a rule with the trigger for the rule to run at a variable time with the newly created time variable as the trigger.
  • Changed it to 1 minute in the future. (9:46)
  • Went back to the rule 5 minutes later and toggled display variable value. Got the error below. Confirmed that the rule did not run (set message was not logged).
  • Went to the Variable screen and got the error noted by @daleberlin above, but with T0 instead of T1 or T2.

Rule Action:

Resulting Error:

Logs:

Tagging @bravenel

1 Like

I'm not sure what exactly this issue was. But I did find some other issues with setting a datetime variable to a time offset. Once I fixed those, this works as expected (UI display issues). Perhaps you could show the rule that throws the error.

I have the same error that Sebastien showed, Unexpected error, for input string T0. I would never be able to get back into the Hubitat Variables settings, even a reboot won't let me in. I was lucky to have another variable with the datetime so I temporarily made an automation to copy the bad variable to a good one and that made it go away.

In the Hubitat Dashboard, I just click on it, type in 5:20 AM, and it throws an error and that's what caused this.

Please show the rule where this happens.

There's no rule that caused the error. I just have a datetime variable, made a connector. On hubitat dashboard, I made a variable tile, for datetime.

It shows the original time that I made when making the variable. I click on it in dashboard, type in a different time, and that caused the error.

I'll make the error in a video and upload it in a minute.

No video. So this error is from Dashboard?





Yes. Error from using dashboard. I want to be able to use dashboard since I get up at different times sometimes, so it would be easier to just change from there rather than going into hubitat variables and updating there.

I have the same error. When editing a variable time tile in dashboard, it always says invalid date. hub variable is date-time.

OK, so evidently DateTime variables are broken in Dashboard in the current release. We will get this sorted for the next release.

4 Likes

I way to solve Hub Variables failing after this is to set a complete DateTime on the variable connector device using the setDateTime.

A fix to avoid this will be in place for next release.

3 Likes

I am having challenges with the "Variable Date Connector Tile." Editing the variable in the Date Tile returns an error. On the plus side, editing time in the variable connector time tile does not. Edits also work if they are made directly in the Hub Variable Tile.