My goal is to put the date and time of an event (RM created hub variable) on a dashboard tile. My current effort only shows the date, but the variable is datetime. Does the datetime need to be formatted somehow?
I'm really really trying to not have to add a custom dashboard app.
If you do not want to do a custom tile (from another app) and you're using RM, then consider combining the data into 1 hub string variable and display that. In RM you can append text to a string variable. So, in your example, assuming that your triggering your rule with the change of the water sensor you could have 1 hub string variable that would be built like
%device%+": Water Detected at " + %date%+%time% for a true condition and
%device%+": Water Detection Cleared at "+%date%+%time% for a false condition
If you don't need it that verbose you can simplify it with
%device%+%value%+ %date%+%time% for a both conditions (although you may need to add extra spaces to make it more readable)
You may need a couple of lines to do it in RM but it should work. Then you can display the whole, detailed event in one tile.
I dont know if the format codes work on the string tile, but they might, i haven't tried it. I'm sure someone else here has tried it and can offer some feedback.
Worst case you could 2 tiles and over lap them so they look like one.
I would suggest making this a request for a change in the dashboard display of this variable. Technically is is likely possible, but probably not worth the effort if it can be built-in.
There are of course possible alternatives in Community-developed code , either in existence or that could easily be created (I expect) to give you what you need, but I feel it would better placed as a built-in option if possible. Wow... I really sound like I'm at work....
Look at the current value of your variable, which you can see in your first screenshot: it's "2023-11-02," i.e., only a date, no time. (A DateTime variable can be either or both but doesn't have to be both.) This is what Dashboard will display if you add a variable tile. If you have both set, the tile will display both. For example:
This is assuming you are using a variable tile, not a device tile with a connector. I would not do that unless you have other reasons for doing so.
Rooky mistake, I only set the date in the hub variable, assuming a default time would be included.