Mon problème
Hello
Je n’arrive pas à actionner un relai 5v relié à un wemos d1 mini sur le pin d1.
Quand ‹ Relay #1 › passe sur on ou off rien ne se passe au niveau du relai(pas de lumière, pas de clic…)
Le relai est correctement branché et fonctionnel puisqu’il est tous neuf et il marche avec une carte arduino uno classique.
Voici le code esphome:
esphome:
name: buzzer
esp8266:
board: d1_mini
wifi:
ssid: !secret ssid_répéteur
password: !secret password_wifi_répéteur
manual_ip:
# Set this to the IP of the ESP
static_ip: 192.168.1.98
# Set this to the IP address of the router. Often ends with .1
gateway: 192.168.1.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
ota:
captive_portal:
switch:
- platform: gpio
pin: D1
inverted: true
name: "Relay #1"
sensor:
- platform: wifi_signal
name: "Relai Signal WiFi"
update_interval: 60s
Voici les logs :
INFO Reading configuration /config/esphome/relai.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing buzzer (board: d1_mini; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|-- <ESPAsyncWebServer-esphome> 2.1.0
| |-- <ESPAsyncTCP-esphome> 1.2.3
| |-- <Hash> 1.0
| |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
Compiling /data/buzzer/.pioenvs/buzzer/src/main.cpp.o
Linking /data/buzzer/.pioenvs/buzzer/firmware.elf
RAM: [==== ] 39.9% (used 32652 bytes from 81920 bytes)
Flash: [==== ] 39.0% (used 407677 bytes from 1044464 bytes)
Building /data/buzzer/.pioenvs/buzzer/firmware.bin
esp8266_copy_factory_bin(["/data/buzzer/.pioenvs/buzzer/firmware.bin"], ["/data/buzzer/.pioenvs/buzzer/firmware.elf"])
========================= [SUCCESS] Took 18.96 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.1.98
INFO Uploading /data/buzzer/.pioenvs/buzzer/firmware.bin (411824 bytes)
INFO Compressed to 287084 bytes
Uploading: [============================================================] 100% Done...
INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.98 using esphome API
INFO Successfully connected to 192.168.1.98
[10:43:53][I][app:102]: ESPHome version 2022.6.2 compiled on Jul 31 2022, 10:43:16
[10:43:53][C][wifi:491]: WiFi:
[10:43:53][C][wifi:353]: Local MAC: 48:3F:DA:77:91:24
[10:43:53][C][wifi:354]: SSID: 'WIFI_4BC8'[redacted]
[10:43:53][C][wifi:355]: IP Address: 192.168.1.98
[10:43:53][C][wifi:356]: BSSID: 5C:02:14:FA:8A:0E[redacted]
[10:43:53][C][wifi:358]: Hostname: 'buzzer'
[10:43:53][C][wifi:360]: Signal strength: -65 dB ▂▄▆█
[10:43:53][C][wifi:364]: Channel: 2
[10:43:53][C][wifi:365]: Subnet: 255.255.255.0
[10:43:53][C][wifi:366]: Gateway: 192.168.1.1
[10:43:53][C][wifi:367]: DNS1: 0.0.0.0
[10:43:53][C][wifi:368]: DNS2: 0.0.0.0
[10:43:53][C][logger:275]: Logger:
[10:43:53][C][logger:276]: Level: DEBUG
[10:43:53][C][logger:277]: Log Baud Rate: 115200
[10:43:53][C][logger:278]: Hardware UART: UART0
[10:43:53][C][switch.gpio:050]: GPIO Switch 'Relay #1'
[10:43:53][C][switch.gpio:050]: Inverted: YES
[10:43:53][C][switch.gpio:051]: Pin: GPIO5
[10:43:53][C][switch.gpio:073]: Restore Mode: Restore (Defaults to OFF)
[10:43:53][C][captive_portal:088]: Captive Portal:
[10:43:53][C][mdns:084]: mDNS:
[10:43:53][C][mdns:085]: Hostname: buzzer
[10:43:53][C][ota:085]: Over-The-Air Updates:
[10:43:53][C][ota:086]: Address: 192.168.1.98:8266
[10:43:53][C][api:138]: API Server:
[10:43:53][C][api:139]: Address: 192.168.1.98:6053
[10:43:53][C][api:143]: Using noise encryption: NO
[10:43:53][C][wifi_signal.sensor:009]: WiFi Signal 'Relai Signal WiFi'
[10:43:53][C][wifi_signal.sensor:009]: Device Class: 'signal_strength'
[10:43:53][C][wifi_signal.sensor:009]: State Class: 'measurement'
[10:43:53][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm'
[10:43:53][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[10:44:24][D][sensor:124]: 'Relai Signal WiFi': Sending state -65.00000 dBm with 0 decimals of accuracy
[10:45:16][D][switch:013]: 'Relay #1' Turning ON.
[10:45:16][D][switch:037]: 'Relay #1': Sending state ON
[10:45:24][D][sensor:124]: 'Relai Signal WiFi': Sending state -67.00000 dBm with 0 decimals of accuracy
[10:46:24][D][sensor:124]: 'Relai Signal WiFi': Sending state -62.00000 dBm with 0 decimals of accuracy
[10:47:03][D][switch:017]: 'Relay #1' Turning OFF.
[10:47:03][D][switch:037]: 'Relay #1': Sending state OFF
Merci d’avance pour votre aide