Initial commit ESP32 Feuchtigkeit Sensor Projekt
This commit is contained in:
29
docs/01_installation.md
Normal file
29
docs/01_installation.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 🧩 Installation
|
||||
|
||||
## Voraussetzungen
|
||||
- Visual Studio Code mit PlatformIO
|
||||
- WLAN und Home Assistant im gleichen Netzwerk
|
||||
- MQTT-Broker (z. B. Mosquitto) aktiv
|
||||
- Benutzername und Passwort für MQTT vorhanden
|
||||
|
||||
## Schritte
|
||||
1. **Projekt klonen oder entpacken**
|
||||
```bash
|
||||
git clone https://github.com/deinuser/esp32-feuchtesensor.git
|
||||
```
|
||||
2. **In VS Code öffnen**
|
||||
Öffne den Projektordner in Visual Studio Code → PlatformIO wird automatisch aktiv.
|
||||
3. **WLAN- und MQTT-Zugangsdaten anpassen**
|
||||
In `src/main.cpp` bearbeiten:
|
||||
```cpp
|
||||
const char* ssid = "DEIN_WLAN";
|
||||
const char* password = "DEIN_PASSWORT";
|
||||
const char* mqtt_server = "192.168.x.x";
|
||||
const char* mqtt_user = "mqttuser";
|
||||
const char* mqtt_pass = "mqttpasswort";
|
||||
```
|
||||
4. **ESP32 anschließen und flashen**
|
||||
Über **PlatformIO → Upload** kompilieren und auf den ESP32 hochladen.
|
||||
Serielle Ausgabe mit `PlatformIO → Monitor` prüfen (Baudrate 115200).
|
||||
5. **Verbindung prüfen**
|
||||
Nach dem Neustart sollte der ESP32 die MQTT-Themen automatisch an den Broker senden.
|
||||
48
docs/02_home_assistant_integration.md
Normal file
48
docs/02_home_assistant_integration.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# 🏠 Home Assistant Integration
|
||||
|
||||
## MQTT-Integration aktivieren
|
||||
- Einstellungen → Geräte & Dienste → Integration hinzufügen → MQTT
|
||||
- Falls Home Assistant keinen eigenen Broker nutzt, installiere den **Mosquitto-Add-on**.
|
||||
|
||||
## Entitäten definieren
|
||||
In `configuration.yaml`:
|
||||
```yaml
|
||||
binary_sensor:
|
||||
- name: "Feuchte Alarm"
|
||||
state_topic: "home/feuchte/alarm"
|
||||
payload_on: "1"
|
||||
payload_off: "0"
|
||||
device_class: moisture
|
||||
|
||||
sensor:
|
||||
- name: "Feuchte Sensor 1"
|
||||
state_topic: "home/feuchte/sensor1"
|
||||
unit_of_measurement: "%"
|
||||
- name: "Feuchte Sensor 2"
|
||||
state_topic: "home/feuchte/sensor2"
|
||||
unit_of_measurement: "%"
|
||||
- name: "Feuchte Sensor 3"
|
||||
state_topic: "home/feuchte/sensor3"
|
||||
unit_of_measurement: "%"
|
||||
- name: "Feuchte Sensor 4"
|
||||
state_topic: "home/feuchte/sensor4"
|
||||
unit_of_measurement: "%"
|
||||
```
|
||||
|
||||
## Anzeige im Dashboard
|
||||
1. Übersicht → Bearbeiten → Karte hinzufügen → Entität.
|
||||
2. Suche nach `feuchte` → Sensoren oder Alarm auswählen.
|
||||
|
||||
## Beispiel-Automation
|
||||
```yaml
|
||||
automation:
|
||||
- alias: "Feuchtealarm"
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.feuchte_alarm
|
||||
to: "on"
|
||||
action:
|
||||
- service: notify.mobile_app_iphone
|
||||
data:
|
||||
message: "🚨 Feuchte erkannt im Gartenbereich!"
|
||||
```
|
||||
8
docs/03_troubleshooting.md
Normal file
8
docs/03_troubleshooting.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# 🔧 Troubleshooting
|
||||
|
||||
| Problem | Ursache | Lösung |
|
||||
|----------|----------|---------|
|
||||
| Keine MQTT-Daten in HA | Broker nicht erreichbar | Prüfe IP-Adresse und Zugangsdaten in `main.cpp` |
|
||||
| ESP32 verbindet sich nicht mit WLAN | SSID oder Passwort falsch | Werte prüfen, ggf. Serial Monitor ansehen |
|
||||
| Sensorwerte zu hoch/niedrig | Kalibrierung nötig | Werte `V_TROCKEN` und `V_NASS` anpassen |
|
||||
| Fehlermeldung `filename` in HA | YAML-Dateiname unzulässig | Achte auf Kleinbuchstaben und `.yaml`-Endung |
|
||||
19
docs/04_developer_notes.md
Normal file
19
docs/04_developer_notes.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# 🧠 Entwicklerhinweise
|
||||
|
||||
## Kalibrierung der Sensoren
|
||||
```cpp
|
||||
float V_TROCKEN = 2.80f; // Spannung an Luft
|
||||
float V_NASS = 1.20f; // Spannung im Wasser
|
||||
float ALERT_THRESHOLD = 70.0f; // Alarm ab 70%
|
||||
```
|
||||
Passe die Werte so an, dass „Trocken“ und „Nass“ korrekt erkannt werden.
|
||||
|
||||
## Erweiterungsideen
|
||||
- **Mehr Sensoren:** bis zu 4 gleichzeitig über analoge Eingänge (GPIO 32–35)
|
||||
- **Bluetooth-Unterstützung:** statt WLAN kann BLE genutzt werden (z. B. via ESPHome)
|
||||
- **Relaissteuerung:** Schalte Bewässerungspumpe bei Alarm automatisch ein
|
||||
- **OLED-Display:** Anzeige der Feuchtewerte direkt am Gerät
|
||||
|
||||
📘 **Autor:** Ismail Ali
|
||||
📅 Stand: November 2025
|
||||
Lizenz: MIT License
|
||||
Reference in New Issue
Block a user