Hi everyone,
I’m new to EspHome, and my first project shows a weird behaviour. I hope someone could help me, because I have no idea about where is the problem.
I have an ESP32-CAM controlling a motor through a H-Bridge (DRV 8871). It also has two limit switches on each top. I’m using an ESP32 CAM because I would like to add a camera in the future.
On ESPHome, I set up two binay sensors, one for each limit switch. I also set up two switches, one for each conection of the H-Bridge. This configuration is really simple, so I can’t realise where is the problem.
Normal behaviour:
When the door is at the lower endstop (door closed) position, I can open the door without any problems until the upper endstop.
When it is at the upper enstop (door open) position, I can close the door without any problems until the lower endstop.
Problem:
When the door is at the middle of the stroke, when I turn on any of the switches, the door goes on the direction I selected, but after a few seconds, it stops, reverses direction and after that, the ESP reboots itself.
I read the YAML time after time, and I couldn’t find anything out of normal.
Here is the YAML:
esphome:
name: galineiro
friendly_name: Galiñeiro
esp32:
board: esp32cam
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "???????"
ota:
password: "??????"
wifi:
networks:
- ssid: !secret wifi_ssid2
password: !secret wifi_password2
- ssid: !secret wifi_ssid3
password: !secret wifi_password3
manual_ip:
static_ip: 192.168.1.11
gateway: 192.168.1.1
subnet: 255.255.255.0
dns1: 192.168.1.1
dns2: 8.8.4.4
ap:
ssid: "Galineiro Fallback Hotspot"
password: "??????"
captive_portal:
web_server:
port: 80
text_sensor:
- platform: wifi_info
ip_address:
name: Direccion IP
ssid:
name: Nome da rede
mac_address:
name: MAC
scan_results:
name: Redes Dispoñibles
#Controladores, cara o drv do motor. Pines 13 e 33
switch:
- platform: gpio
pin: GPIO13 #12 #GPIO2
name: "Abrir galiñeiro"
id: abrir_gali
- platform: gpio
pin: GPIO33 #15
name: "Cerrar galiñeiro"
id: cerrar_gali
# Sensores, desde o final de carrera NO. Cando a porta chega ao final de carrera, accionase, e desde o com chega unha señal que fai que pare. Ao mesmo tempo, o final de carrera desconecta o abrir.
binary_sensor:
- platform: gpio
pin: GPIO14 #1 #4 2 no va, 13 no va, 16 no carga. Quitar o led
name: Galiñeiro Aberto
id: gali_aberto
- platform: gpio
pin: GPIO4
name: Galiñeiro Cerrado
id: gali_cerrado
Additional information
If someone wants to see the problem, here is a link:
I’m not a youtuber, I published the video there because I couldn’t attach the file (>10 MB)
Sorry if I do something against the rules, I opened a thread on Github but they told me to publish it here.
Thanks you for your time reading this!
And yes, this is another Smart Chicken Door project