v1.10.0: intégration capteur CCS811 (TVOC/eCO2, I2C)
Nouveau capteur de qualité d'air CCS811 sur le bus I2C, calqué sur le pattern S88 (local-only, pas encore dans le payload de transmission). - CCS811/get_data.py (lecture live) + write_data.py (timer 10s, self-heal table) - table data_CCS811 (timestamp, eCO2, TVOC) dans create_db.py - config CCS811 (bool) + CCS811_address (0x5A/0x5B, défaut 0x5A) dans set_config.py - service+timer systemd nebuleair-ccs811-data (10s) + ajout boucle d'activation - admin.html: case d'activation + dropdown adresse I2C - sensors.html: carte Get Data (TVOC + eCO2) - database.html + launcher.php: consultation/export/stats data_CCS811 - lib adafruit-circuitpython-ccs811 dans installation_part1.sh - CCS811/README.md: câblage, adresses, warning clock-stretching I2C sur Pi - CLAUDE.md + changelog mis à jour Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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', 'data_S88'];
|
||||
$tables = ['data_NPM', 'data_NPM_5channels', 'data_BME280', 'data_envea', 'data_WIND', 'data_MPPT', 'data_NOISE', 'data_MHZ19', 'data_S88', 'data_CCS811'];
|
||||
|
||||
$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', 'data_S88'];
|
||||
$allowedTables = ['data_NPM', 'data_NPM_5channels', 'data_BME280', 'data_envea', 'data_WIND', 'data_MPPT', 'data_NOISE', 'data_MHZ19', 'data_S88', 'data_CCS811'];
|
||||
|
||||
if (!in_array($table, $allowedTables)) {
|
||||
header('Content-Type: application/json');
|
||||
@@ -862,7 +862,8 @@ if ($type == "download_full_table") {
|
||||
'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_S88' => 'TimestampUTC,CO2_ppm'
|
||||
'data_S88' => 'TimestampUTC,CO2_ppm',
|
||||
'data_CCS811' => 'TimestampUTC,eCO2_ppm,TVOC_ppb'
|
||||
];
|
||||
|
||||
try {
|
||||
@@ -1016,6 +1017,12 @@ if ($type == "s88") {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
if ($type == "ccs811") {
|
||||
$command = 'sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/CCS811/get_data.py';
|
||||
$output = shell_exec($command);
|
||||
echo $output;
|
||||
}
|
||||
|
||||
|
||||
if ($type == "table_mesure") {
|
||||
$table=$_GET['table'];
|
||||
@@ -1674,6 +1681,10 @@ if ($type == "get_systemd_services") {
|
||||
'description' => 'Reads CO2 concentration from MH-Z19 sensor',
|
||||
'frequency' => 'Every 2 minutes'
|
||||
],
|
||||
'nebuleair-ccs811-data.timer' => [
|
||||
'description' => 'Reads eCO2/TVOC from CCS811 air-quality sensor',
|
||||
'frequency' => 'Every 10 seconds'
|
||||
],
|
||||
'nebuleair-s88-data.timer' => [
|
||||
'description' => 'Reads CO2 concentration from Senseair S88 sensor',
|
||||
'frequency' => 'Every 10 seconds'
|
||||
@@ -1765,6 +1776,7 @@ if ($type == "restart_systemd_service") {
|
||||
'nebuleair-noise-data.timer',
|
||||
'nebuleair-mhz19-data.timer',
|
||||
'nebuleair-s88-data.timer',
|
||||
'nebuleair-ccs811-data.timer',
|
||||
'nebuleair-db-cleanup-data.timer',
|
||||
'nebuleair-wifi-powersave.timer',
|
||||
'nebuleair-cpu-power.service',
|
||||
@@ -1831,6 +1843,7 @@ if ($type == "toggle_systemd_service") {
|
||||
'nebuleair-noise-data.timer',
|
||||
'nebuleair-mhz19-data.timer',
|
||||
'nebuleair-s88-data.timer',
|
||||
'nebuleair-ccs811-data.timer',
|
||||
'nebuleair-db-cleanup-data.timer',
|
||||
'nebuleair-wifi-powersave.timer',
|
||||
'nebuleair-cpu-power.service',
|
||||
|
||||
Reference in New Issue
Block a user