> select * from Waschkueche_Waschmaschine_letzteZykluszeit
name: Waschkueche_Waschmaschine_letzteZykluszeit
time value
---- -----
1516470604809000000 11554769
The sitemap shows 03:12 h after the rule updates the value but 04:12 h after the value is restored from the database.
How can I set up that no timezone offset is applied to this value when it is restored?
You should not do that. DateTime is designed to store absolute dates and times and is not suitable for storing durations.
You need to store the duration as a Number (number of minutes, number of seconds, number of milliseconds) and use a JS transform in the Item’s label or a Rule and a Proxy Item to convert that Number to Hours and Minutes.
Here is the JS transform I use to convert the uptime reported by my sonoffs in hours to days:hours:minutes:seconds.
(function(i) {
if(isNaN(i)) return "NA";
var days = Math.floor(i/24);
var hours = i%24;
var pad = "00";
return days+":"+(pad+hours).slice(-pad.length)+":00:00";
})(input)
I still don’t get how its done with files, as I usually create just the items in conf files, and from Paper UI , just create new items that link to the various parameters.
I don’t use .things files. But the Thing is irrelevant. So long as it is a Number type Channel linked to a Number Item, you just need to transform the label of the Item.