How to change between 12 and 24 hour time display?

Hello, is there a way to change these history messages into 12 hour (AM/PM) time format?

Screen Shot 2021-01-18 at 6.28.45 PM

I've searched for a solution to this and see a lot of people struggling to input time, but I am just trying to display time in 12 hour format. I live in USA and my browser and computer are all set to 12 hour format, but I can't find any setting for this in Node-RED.

Thanks,

Scott

It would help to know what node you are using, but since that is a status message I would assume that this is something that is controled by te node itself. You might want to ask the node's author on the node's GitHub page.

The node is just a simple "call service" that comes from the default set.

Could you export your flow and attach it to a response?

When you say it is part of the default set, how did you install Node-RED?

That looks to me like a Home Assistant node - not one of the default palette.

Have a look at the help for the node as to who authored it and the options for it.

Craig

I installed Node-RED from within Home Assistant.
Here is a 38 second recording of me making a sequence with the issue: https://youtu.be/zbvwaGd9-LA
Below is the code of what I created in the clip above.

[{"id":"bf47a926.e6f82","type":"api-call-service","z":"2014399e.c57456","name":"","server":"4188bc1a.bd4c54","version":1,"debugenabled":false,"service_domain":"switch","service":"toggle","entityId":"switch.office_lamp_2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":480,"y":360,"wires":[[]]},{"id":"4188bc1a.bd4c54","type":"server","name":"Home Assistant","addon":true}]

Yep - so drap one of these nodes onto the palette and then go over to the help/doc on the right hand side and see what the usage is and who the author is.

These are custom nodes that the Home Assistant implementation of NR includes - not standard nodes

Craig

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/call-service.html#using-mustache-templates

Craig

Sorry I figured they were default because they came with the installation in HA and I didn't add them.

The link above explains a little more about the call service node but doesn't explain anything about contorting the time format. Is there a different place I should ask this question?

I'm little confused why something so basic isn't controlled by a simple toggle switch or checkbox somewhere.

You are probably best off opening a feature request on their github page:

Options for formatting the node status is not something that you will find on many nodes if any as that status is really just a nice to have features for quick glance information while developing.
Design wise the paradigm here is that the flow editor is not a dashboard and its also good practice not to overload a nodes ui with too many options.
For showing information exactly like you want it the information is probably also included as a timestamp in the nodes output messages as a property and you could format that output yourself to show it in the nodered dashboard in your wanted format.

Johannes

1 Like

No problem - you are not actually using the default HA nodes i believe you are using the Community Websocket Add on (may be wrong here) - if you look on the link i provided there is a link to their github page and you can open an issue on there

Craig

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