hey guys,
ive set up my esp32 board to do quite a lot (?) of things - measure temp, ultrasonic sensor, 4 relay switch board and 3 buttons. so the sensors are working fine, but im having problems with random relay switch tiggered by button that is not even touched at all (even changed). please, could you check my config?
im not using any physical resistors, just enabled pulldown in config.
switches were connected to GND + GPIO and then later changed to 3v3 + GPIO.
relays are connected to 5V + GND. tried them with 3v3 but made no difference.
sensors are 5v and works fine.
please - if youve got any ideas - please comment below
Thank you!
esphome:
name: garaz_barak_esp32
platform: ESP32
board: esp-wrover-kit
wifi:
ssid: "wifi"
password: "pass"
reboot_timeout: 0s
manual_ip:
static_ip: 192.168.1.119
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Home Assistant API
api:
reboot_timeout: 0s
sun:
latitude: 50.6
longitude: 17.8
# At least one time source is required
time:
- platform: homeassistant
ota:
switch:
- platform: gpio
name: "wolny_relay"
pin:
number: GPIO27
id: wolny_relay
inverted: yes
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: "gniazdo_lewe"
pin:
number: GPIO26
id: gniazdo_lewe
inverted: yes
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: "gniazdo_prawe"
pin:
number: GPIO33
id: gniazdo_prawe
inverted: yes
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: "garaz_swiatlo"
pin:
number: GPIO25
id: swiatlo
inverted: yes
restore_mode: RESTORE_DEFAULT_OFF
binary_sensor:
- platform: gpio
pin:
number: GPIO15
mode: INPUT_PULLDOWN
name: "GUZIK"
on_press:
then:
- switch.toggle: swiatlo
- platform: gpio
pin:
number: 22
mode: INPUT_PULLDOWN
inverted: true
name: "drzwi_garaz"
device_class: garage_door
on_press:
- if:
condition:
- sun.is_below_horizon:
then:
- switch.turn_on: swiatlo
- delay: 180s
- switch.turn_off: swiatlo
on_release:
then:
- switch.turn_off: swiatlo
- platform: gpio
pin:
number: GPIO34
mode: INPUT_PULLDOWN
inverted: true
name: "szopa_drzwi"
device_class: door
sensor:
- platform: ultrasonic
trigger_pin: 19
echo_pin: 21
name: "garaz_ultrasonic_sensor"
update_interval: 5s
pulse_time: 2s
filters:
- filter_out: nan
- platform: dht
model: DHT22
pin: GPIO23
temperature:
name: "Garage Temperature"
humidity:
name: "Garage Humidity"
update_interval: 60s