SensorCube-Firmware/data/htdocs/index.html

67 lines
1.2 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
2024-08-29 23:16:01 +02:00
<title>SensorCube</title>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
2024-08-29 23:16:01 +02:00
function updateSensorTable(sensordata)
{
2024-08-29 23:16:01 +02:00
elements = ['temperature', 'humidity', 'co2'];
elements.forEach(function(item, index) {
2024-08-29 23:16:01 +02:00
elem = document.getElementById('scd30_' + item);
val = sensordata['scd30'][item];
elem.textContent = val.toFixed(2);
});
}
function setup()
{
2024-08-29 23:16:01 +02:00
getSensorData(updateSensorTable);
setInterval(function() { getSensorData(updateSensorTable) }, 60000);
}
</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>
<table>
<tr>
2024-08-29 23:16:01 +02:00
<th>Sensor</th>
<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>
</tr>
<tr>
2024-08-29 23:16:01 +02:00
<td>SCD30 Temperatur</td>
<td class="value" id="scd30_temperature">-,--</td>
<td>°C</td>
</tr>
<tr>
2024-08-29 23:16:01 +02:00
<td>SCD30 Luftfeuchtigkeit</td>
<td class="value" id="scd30_humidity">-,--</td>
<td>%rH</td>
</tr>
</table>
</body>
</html>