2024-07-06 20:37:22 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2024-08-29 23:16:01 +02:00
|
|
|
<title>SensorCube</title>
|
2024-07-06 20:37:22 +02:00
|
|
|
<script type="text/javascript" src="utils.js"></script>
|
|
|
|
<script type="text/javascript">
|
2024-08-29 23:16:01 +02:00
|
|
|
function updateSensorTable(sensordata)
|
2024-07-06 20:37:22 +02:00
|
|
|
{
|
2024-08-29 23:16:01 +02:00
|
|
|
elements = ['temperature', 'humidity', 'co2'];
|
2024-07-06 20:37:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
elements.forEach(function(item, index) {
|
2024-08-29 23:16:01 +02:00
|
|
|
elem = document.getElementById('scd30_' + item);
|
|
|
|
val = sensordata['scd30'][item];
|
2024-07-06 20:37:22 +02:00
|
|
|
elem.textContent = val.toFixed(2);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function setup()
|
|
|
|
{
|
2024-08-29 23:16:01 +02:00
|
|
|
getSensorData(updateSensorTable);
|
|
|
|
setInterval(function() { getSensorData(updateSensorTable) }, 60000);
|
2024-07-06 20:37:22 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
th, td {
|
|
|
|
border: 1px solid black;
|
|
|
|
padding: 0.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
td.value {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
|
|
|
table {
|
|
|
|
border-collapse: collapse;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body onLoad="setup()">
|
2024-08-29 23:16:01 +02:00
|
|
|
<h1>SensorCube</h1>
|
2024-07-06 20:37:22 +02:00
|
|
|
<table>
|
|
|
|
<tr>
|
2024-08-29 23:16:01 +02:00
|
|
|
<th>Sensor</th>
|
2024-07-06 20:37:22 +02:00
|
|
|
<th>Messwert</th>
|
|
|
|
<th>Einheit</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-08-29 23:16:01 +02:00
|
|
|
<td>SCD30 CO₂</td>
|
|
|
|
<td class="value" id="scd30_co2">----,--</td>
|
|
|
|
<td>ppm</td>
|
2024-07-06 20:37:22 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-08-29 23:16:01 +02:00
|
|
|
<td>SCD30 Temperatur</td>
|
|
|
|
<td class="value" id="scd30_temperature">-,--</td>
|
|
|
|
<td>°C</td>
|
2024-07-06 20:37:22 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-08-29 23:16:01 +02:00
|
|
|
<td>SCD30 Luftfeuchtigkeit</td>
|
|
|
|
<td class="value" id="scd30_humidity">-,--</td>
|
|
|
|
<td>%rH</td>
|
2024-07-06 20:37:22 +02:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|