I am new to Kumo apps and have no experience with Javascript before this. The code below is just from me getting used to KumoApps and is not entirely useful as-is.
Can someone explain two things:
1) why does this code always output CurrTime as "0001-01-01T00:00:00", and not the actual date/time?
Code:
var tags = <#tags_[12|13|32|52|62|72|21]_N#>;
tags.forEach(
function (tag){
tag.updated = function(){
if((new Date()).getHours()==9){
var CurrTime=KumoApp.FormatDateTime(KumoApp.tick,"s")
KumoApp.Log(CurrTime+": "+
tag.name+": "+tag.temperature);
}
}
}
);
Sample log:
10/9/2018 5:54 AM 0001-01-01T00:00:00: thermostat: 22.77777777777778
10/9/2018 5:53 AM 0001-01-01T00:00:00: null: 22.77777777777778
10/9/2018 5:51 AM 0001-01-01T00:00:00: attic: 21.304888513353138
10/9/2018 5:51 AM 0001-01-01T00:00:00: thermostat: 22.77777777777778