Page 1 of 1

Convert uptime seconds to days hours ect

Posted: 27 Jan 2021, 03:27
by budman1758
I'm using the sysinfo plugin for display purposes. Is there an easy formula that can go in the formula "box" in the plugin settings that will convert the seconds to day, hour, minute, second format?
Or if not can that format be added as a variable?

Re: Convert uptime seconds to days hours ect

Posted: 27 Jan 2021, 10:51
by TD-er
Do you need the actual time of day?
Then see the sysvars page on the ESP for all the various time related variables you should be able to use anywhere, also in rules and in display plugins.

Re: Convert uptime seconds to days hours ect

Posted: 27 Jan 2021, 16:43
by budman1758
TD-er wrote: 27 Jan 2021, 10:51 Do you need the actual time of day?
Then see the sysvars page on the ESP for all the various time related variables you should be able to use anywhere, also in rules and in display plugins.
On the RPIEasy variables page the only one there is for system uptime is displayed as seconds. That is what I'm wanting to display as days, hours, minutes. Not looking for the current time of day. On the main page the system uptime is displayed in the "system info" area like I want.

EDIT: I see on an ESP unit in the variables page at the bottom "standard conversions" one to do what I want now. Cant figure out how to add that formula in the formula box in the plugin and get it to work. How do I format the actual formula? %value%=%c_s2dhms%(100000) doesn't work. (on ESP) Pointers?

Re: Convert uptime seconds to days hours ect

Posted: 27 Jan 2021, 18:37
by enesbcs
budman1758 wrote: 27 Jan 2021, 16:43 EDIT: I see on an ESP unit in the variables page at the bottom "standard conversions" one to do what I want now. Cant figure out how to add that formula in the formula box in the plugin and get it to work. How do I format the actual formula? %value%=%c_s2dhms%(100000) doesn't work. (on ESP) Pointers?
c_s2dhms is not currently supported in RPIEasy, but can be. c_m2dhm can be used for now.

I think it may works in this form as a formula:
%c_s2dhms%(%value%)

but easiest approach to use the current uptime variable and convert it (it can be added to the input field of display plugins):
%c_m2dhm%(%uptime%)

update: Uptime is in minutes, not seconds.

Re: Convert uptime seconds to days hours ect

Posted: 07 Feb 2021, 20:08
by enesbcs
c_s2dhms added to RPIEasy at todays commit.