Actualiser README.md
This commit is contained in:
116
README.md
116
README.md
@@ -1,38 +1,39 @@
|
||||
# 🌡️ Gestion des sondes domotiques
|
||||
# 🔌 Gestion des sondes domotiques
|
||||
|
||||
[](https://python.org)
|
||||
[](https://mj91.fr:448/michel/Gestion_sondes)
|
||||
[](https://mj91.fr:448)
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Application de **surveillance des températures** avec alertes, visualisation Streamlit, et déploiement automatisé via Gitea + Supervisor.
|
||||
|
||||
---
|
||||
|
||||
## 🧩 Fonctionnalités principales
|
||||
## 🌟 Fonctionnalités principales
|
||||
|
||||
- 🔍 Lecture de capteurs **DS18B20** et **DHT22**
|
||||
- 📨 Transmission via **MQTT**
|
||||
- 📊 Interface **Streamlit** (app.domo91.fr)
|
||||
- 🔔 Alertes **email / Telegram** si dépassement > 30 minutes
|
||||
- 🧠 Déploiement auto avec **`deploy.sh`**
|
||||
- 🧾 Stockage SQL sur **MySQL (VPS)**
|
||||
- 🔢 Lecture de capteurs **DS18B20** et **DHT22**
|
||||
- 📡 Transmission via **MQTT**
|
||||
- 🌐 Interface Streamlit ([app.domo91.fr](https://app.domo91.fr))
|
||||
- ⚠️ Alertes email / Telegram si dépassement > 30 minutes
|
||||
- 🚀 Déploiement auto avec `deploy.sh`
|
||||
- 📁 Stockage **SQL** sur MySQL (VPS)
|
||||
|
||||
---
|
||||
|
||||
## 📊 Exemple de visualisation
|
||||
## 📈 Exemple de visualisation
|
||||
|
||||
Voici un aperçu d’un graphique dans l’interface Streamlit :
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
## 🗂️ Structure du projet
|
||||
## 📂 Structure du projet
|
||||
|
||||
| Fichier | Description |
|
||||
|-----------------------------|---------------------------------------------------------------------|
|
||||
|----------------------|----------------------------------------------|
|
||||
| `Monitor.py` | Analyse de température et alertes |
|
||||
| `Streamlit.py` | Interface graphique web |
|
||||
| `domo91.py` | Interface graphique web |
|
||||
| `Cuisine_saclay.py` | Script capteur pour le site de Saclay |
|
||||
| `Cuisine_meudon.py` | Script capteur pour Meudon |
|
||||
| `check_supervisor.py`| Vérifie l’état des scripts supervisés |
|
||||
@@ -41,12 +42,89 @@ Voici un aperçu d’un graphique dans l’interface Streamlit :
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Installation locale
|
||||
## 🛠️ Installation locale
|
||||
|
||||
```bash
|
||||
git clone https://mj91.fr:448/michel/Gestion_sondes.git
|
||||
cd Gestion_sondes
|
||||
# Clone depuis Gitea
|
||||
git clone https://mj91.fr:448/michel/gestion_sondes.git
|
||||
cd gestion_sondes
|
||||
|
||||
# Environnement virtuel
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate # Linux/macOS
|
||||
.venv\Scripts\activate # Windows
|
||||
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🏛️ Architecture globale
|
||||
|
||||
- Données temps réel envoyées par ESP8266 (MQTT)
|
||||
- Base MySQL avec tables par site (`Saclay`, `Meudon`, `Roissy`...)
|
||||
- Script `Monitor.py` tournant en boucle 5 minutes (avec `supervisord`)
|
||||
- Application Streamlit avec login / rôle (accès personnalisé)
|
||||
- Alertes par Email / Telegram, PDF générables depuis l’app
|
||||
|
||||
---
|
||||
|
||||
## 🧰 Bases de données principales
|
||||
|
||||
### 📉 Températures
|
||||
- Tables : `Saclay`, `Meudon`, etc. (même structure)
|
||||
- Champs : `Id`, `Sonde`, `Temperature`, `Date`
|
||||
|
||||
### ⚠️ Alertes
|
||||
- Tables : `Alertes_Saclay`, `Alertes_Meudon`, etc.
|
||||
- Champs : `Id`, `Sonde`, `Debut_defaut`, `Etat` (En cours, Acquitté, Test...)
|
||||
|
||||
### 🏢 Chambres froides (seuils)
|
||||
- Table : `Chambres_froides`
|
||||
- Champs : `Id`, `Lieu`, `Sonde`, `Temp_Max`, `Etat` (ON/OFF)
|
||||
|
||||
### 🔐 Authentification
|
||||
- Table : `MotsDePasse`
|
||||
- Champs : `Utilisateur`, `MotDePasse`, `Lieu`, `Role`
|
||||
|
||||
### 📅 Inventaires
|
||||
- Champs : `Id_inventaire`, `Id_Article`, `Quantité`, `Prix`, `Date`
|
||||
- Remplissage via Excel nettoyé par macro VBA ou formulaire
|
||||
|
||||
---
|
||||
|
||||
## 💪 Monitor.py
|
||||
|
||||
- 🔄 Boucle toutes les 5 minutes
|
||||
- ⚠️ Déclenche une alerte si seuil dépassé pendant 30 minutes
|
||||
- ✅ Acquittement automatique quand retour à la normale
|
||||
- 📧 Notifications par Email + Telegram
|
||||
|
||||
---
|
||||
|
||||
## 💼 Bonnes pratiques Git
|
||||
|
||||
- Branche `develop` : développement
|
||||
- Branche `product` : version stable (protégée)
|
||||
- Pas de push direct sur `product`
|
||||
- Utiliser `pull --rebase` pour éviter les conflits
|
||||
- `deploy.sh` pour déploiement manuel si besoin
|
||||
|
||||
---
|
||||
|
||||
## 🌟 Idées d’amélioration
|
||||
|
||||
- 📱 Alertes SMS via API (Twilio ou OVH)
|
||||
- 📊 Historique détaillé + export CSV
|
||||
- 📋 Récap PDF automatique chaque matin
|
||||
- 📆 Maintenance planifiée avec calendrier
|
||||
- 🌐 Tableau de bord multi-sites consolidé
|
||||
|
||||
---
|
||||
|
||||
## 📖 Auteur & contact
|
||||
|
||||
Projet développé par [Michel]
|
||||
Site principal : [https://app.domo91.fr](https://app.domo91.fr)
|
||||
Gitea auto-hébergé sur : [https://mj91.fr](https://mj91.fr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user