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:
PaulVua
2026-06-02 14:27:11 +02:00
parent 4767b145b2
commit 4f3d273981
14 changed files with 455 additions and 9 deletions

View File

@@ -269,6 +269,38 @@ AccuracySec=1s
WantedBy=timers.target
EOL
# Create service and timer files for CCS811 air-quality (eCO2/TVOC) Data
cat > /etc/systemd/system/nebuleair-ccs811-data.service << 'EOL'
[Unit]
Description=NebuleAir CCS811 Air-Quality (eCO2/TVOC) Data Collection Service
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /var/www/nebuleair_pro_4g/CCS811/write_data.py
User=root
WorkingDirectory=/var/www/nebuleair_pro_4g
StandardOutput=append:/var/www/nebuleair_pro_4g/logs/ccs811_service.log
StandardError=append:/var/www/nebuleair_pro_4g/logs/ccs811_service_errors.log
[Install]
WantedBy=multi-user.target
EOL
cat > /etc/systemd/system/nebuleair-ccs811-data.timer << 'EOL'
[Unit]
Description=Run NebuleAir CCS811 Air-Quality Data Collection every 10 seconds
Requires=nebuleair-ccs811-data.service
[Timer]
OnBootSec=10s
OnUnitActiveSec=10s
AccuracySec=1s
[Install]
WantedBy=timers.target
EOL
# Create service and timer files for Database Cleanup
cat > /etc/systemd/system/nebuleair-db-cleanup-data.service << 'EOL'
[Unit]
@@ -402,7 +434,7 @@ systemctl daemon-reload
# Enable and start all timers
echo "Enabling and starting all services..."
for service in npm envea sara bme280 mppt mhz19 s88 db-cleanup noise; do
for service in npm envea sara bme280 mppt mhz19 s88 ccs811 db-cleanup noise; do
systemctl enable nebuleair-$service-data.timer
systemctl start nebuleair-$service-data.timer
echo "Started nebuleair-$service-data timer"