[Article] Installation et premiers pas avec ESPHome

Un article pour installer et commencer avec ESPHome.

Bonne lecture et a vos projets !

7 « J'aime »

2 messages ont été scindés en un nouveau sujet : Commentaires Article ESPHome

Bonjour
Il semblerai qu’il y ai une erreur dans le Yaml

Voici ce qui marche chez moi

binary_sensor:
# statut
  - platform: status
    name: "Statut"

sensor:
# Qualité du signal
  - platform: wifi_signal
    name: "Signal Wifi"
    update_interval: 60s
# Temps de fonctionnement
  - platform: uptime
    name: "Allumé depuis (s)"
    id: uptime_sec
    
switch:
# Bouton de redémarrage
  - platform: restart
    name: "Redémarrage"

# Transformation des secondes en jours
text_sensor:
  - platform: template
    name: "Allumé depuis (j)"
    lambda: |-
      int seconds = (id(uptime_sec).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600); 
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };          
    icon: mdi:clock-start
    update_interval: 60s


Bonsoir à tous