I wonder if that might be a Homie device,
I have done something similar for my Homie-based sensor device in the following way:
.items
String S02D001_nUptime { mqtt="<[mosquitto:devices/12138ee0/system/uptime:state:JS(uptime.js)]" }
uptime.js
(function(seconds) {
var retval = “”;
var days = Math.floor(seconds / (24 * 60 * 60));
seconds = seconds % (24 * 60 * 60);
var hours = Math.floor(seconds / (60 * 60));
seconds = seconds % (60 * 60);
var minutes = Math.floor(seconds / (60));
seconds = seconds % (60);
if (days > 0) {
if (days > 1) {
retval = retval + days + " " + "days ";
}
else {
retval = retval + days + " " + "day ";
}
}
retval = retval + hours + ":";
if (minutes < 10) {
retval = retval + "0" + minutes;
}
else {
retval = retval + minutes;
}
return retval;
})(input)
.sitemap
Text item=S02D001_nUptime label="Uptime [%s]"
With this in place I get the uptime reported as for example “9 days 13:43”.
I choose the format to be similar to that being reported by the System Info binding. Obviously, you can tweak the JS code to format it any way you like.
If you want/need your uptime item in openHAB to be of type DateTime, then I guess this should be possible too - although I have not tried it.