Timekeeper issue with mqtt input

Hello,
i'm using a default text input node configured as time keeper mode, as input i have is a value coming from a mqttinput node, value in mS . On ui (not realated to browser type) the value is not showed, just --:--. It is displayed only if you make a page refresh with brower or if you make avalue change.

Note: same structure from mqtt input to numeric input node work correctly. So seem a problem on text input as timekeeper, could be too slow to rise-up or something like that.

Any idea how to solve ?
r.

Which dashboard?
What version?
Example of input to be sure.
Example flow showing issue, may also help.

fine, vr 3.1.3
below the example.

[
    {
        "id": "38654ba4598ee108",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "2d39eacbdfe648a8",
        "type": "mqtt in",
        "z": "38654ba4598ee108",
        "name": "AuxTimeOn",
        "topic": "temperature/AuxTimeOn",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "52a64934d1309ded",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 230,
        "y": 160,
        "wires": [
            [
                "e8389e97cc52824f"
            ]
        ]
    },
    {
        "id": "e8389e97cc52824f",
        "type": "function",
        "z": "38654ba4598ee108",
        "name": "inttotime",
        "func": "var timeval = Number(msg.payload);\ntimeval = timeval * 60000;\nmsg.payload = timeval;\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 440,
        "y": 160,
        "wires": [
            [
                "8bb485283baf1785"
            ]
        ]
    },
    {
        "id": "8bb485283baf1785",
        "type": "ui_text_input",
        "z": "38654ba4598ee108",
        "name": "Ton",
        "label": "Start at : ",
        "tooltip": "",
        "group": "01ad3b641f0ac055",
        "order": 17,
        "width": 0,
        "height": 0,
        "passthru": false,
        "mode": "time",
        "delay": "500",
        "topic": "topic",
        "sendOnBlur": false,
        "className": "",
        "topicType": "msg",
        "x": 630,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "52a64934d1309ded",
        "type": "mqtt-broker",
        "name": "",
        "broker": "localhost",
        "port": "1799",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "01ad3b641f0ac055",
        "type": "ui_group",
        "name": "Default",
        "tab": "eaefa5f8fb26869f",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "eaefa5f8fb26869f",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

No example of data.
version of dashboard (sorry should of been more precise)

I do not see an issue when i feed in a timestamp.

Are you running latest version of node-red-dashboard?
What exactly is coming out of your function?

Dashboard vr 3.6.2, it's all updated to latest verisons.

Yes, if you use a timestamp as input it's work, i know.

But not if the input is coming from mqtt in, my idea is the value is injected / available before timekeeper is runnig, but it's just my idea, or is a visualization / update problem from browser.
From mqtt i have the time as value in minute from 24:00, so with a function node the value is multiplicated * 60.000 and injected to text input node as timekeeper. very simple.
If i use text input as text value it work, but obviously is not friendly to set a time value from user.

Please show the output of the function node, use a debug node, as
Number("24:00") will not work. use parseInt() parseInt() - JavaScript | MDN. May also have to split the string if you want the seconds to be calculated also.
[edit]
or format the string using change node and moment()
e.g.

[{"id":"790c2796961522e1","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($moment($$.payload, \"mm:ss\").format(\"x\"))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":7760,"wires":[["7921305650d4f7f7"]]},{"id":"35acf98972fa0867","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"24:00","payloadType":"str","x":430,"y":7680,"wires":[["790c2796961522e1"]]},{"id":"c1857e9305351649","type":"debug","z":"d1395164b4eec73e","name":"debug 2535","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload &\"-\"& payload1","statusType":"jsonata","x":830,"y":7680,"wires":[]},{"id":"7921305650d4f7f7","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":630,"y":7700,"wires":[["c1857e9305351649"]]},{"id":"4f791fdc1745d3d9","type":"ui_group","name":"micro","tab":"c954274bbed7292e","order":1,"disp":false,"width":"18","collapse":false,"className":""},{"id":"c954274bbed7292e","type":"ui_tab","name":"Solar","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Show us the value coming from MQTT and the value coming out of function node (use debug nodes)

Also, when the text item is empty, if you publish (inject->mqtt-out) to the same MQTT topic, does the value arrive at eh MQTT-in and display on the dashboard?

immagine

From mqtt i receive a numeri value, ex. 600 for h 10:00, function mutiply it by 60.000 , result is 360000.
The screenhsot is a debug node after the function, so is also the input to timekeeper.

Value is not showed when you open the ui, it's showed only after a page refresh.

here the picture on page opened :slight_smile:
immagine
and then after a refresh
immagine

(Firefox style)

You are sending us mixed info and I for one am now confused.

Add a debug to mqtt node and one to function node.
The take a screenshot of flow and sidebar info, so we can see what is happening.

Not certain why this is happening (are you doing full deploys?)

But a sure fire solution to handle this is to store the value (after function) into context (e.g. flow.startTime) then use a ui-control node to detect browser connection then through a change node (to set msg.payload to the value of flow.startTime) then send that to the text node.

If you want to be certain the flow var has a value, use an inject etc to inject a value into the flow var at startup.

and

immagine

Coudl be, but is not clean and i have a lot of timekeeper , become complex.
it's timekeeper mode the problem, is used as numeric input or text input is working.

I think it must be the browser as i Have no issues with multiple timepickers
e.g


All injected prior to opening browser, inject 600 and multiplied by 60000

onther information could be useful, values from mqtt are received any 1 sec. if value still the same is not injected from "mqtt in" node so is not showed on ui.
If the values at origin change the ui is working, it's

arghh.... seem ok, i'm confused...., can you share the test ? so i try it .

[{"id":"b66797468a67cb4c","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"600","payloadType":"num","x":430,"y":7580,"wires":[["f36f7029d193716a"]]},{"id":"f36f7029d193716a","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload * 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":7580,"wires":[["08314625ecfc11b3","56c54d06fe7000cc","07f2c16e944cac25","7540e5c86e4a9482","3a700b6789d1b591","15575090472d83b5","b8a000dcac74b96a","172e90efec9ccacf","3b21d12430d9e666"]]},{"id":"08314625ecfc11b3","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7560,"wires":[["e01fd2ca7e8772fd"]]},{"id":"56c54d06fe7000cc","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7600,"wires":[[]]},{"id":"07f2c16e944cac25","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7640,"wires":[[]]},{"id":"7540e5c86e4a9482","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7680,"wires":[[]]},{"id":"3a700b6789d1b591","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7720,"wires":[[]]},{"id":"15575090472d83b5","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7760,"wires":[[]]},{"id":"b8a000dcac74b96a","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7800,"wires":[[]]},{"id":"172e90efec9ccacf","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7840,"wires":[[]]},{"id":"3b21d12430d9e666","type":"ui_text_input","z":"d1395164b4eec73e","name":"Ton","label":"Start at : ","tooltip":"","group":"4f791fdc1745d3d9","order":17,"width":0,"height":0,"passthru":false,"mode":"time","delay":"500","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":790,"y":7880,"wires":[[]]},{"id":"e01fd2ca7e8772fd","type":"debug","z":"d1395164b4eec73e","name":"debug 2537","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload &\"-\"& payload1","statusType":"jsonata","x":1010,"y":7560,"wires":[]},{"id":"4f791fdc1745d3d9","type":"ui_group","name":"micro","tab":"c954274bbed7292e","order":1,"disp":false,"width":"18","collapse":false,"className":""},{"id":"c954274bbed7292e","type":"ui_tab","name":"Solar","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

close dashboard browser tab, deploy, open dashboard.

Can you show how you filter unchanged mqtt inputs?

somethig of strange. I do it, injected the value and then open the ui, it's wrong.


It's showed only after page refresh, exactly in my flow. If the inject is done with ui opened work.
I check also with chrome , same result. (tested with edge, chrome, firefox and mobile)

immagine
same configuration working with numeric input node.

different version of dashboard ? your flow is working on your machine and not on my one.
my dashboard is 3.6.2

Check this :slight_smile:

[
    {
        "id": "23310c1bba3d8313",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "b66797468a67cb4c",
        "type": "inject",
        "z": "23310c1bba3d8313",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "600",
        "payloadType": "num",
        "x": 290,
        "y": 640,
        "wires": [
            [
                "f36f7029d193716a"
            ]
        ]
    },
    {
        "id": "f36f7029d193716a",
        "type": "change",
        "z": "23310c1bba3d8313",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$$.payload * 60000",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 480,
        "y": 640,
        "wires": [
            [
                "08314625ecfc11b3",
                "8812b27448d640b5"
            ]
        ]
    },
    {
        "id": "08314625ecfc11b3",
        "type": "ui_text_input",
        "z": "23310c1bba3d8313",
        "name": "Ton",
        "label": "Start at : ",
        "tooltip": "",
        "group": "4f791fdc1745d3d9",
        "order": 17,
        "width": 0,
        "height": 0,
        "passthru": false,
        "mode": "time",
        "delay": "500",
        "topic": "topic",
        "sendOnBlur": false,
        "className": "",
        "topicType": "msg",
        "x": 690,
        "y": 640,
        "wires": [
            []
        ]
    },
    {
        "id": "8812b27448d640b5",
        "type": "ui_text_input",
        "z": "23310c1bba3d8313",
        "name": "Ton",
        "label": "Start at : ",
        "tooltip": "",
        "group": "4f791fdc1745d3d9",
        "order": 17,
        "width": 0,
        "height": 0,
        "passthru": false,
        "mode": "number",
        "delay": "500",
        "topic": "topic",
        "sendOnBlur": false,
        "className": "",
        "topicType": "msg",
        "x": 690,
        "y": 560,
        "wires": [
            []
        ]
    },
    {
        "id": "4f791fdc1745d3d9",
        "type": "ui_group",
        "name": "micro",
        "tab": "c954274bbed7292e",
        "order": 1,
        "disp": false,
        "width": "18",
        "collapse": false,
        "className": ""
    },
    {
        "id": "c954274bbed7292e",
        "type": "ui_tab",
        "name": "Solar",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]