feature request: Uptime in days : hours : minutes only on the web page

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

feature request: Uptime in days : hours : minutes only on the web page

#1 Post by hvdwolf » 21 Oct 2016, 21:36

Currently the uptime on the Main webpage is in minutes. With an Esp Easy up for multiple days this becomes an "unreadable" number.

I found a reference to uptime in Misc.ino, and in webserver.ino

I would like to have this uptime in days : hours : minutes (or days / hours / minutes or whatever)
I'm a moderate python programmer, not a C programmer but I found a handy snippet on the internet for seconds conversion which I "converted"

Code: Select all

int minutes= wdcounter/2;
int days=minutes/1440;
minutes=minutes%1440; /* minutes now less than a day */
int hrs=minutes/60;
int minutes=minutes%60; /*minutes less than an hour*/
And then something like

Code: Select all

printf("D:H:M=%d:%d:%d\n",days,hrs,minutes)
And that's about the limit for my C knowledge :)

Could someone implement this if there are more in favour of this?
Last edited by hvdwolf on 26 Oct 2016, 10:22, edited 2 times in total.

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: feature request: Uptime in days : hours : minutes

#2 Post by hvdwolf » 22 Oct 2016, 19:45

After all I wrote a patch myself and I have it now in test which does what I want. I let it run for 24+ hours to see how it behaves and then I will do a pull request.

f-fish
New user
Posts: 9
Joined: 19 Sep 2016, 04:11
Location: Johannesburg - RSA
Contact:

Re: feature request: Uptime in days : hours : minutes

#3 Post by f-fish » 23 Oct 2016, 14:44

hmm not sure about wanting this as a default option .... maybe an option.

It is easy to work with minutes for both reporting and passing data onto something like domoticz not to mention using 1 unit in rules.

Did you check what the extra load is with your code enabled?

This might be a cosmetic change that could eat into low power requirements.

Later Ferdie

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: feature request: Uptime in days : hours : minutes

#4 Post by hvdwolf » 23 Oct 2016, 20:50

f-fish wrote:hmm not sure about wanting this as a default option .... maybe an option.

It is easy to work with minutes for both reporting and passing data onto something like domoticz not to mention using 1 unit in rules.

Did you check what the extra load is with your code enabled?

This might be a cosmetic change that could eat into low power requirements.
It might indeed be better to make it an option via Tools->Advanced, but as I mentioned in the first post: I'm not a C programmer.

The extra load is nihil. I tested one of my nodemcu's and there is no additional load or is is below or around 1%

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: feature request: Uptime in days : hours : minutes

#5 Post by hvdwolf » 23 Oct 2016, 22:53

And by the way: It is only on the webpage!

The time as used by Misc.ino and ESPEasy.ino for the log and as sysinfo device is still in minutes. So whatever system you use: domoticz, pimatic, some MQTT, etc. , you will still get minutes.
I didn't change that on purpose as it would change the interface. I only touched the web page.

f-fish
New user
Posts: 9
Joined: 19 Sep 2016, 04:11
Location: Johannesburg - RSA
Contact:

Re: feature request: Uptime in days : hours : minutes only on the web page

#6 Post by f-fish » 24 Oct 2016, 18:58

Ok so just webpage display ... hmmm that would actually be cool.

Later Ferdie

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 64 guests