+
+// reload current values
+setInterval(
+ function() {
+ var airvalue = document.getElementById('currentairvalue');
+ var airtime = document.getElementById('currentairtime');
+ var watervalue = document.getElementById('currentwatervalue');
+ var watertime = document.getElementById('currentwatertime');
+ fetch(api_url_currentair)
+ .then((resp) => resp.json())
+ .then(function(data) {
+ airvalue.innerText = data['value'].toFixed(1);
+ airtime.innerText = strftime('%Y-%m-%d H:%M', data['timestamp']);
+ })
+ .catch(function(error) {
+ console.log(error);
+ });
+ fetch(api_url_currentwater)
+ .then((resp) => resp.json())
+ .then(function(data) {
+ watervalue.innerText = data['value'].toFixed(1);
+ watertime.innerText = strftime('%Y-%m-%d H:%M', data['timestamp']);
+ })
+ .catch(function(error) {
+ console.log(error);
+ });
+ },
+ refresh_interval
+);