v1.9.13: Capteur CO2 Senseair S88 - scaffolding

Table data_S88, flag config S88 + port configurable S88_port
(default /dev/ttyAMA5), service/timer systemd 10s, carte
sensors.html, endpoint launcher.php, toggle admin.html.

read_co2() est un stub NotImplementedError en attente du datasheet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-06-01 16:15:37 +02:00
parent 05734715a7
commit 239bdfea69
10 changed files with 304 additions and 5 deletions

View File

@@ -794,7 +794,7 @@ if ($type == "db_table_stats") {
$fileSizeMB = round($fileSizeBytes / (1024 * 1024), 2);
// Sensor data tables to inspect
$tables = ['data_NPM', 'data_NPM_5channels', 'data_BME280', 'data_envea', 'data_WIND', 'data_MPPT', 'data_NOISE', 'data_MHZ19'];
$tables = ['data_NPM', 'data_NPM_5channels', 'data_BME280', 'data_envea', 'data_WIND', 'data_MPPT', 'data_NOISE', 'data_MHZ19', 'data_S88'];
$tableStats = [];
foreach ($tables as $tableName) {
@@ -844,7 +844,7 @@ if ($type == "download_full_table") {
$table = $_GET['table'] ?? '';
// Whitelist of allowed tables
$allowedTables = ['data_NPM', 'data_NPM_5channels', 'data_BME280', 'data_envea', 'data_WIND', 'data_MPPT', 'data_NOISE', 'data_MHZ19'];
$allowedTables = ['data_NPM', 'data_NPM_5channels', 'data_BME280', 'data_envea', 'data_WIND', 'data_MPPT', 'data_NOISE', 'data_MHZ19', 'data_S88'];
if (!in_array($table, $allowedTables)) {
header('Content-Type: application/json');
@@ -861,7 +861,8 @@ if ($type == "download_full_table") {
'data_WIND' => 'TimestampUTC,Wind_speed_kmh,Wind_direction_V',
'data_MPPT' => 'TimestampUTC,Battery_voltage,Battery_current,Solar_voltage,Solar_power,Charger_status',
'data_NOISE' => 'TimestampUTC,Current_LEQ,DB_A_value',
'data_MHZ19' => 'TimestampUTC,CO2_ppm'
'data_MHZ19' => 'TimestampUTC,CO2_ppm',
'data_S88' => 'TimestampUTC,CO2_ppm'
];
try {
@@ -1009,6 +1010,12 @@ if ($type == "mhz19") {
echo $output;
}
if ($type == "s88") {
$command = 'sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/S88/get_data.py';
$output = shell_exec($command);
echo $output;
}
if ($type == "table_mesure") {
$table=$_GET['table'];
@@ -1666,6 +1673,10 @@ if ($type == "get_systemd_services") {
'description' => 'Reads CO2 concentration from MH-Z19 sensor',
'frequency' => 'Every 2 minutes'
],
'nebuleair-s88-data.timer' => [
'description' => 'Reads CO2 concentration from Senseair S88 sensor',
'frequency' => 'Every 10 seconds'
],
'nebuleair-db-cleanup-data.timer' => [
'description' => 'Cleans up old data from database',
'frequency' => 'Daily'
@@ -1752,6 +1763,7 @@ if ($type == "restart_systemd_service") {
'nebuleair-mppt-data.timer',
'nebuleair-noise-data.timer',
'nebuleair-mhz19-data.timer',
'nebuleair-s88-data.timer',
'nebuleair-db-cleanup-data.timer',
'nebuleair-wifi-powersave.timer',
'nebuleair-cpu-power.service',
@@ -1817,6 +1829,7 @@ if ($type == "toggle_systemd_service") {
'nebuleair-mppt-data.timer',
'nebuleair-noise-data.timer',
'nebuleair-mhz19-data.timer',
'nebuleair-s88-data.timer',
'nebuleair-db-cleanup-data.timer',
'nebuleair-wifi-powersave.timer',
'nebuleair-cpu-power.service',