Using a Time Variable as Widget?

Instead of using a Global Variable, you could use a connector variable. Those will be available as devices once created and hence can be added to the dashboard.

In the Hubitat Non-offical dashboard app...there's no way to set the variable. I can't see using the offical dashboard app as that's just as many clicks as going to my hub's ip address, going to RM, clicking the variable and changing it.

I wouldn’t be surprised if that is one of the reason why connector variables have been created…

Creating one is quite simple. In your rule, you create a local variable and then you click on “Create” under the “Connector” column. You can then chose the type of device to create (Ex.: Switch).

A time connector is only a variable which doesn't work on the app. Even on the actual device connector if you try setting a time it sets it as an integar and breaks the variable. Time as a connector gets me no where.

1 Like

Ah! I missed the part where you need to make it save the time. There must be some way around that…

However again, how do I get to this simply on my Android phone...the HE official dashboard is useless.

Time connector wants a date string. The format of the string is like this:

2021-05-12T03:22:00.000-0700

That's 3:22 AM MST (Phoenix time)

You should be able to use a command

setVariable(time)

to set it, where time is a string in the format above. The Hubitat Dashboard Variable Time tile has a time input field, and putting in the time results in that command against the time connector device. So you need to create in the other dashboard app a similar capability, to take a time input, format the string, and issue that command.

1 Like

But again....using the Dashboard is as useful as going all the way through RM to set the variable there...it takes about as many clicks. I like using your method from the other forum post but again there's no simple way to put where I can reach it the same as I would if i had a clock app on my phone. The non-official dashboard app has the "setvariable" command but they didn't leave it open any further fo me to be able to enter the variable. So it literally just sends the "setvariable()" command lol.

I'm not suggesting that you use the Hubitat Dashboard, just explaining how it works.

You have the source code, right? What do you mean by "enter the variable"? The connector is a device that is connected to the variable, and setting the device sets the variable -- and vice versa.

setVariable() is a device command.

He might have posted the source code. This is just an app that I found in the Play Store that uses maker api to create dashboards. So if I open the connector that I shared across maker api it only has the option for me to send setvariable and nothing else.

Do you mean that you cannot include the parameter that setVariable wants? I know nothing of this app. But it doesn't sound as though it has a way to input a time, which is the starting point to get this to work.

Exactly that's my issue lol.

Ha, its useless if you can't include the parameter for the setVariable command, and also have a way to convert 7:30 into a date string. Ask the author to fix it. Give the explanation I gave above. There is no reason it could not be made to work -- but the author probably just didn't get around to this corner of functionality.

Ideally it would be nice to use a time connector lol. I was working on your token method lol.

I wonder if I could use Node red. I really like as little click as possible when it comes to my alarm. I'm an odd duck and kind of like the groovy click, click, click but not with my dashboard or my alarm lol. I have all my alarm buttons in the quick tiles of my phone so I don't have to do much work at 7am when I don't want to roll out of bed and take the 2 second trip to my home office lol.

They both require a string to be processed. I'm pretty sure the token approach predates having time connectors. Seem to recall thinking, man, what a lot of effort to just get the time. Most UI software can deal with time, most libraries have time string methods to manipulate time, etc.

Ask the author to fix it. All you have to do is point out that Hubitat Dashboard can do it, why can't his app?

Did he fix it for you?

He put a fix in on his app....just waiting on the play store to approve.

Nice! Good luck, I hope it works for you.