Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REST] Add uptime counter to systeminfo endpoint #3656

Closed
spacemanspiff2007 opened this issue Jun 14, 2023 · 2 comments · Fixed by #3796
Closed

[REST] Add uptime counter to systeminfo endpoint #3656

spacemanspiff2007 opened this issue Jun 14, 2023 · 2 comments · Fixed by #3796
Labels
enhancement An enhancement or new feature of the Core

Comments

@spacemanspiff2007
Copy link
Contributor

spacemanspiff2007 commented Jun 14, 2023

Handling startup of openHAB from a HABApp perspective is hard.
OpenHAB might be stuck at startLevel 70 and never reach startLevel 100 if thing configs are broken.
Even if openHAB reaches startLevel 100 it's possible that the item state restore event (e.g. from MapDB) is queued up so that the item changes to the restored state significantly after openHAB reached startLevel 100 (I've seen up to 15s).

It would be very helpful if there was an uptime field in systemInfo that would contain the openHAB uptime e.g. in secs.
That way HABApp could easily differentiate e.g. between a openHAB restart and a HABApp restart.

@spacemanspiff2007 spacemanspiff2007 added the enhancement An enhancement or new feature of the Core label Jun 14, 2023
@spacemanspiff2007
Copy link
Contributor Author

spacemanspiff2007 commented Sep 4, 2023

@J-N-K Would you mind taking a look at this? It would be tremendously helpful to sync the startup with HABApp if there was a field that would contain the openHAB system uptime e.g. as an integer and it should be a very tiny code change.

e.g. like this:

{
  "version": "5",
  "locale": "de_DE",
  "measurementSystem": "SI",
  "uptime": 355,     <-------------- Uptime in seconds, here 5 mins and 55 secs
  "runtimeInfo": {
    "version": "4.0.0",
    "buildString": "Release Build"
  },
  "links": [
    ...
  ]
}

An alternative could also be to just add the time started as an ISO timestamp. (e.g. 2023-09-06T12:02:22+00:00)

[I hope it's okay to ping you - if not please let me know and I will refrain from pinging you for feature requests in the future]

@spacemanspiff2007
Copy link
Contributor Author

Thank you very much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant