UNE BOITE AUX LETTRES CONNECTÉE

La vidéo

Le Schéma

Les Composants

Wemos D1 mini – Amazon

IRFZ44N – Amazon

DHT22 – Amazon

Capteur de porte – Amazon

Panneau solaire – Amazon

Module de charge 03962a –  Amazon

Batteries 18650 – Amazon

Les Fichiers 3D

Le Code ESP HOME

esphome:
  name: esp_boite_aux_lettres
  platform: ESP8266
  board: d1_mini
 
wifi:
  ssid: "SSID"
  password: "PASSWORD"
 
  ap:
    ssid: "Esp Boite Aux Lettres"
    password: "esp-boiteauxlettres"
 
captive_portal:
logger:
api:
ota:
binary_sensor:
  - platform: gpio
    pin: D1
    id: petit_capteur
    name: "Petite Porte Boite Aux Lettres"
    on_press:
      then:
      - homeassistant.service:
          service: input_datetime.set_datetime
          data:
            entity_id: input_datetime.heure_courrier
          data_template:
            date: '{{ as_timestamp(now())|timestamp_custom(''%Y-%m-%d'') }}'
            time: '{{ now().strftime(''%H:%M:%S'') }}' 
 
      - homeassistant.service:
          service: notify.notify
          data:
            message: "Il y a du courrier dans la boite aux lettres"
            title: "Courrier"
      - light.turn_on: light_led_boite_aux_lettres
      - delay: 0.2s
      - light.turn_off: light_led_boite_aux_lettres
      - delay: 0.2s
      - light.turn_on: light_led_boite_aux_lettres
      - delay: 0.2s
      - light.turn_off: light_led_boite_aux_lettres
      - delay: 0.2s
 
  - platform: gpio
    pin: D2
    id: grand_capteur
    name: "Grande Porte Boite Aux Lettres"
    on_press:
      then:
      - homeassistant.service:
          service: input_datetime.set_datetime
          data:
            entity_id: input_datetime.heure_courrier
          data_template:
            date: '{{ as_timestamp(now())|timestamp_custom(''%Y-%m-%d'') }}'
            time: '{{ now().strftime(''%H:%M:%S'') }}' 
 
      - homeassistant.service:
          service: notify.notify
          data:
            message: "Il y a un colis dans la boite aux lettres"
            title: "Courrier"
      - light.turn_on: light_led_boite_aux_lettres
      - delay: 0.5s
      - light.turn_off: light_led_boite_aux_lettres
      - delay: 0.5s
      - light.turn_on: light_led_boite_aux_lettres
      - delay: 0.5s
      - light.turn_off: light_led_boite_aux_lettres
      - delay: 0.5s
 
sensor:
  - platform: adc
    pin: VCC
    name: "Tension"
    id: tension_boite_aux_lettres
    update_interval: 10min
    filters:
      - multiply: 1.245
 
  - platform: dht
    pin: D4
    model: DHT22
    temperature:
      name: "Température Dehors"
    humidity:
      name: "Humidité Dehors"
    update_interval: 1min
 
  - platform: uptime
    name: "Temps De Fonctionnement"
    id: uptime_boite_aux_lettres
 
  - platform: wifi_signal
    name: "Signal Wifi"
    id: "wifi_signal_boite_aux_lettres"
    update_interval: 360s
 
light:
  - platform: binary
    id: light_led_boite_aux_lettres
    output: flash_led_boite_aux_lettres
 
output:
  - platform: gpio
    id: flash_led_boite_aux_lettres
    pin: D5

Code Interface Home Assistant

cards:
  - entities:
      - entity: input_datetime.heure_courrier
        name: Dernier Passage Du Facteur à
    type: entities
  - content: |
      {% if is_state('binary_sensor.petite_porte_boite_aux_lettres', 'off') %}
        Petite Porte Fermée
      {% elif is_state('binary_sensor.petite_porte_boite_aux_lettres', 'on') %}
        Petite Porte Ouverte
      {% else %}
        Petite Porte Inconnu
      {% endif %}
 
      {% if is_state('binary_sensor.grande_porte_boite_aux_lettres', 'off') %}
        Grande Porte Fermée
      {% elif is_state('binary_sensor.grande_porte_boite_aux_lettres', 'on') %}
        Grande Porte Ouverte
      {% else %}
        Grande Porte Inconnu
      {% endif %}
    title: État
    type: markdown
  - entities:
      - entity: sensor.tension_boite_aux_lettres
      - entity: sensor.signal_wifi_boite_aux_lettres
      - entity: sensor.temperature_dehors
      - entity: sensor.humidite_dehors
    title: Infos
    type: glance
title: Boite aux Lettres
type: vertical-stack