Ui_text-input time picker not showing time in dashboard until refreshed

I have an ui_text input node configured as a time-picker. The node is receiving the correct time setting in milliseconds, but the dashboard displays --:-- and I always have to refresh the page in order to get the time displayed.
I played a lot with debug nodes and I am sure the node is receiving the correct input when the dashboard starts (it is also connected to a ui_control node), but nothing is displayed until I refresh the browser page.

Has anyone experienced this behaviour? (NR 2.2.2. Dashboard 3.1.6)

1 Like

So are you sending a timestamp to the ui-text-input node??
also what are the settings you have in the node? (an export would be helpful)

I can not recreate this running the same versions.

Not sending a timestamp, but injecting from ui_control.

[{"id":"5e76b024508a5049","type":"ui_text_input","z":"fd95058a.48e3e8","name":"","label":"time","tooltip":"","group":"6f0450b9abbe27dc","order":21,"width":0,"height":0,"passthru":false,"mode":"time","delay":300,"topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":490,"y":1140,"wires":[[]]},{"id":"23f58faf64af6338","type":"ui_ui_control","z":"fd95058a.48e3e8","name":"","events":"all","x":210,"y":1140,"wires":[["efa7ad290e784dd9"]]},{"id":"efa7ad290e784dd9","type":"change","z":"fd95058a.48e3e8","name":"set time","rules":[{"t":"set","p":"payload","pt":"msg","to":"52260000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1140,"wires":[["5e76b024508a5049"]]},{"id":"6f0450b9abbe27dc","type":"ui_group","name":"Meteo","tab":"5b337e3b.68826","order":3,"disp":true,"width":"6","collapse":true,"className":""},{"id":"5b337e3b.68826","type":"ui_tab","name":"Servizi","icon":"home","order":3,"disabled":false,"hidden":false}]

It always need a page refresh, as the first time it didn't show (but ui_control is sending "connect").

Hmmm, I’m seeing some ‘odd’ things.

  • Is that tab the first or only tab in the dashboard?
  • what happens if you set the change node to inject a timestamp?

FYI, there is an outstanding issue with ui-text-input dealing with time where it the resulting time has an offset based on UTC. You may want to read about it: node-red-dashboard Text Input / time picker Wrong time zone · Issue #625 · node-red/node-red-dashboard · GitHub

The tab is one of many. What do you mean by "injecting a timestamp"? I need the change node to inject a flow variable with a timestamp.

  • Sent from my mobile phone. Sorry for typos -

As a test, alter the change node to send a timestamp to see what happens

If I manually inject a timestamp, it works. But this is not my use case...
The problem is that the ui_text node does not refresh upon opening the dashboard (with the ui_control sending the trigger).

Can you build a small flow it’s the issue. I can’t reproduce it. Also

  • what device/OS are you running node-red on?
  • what device/browser are you using?

You can use this flow:

[{"id":"5e76b024508a5049","type":"ui_text_input","z":"fd95058a.48e3e8","name":"","label":"time","tooltip":"","group":"6f0450b9abbe27dc","order":21,"width":0,"height":0,"passthru":false,"mode":"time","delay":300,"topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":490,"y":1140,"wires":[[]]},{"id":"23f58faf64af6338","type":"ui_ui_control","z":"fd95058a.48e3e8","name":"","events":"all","x":210,"y":1140,"wires":[["efa7ad290e784dd9"]]},{"id":"efa7ad290e784dd9","type":"change","z":"fd95058a.48e3e8","name":"get time","rules":[{"t":"set","p":"payload","pt":"msg","to":"test","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1140,"wires":[["5e76b024508a5049"]]},{"id":"20f595912517dfd6","type":"inject","z":"fd95058a.48e3e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":1240,"wires":[["f0ee239196b9bdc6"]]},{"id":"f0ee239196b9bdc6","type":"change","z":"fd95058a.48e3e8","name":"","rules":[{"t":"set","p":"test","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":1240,"wires":[[]]},{"id":"6f0450b9abbe27dc","type":"ui_group","name":"Meteo","tab":"5b337e3b.68826","order":3,"disp":true,"width":"6","collapse":true,"className":""},{"id":"5b337e3b.68826","type":"ui_tab","name":"Servizi","icon":"home","order":3,"disabled":false,"hidden":false}]

First inject the timestamp to create the flow variable. Then open the dashboard and you will see --:-- instead of the time. Then refresh the browser page and.. voilà, you will get the time displayed.

I am using NR on Raspberry, and Chrome and Firefox on Mac as browser (both show the issue). Tested also on Chrome on Android phone: the same.

In the ui-text-input check off the If msg arrives on input, pass through to output: option and see what happens.

Errr - the ui_control only triggers on

so the display will only update when those occur. - eg a refresh... or initial load.. As long as the inject has happened before that occurs then the time is displayed - If necessary set the inject to fire on flow deploy so it is set early.

@dceejay The inject there is just for testing (to set the flow variable). The ui_control correctly triggers the flow, but the time is not displayed until you manually refresh the browser page

@zenofmud that is already off.

Sorry, I should have said ‘make sure it is checked’ so any incoming message is passed on.

HOWEVER, if you are not at UTC+0 you are going to see time value that is offset. If you want to display the current time on the dashboard why not send a time stamp - thru a moment node - to a ui-text node?

That is just a test. In my flow I need to display the time stored in a flow variable.

  • Sent from my mobile phone. Sorry for typos -

@zenofmud, no change either checked or unchecked. This is definitely a bug of the time-picker (ui_textinput)

The only way to the let time showing as soon as the dashboard starts, it to inject a value (i.e.:true) then wait few milliseconds and inject the correct value:

1 Like

Well that sounds like a clever solution. But you are still going to run into the UTC issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.