DOMO22 - Configuration Complète
Configuration ESPHome complète pour la centrale DOMO22 avec 8 relais, 8 entrées et capteurs BME280, BH1750, DS18B20.
⚙️ Configuration de Base
# Configuration de base DOMO22
esphome:
name: domo22
friendly_name: "Centrale DOMO22"
platform: ESP32
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "DOMO22-Fallback"
password: !secret ap_password
web_server:
port: 80
api:
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_password
logger:
level: DEBUG
i2c:
sda: GPIO21
scl: GPIO22
scan: true
frequency: 400kHz
🔌 Sorties Relais (8 canaux)
# Sorties relais DOMO22
switch:
- platform: gpio
pin: GPIO13
name: "Relais 1 - Éclairage Principal"
id: relay_1
icon: "mdi:lightbulb"
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- logger.log: "Relais 1 activé"
on_turn_off:
- logger.log: "Relais 1 désactivé"
- platform: gpio
pin: GPIO12
name: "Relais 2 - Éclairage Secondaire"
id: relay_2
icon: "mdi:lightbulb-outline"
restore_mode: RESTORE_DEFAULT_OFF
# ... 6 autres relais
💡 Informations importantes
- Prérequis : ESPHome 2024.10.0 ou supérieur
- Plateforme : ESP32 (ESP32-WROOM-32)
- Mémoire requise : ~300 KB flash, ~40 KB RAM
- Fichier secrets.yaml : N'oubliez pas de créer ce fichier avec vos identifiants
- Premier flash : Utilisez un câble USB, ensuite OTA disponible
📊 Dashboard Lovelace
# Dashboard DOMO22
title: Centrale DOMO22
views:
- title: Contrôle
path: control
cards:
- type: entities
title: Relais
entities:
- entity: switch.relais_1_eclairage_principal
- entity: switch.relais_2_eclairage_secondaire
- entity: switch.relais_3_prise_salon
- entity: switch.relais_4_ventilation
- entity: switch.relais_5_chauffage
- entity: switch.relais_6_pompe
- entity: switch.relais_7_portail
- entity: switch.relais_8_reserve
- type: vertical-stack
cards:
- type: sensor
entity: sensor.temperature_ambiante
graph: line
- type: sensor
entity: sensor.humidite_ambiante
graph: line
🤖 Automatisations
# Automatisations DOMO22
automation:
- alias: "Éclairage automatique mouvement"
trigger:
- platform: state
entity_id: binary_sensor.entree_2_detecteur_mouvement
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.luminosite
below: 50
action:
- service: switch.turn_on
target:
entity_id: switch.relais_1_eclairage_principal
- delay: '00:05:00'
- service: switch.turn_off
target:
entity_id: switch.relais_1_eclairage_principal
💡 Intégration Home Assistant
- Découverte automatique : Le DOMO22 sera détecté automatiquement
- API nécessaire : Assurez-vous que l'API est configurée dans ESPHome
- Cartes Lovelace : Copiez le code dans votre configuration UI
- Automatisations : À ajouter dans configuration.yaml ou via l'interface
💻 Programme de Test Arduino
/*
* DOMO22 Test Program
* Test des relais et entrées
*/
// Pins des relais
const int RELAY_PINS[] = {13, 12, 14, 27, 26, 25, 33, 32};
const int NUM_RELAYS = 8;
// Pins des entrées
const int INPUT_PINS[] = {34, 35, 36, 39, 4, 16, 17, 5};
const int NUM_INPUTS = 8;
void setup() {
Serial.begin(115200);
Serial.println("DOMO22 Test Program");
// Configuration des relais
for(int i = 0; i < NUM_RELAYS; i++) {
pinMode(RELAY_PINS[i], OUTPUT);
digitalWrite(RELAY_PINS[i], LOW);
}
// Configuration des entrées
for(int i = 0; i < NUM_INPUTS; i++) {
pinMode(INPUT_PINS[i], INPUT_PULLUP);
}
Serial.println("Initialisation terminée");
}
void loop() {
// Test séquentiel des relais
testRelays();
// Lecture des entrées
readInputs();
delay(1000);
}
void testRelays() {
static int currentRelay = 0;
// Éteindre tous les relais
for(int i = 0; i < NUM_RELAYS; i++) {
digitalWrite(RELAY_PINS[i], LOW);
}
// Allumer le relais actuel
digitalWrite(RELAY_PINS[currentRelay], HIGH);
Serial.print("Relais ");
Serial.print(currentRelay + 1);
Serial.println(" activé");
currentRelay = (currentRelay + 1) % NUM_RELAYS;
}
void readInputs() {
for(int i = 0; i < NUM_INPUTS; i++) {
int state = digitalRead(INPUT_PINS[i]);
if(state == LOW) { // Active à l'état bas
Serial.print("Entrée ");
Serial.print(i + 1);
Serial.println(" activée");
}
}
}
💡 Compilation et Upload
- IDE : Arduino IDE 2.0+ ou PlatformIO
- Carte : ESP32 Dev Module
- Vitesse : 115200 baud
- Partition : Default 4MB with SPIFFS
- Librairies requises : Aucune (code de base)
📚 Documentation Complète
Cette page présente les fichiers de code pour le DOMO22. Consultez notre documentation complète pour plus d'informations.